Crypto payments API documentation

Accept USDT, USDC, BTC, ETH and 25+ other coins with our hosted crypto checkout. Your server creates the payment in USD, the customer pays on our page, and we tell your server when the money has arrived on-chain — with a signed IPN.

Introduction


ZurvaPay crypto payments let your customers pay in cryptocurrency from any wallet or exchange, while you price your order in USD. We quote the exact coin amount at the live rate, watch the blockchain, and credit your crypto wallet with us when the deposit is confirmed.

Your server creates the payment, the customer is redirected to our hosted crypto checkout, and we tell your server when the money has arrived on-chain — with a signed IPN.

CreatePOST https://zurvapay.com/payment/initiate (hosted checkout)
AmountAlways USD (currency=USD). The customer pays the coin amount we quote.
MinimumUSD 1.00.
MaximumNo limit.
Rate lock59 minutes from creation.
FeeNo gateway charge on crypto at present (charge = 0). The customer pays the network fee.

How it works


  1. Create the payment — your server calls POST /payment/initiate with currency=USD and the USD amount, and gets a checkout url.
  2. Redirect — send the customer to our crypto checkout (the url with /crypto-checkout).
  3. Customer pays — picks a coin, sees the address, QR code and exact amount, and pays from any wallet or exchange. Our watcher checks the chain every minute.
  4. Confirmed — the payment becomes success, the signed IPN is POSTed to your ipn_url, the customer returns to your success_url, and you deliver the order once.

Coins & networks


The customer picks one of these on our checkout. The code is the coin and its network — the customer must send on that exact network. Your account may have fewer coins enabled; only enabled coins are offered.

coinCoin and network
USDT_TRC20USDT on TRON (TRC-20)
USDT_BEP20USDT on BNB Smart Chain (BEP-20)
USDT_ERC20USDT on Ethereum (ERC-20)
USDT_SPLUSDT on Solana
USDT_POLYGONUSDT on Polygon
USDT_TONUSDT on TON
USDT_ARBITRUMUSDT on Arbitrum One
USDT_AVALANCHEUSDT on Avalanche C-Chain
USDC_ERC20USDC on Ethereum
USDC_SPLUSDC on Solana
USDC_BEP20USDC on BNB Smart Chain
USDC_POLYGONUSDC on Polygon
USDC_ARBITRUMUSDC on Arbitrum One
USDC_AVALANCHEUSDC on Avalanche C-Chain
BTCBitcoin
ETHEther (ERC-20 network)
SOLSolana
BNBBNB (BSC / BEP-20)
TRXTRON
XRPXRP Ledger (memo required)
LTCLitecoin
DOGEDogecoin
BCHBitcoin Cash
ADACardano
DASHDash
ZECZcash
AVAX_CAvalanche C-Chain
POL_POLYGONPOL on Polygon
POL_ERC20POL on Ethereum
DAI_BEP20DAI on BNB Smart Chain
SHIBShiba Inu (ERC-20)
GRAMGRAM on TON

IPN (Webhook)


When the payment is settled we POST the result to your ipn_url as form fields. Answer with any HTTP 2xx. Until you do, we retry: 3 quick tries, then with back-off for about 11 hours (10 tries in total).

FieldValue
statussuccess
identifierYour identifier.
signature, status_signatureSee Verify the signature.
data[payment_trx]Our transaction ID.
data[amount]The coin amount credited, as a string (e.g. 5.3049).
data[currency][code]The coin, e.g. USDT.
data[payment_method] / data[payment_type]crypto / direct
data[charge]0
data[amount_status]exact or underpaid.
data[expected_amount], data[received_amount], data[shortfall_amount]Coin amounts: asked, credited, missing.
data[initiated_usd], data[received_usd_amount]The USD you created and the USD value of what was credited.
What we POST
POST https://yourshop.com/zurvapay/ipn.php
Content-Type: application/x-www-form-urlencoded

status=success
signature=B81F0A...7C2D
status_signature=0E44D9...91AB
identifier=ORD1001
data[payment_trx]=TRX8KQ2M1ZP0
data[amount]=5.3049                 <- coin amount credited (not USD)
data[account_holder]=
data[payment_type]=direct
data[payment_method]=crypto
data[payment_timestamp]=2026-12-05 14:00:00
data[charge]=0
data[currency][code]=USDT
data[currency][symbol]=USDT
data[amount_status]=exact           <- exact | underpaid
data[expected_amount]=5.3049
data[received_amount]=5.3049
data[shortfall_amount]=0
data[initiated_usd]=5.30
data[received_usd_amount]=5.30

Verify the signature


Both signatures are HMAC-SHA256 with your secret key, hex, upper case. Use the amount string exactly as received.

signatureUPPER(HMAC_SHA256(amount + identifier, SECRET_KEY))
status_signatureUPPER(HMAC_SHA256("success|" + identifier + "|" + amount, SECRET_KEY))
  1. Check both signatures (constant-time compare).
  2. Find the order by identifier. Already paid? Answer 200 and stop — IPNs can arrive more than once.
  3. Check data[amount_status]: on underpaid decide whether to deliver or ask for data[shortfall_amount].
  4. Mark the order paid once, then answer 200.

The same two signatures come in the status answer when status = success, so a polling integration verifies the same way.

<?php
// ipn.php - the URL you send as ipn_url
require 'config.php';

$status     = $_POST['status'] ?? '';
$identifier = $_POST['identifier'] ?? '';
$amount     = $_POST['data']['amount'] ?? '';      // use the RAW string, do not round it

$sig  = strtoupper(hash_hmac('sha256', $amount . $identifier, SECRET_KEY));
$sig2 = strtoupper(hash_hmac('sha256', $status . '|' . $identifier . '|' . $amount, SECRET_KEY));

if ($status !== 'success'
    || !hash_equals($sig, $_POST['signature'] ?? '')
    || !hash_equals($sig2, $_POST['status_signature'] ?? '')) {
    http_response_code(400);
    exit('invalid');
}

$order = find_order_by_identifier($identifier);    // your own function
if (!$order) { http_response_code(404); exit('unknown order'); }
if ($order['paid']) { exit('OK'); }                // already done: answer 2xx, do nothing

// Crypto: data[amount] is the coin amount that arrived. Check it.
$amountStatus = $_POST['data']['amount_status'] ?? 'exact';
if ($amountStatus === 'underpaid') {
    // The customer sent less (at least 90%). Decide: credit what arrived
    // (data[received_usd_amount]) or ask for the shortfall (data[shortfall_amount]).
}
mark_order_paid($identifier, $_POST['data']['payment_trx']);   // once, in a DB transaction
http_response_code(200);
echo 'OK';                                          // any 2xx stops the retries
// ipn route (Express): app.use(express.urlencoded({ extended: true }))
const crypto = require('crypto');
const SECRET = process.env.SECRET_KEY;

function hmac(text) {
  return crypto.createHmac('sha256', SECRET).update(text).digest('hex').toUpperCase();
}
function same(a, b) {
  const x = Buffer.from(String(a)), y = Buffer.from(String(b));
  return x.length === y.length && crypto.timingSafeEqual(x, y);
}

app.post('/zurvapay/ipn', async (req, res) => {
  const { status, identifier, signature, status_signature } = req.body;
  const amount = req.body.data && req.body.data.amount;   // raw string

  if (status !== 'success'
      || !same(hmac(amount + identifier), signature)
      || !same(hmac(status + '|' + identifier + '|' + amount), status_signature)) {
    return res.status(400).send('invalid');
  }
  const order = await findOrder(identifier);
  if (!order) return res.status(404).send('unknown order');
  if (!order.paid) await markOrderPaid(identifier, req.body.data.payment_trx);  // once
  res.send('OK');                                          // 2xx stops the retries
});
# ipn view (Flask)
import hmac, hashlib, os
from flask import Flask, request

app = Flask(__name__)
SECRET = os.environ["SECRET_KEY"].encode()

def sign(text):
    return hmac.new(SECRET, text.encode(), hashlib.sha256).hexdigest().upper()

def ipn():
    f = request.form
    status, identifier = f.get("status", ""), f.get("identifier", "")
    amount = f.get("data[amount]", "")          # raw string
    ok = (status == "success"
          and hmac.compare_digest(sign(amount + identifier), f.get("signature", ""))
          and hmac.compare_digest(sign(f"{status}|{identifier}|{amount}"), f.get("status_signature", "")))
    if not ok:
        return "invalid", 400
    order = find_order(identifier)
    if not order:
        return "unknown order", 404
    if not order.paid:
        mark_order_paid(identifier, f.get("data[payment_trx]"))   # once
    return "OK", 200                            # 2xx stops the retries

app.add_url_rule("/zurvapay/ipn", view_func=ipn, methods=["POST"])

Amount rules


Deposits go to a shared address, so a payment is recognised by its exact amount, coin and network. That is why the customer must send exactly expected_amount.

The customer sentWhat happensIPN
Exactly the amountSettles once confirmed.amount_status=exact
More than the amountSettles as paid. You are credited the amount that was asked.amount_status=exact
Less, at least 90%Waits for a top-up to the same address until the 59-minute lock ends, then settles at what arrived.amount_status=underpaid + shortfall_amount
Less than 90%Not settled automatically. Held for review by our team — contact support with the transaction ID.—
Wrong coin or network, or no matching paymentNot credited automatically. Held for review — contact support with the transaction ID and the blockchain hash.—

Settlement time depends on the network: the watcher runs every minute, but a deposit needs its confirmations first. If the live rate service is down, new payments are refused for a short time (crypto_unavailable) — existing ones keep their locked rate.

Security checklist


  • Keep the secret key on your server only. Rotate it in the merchant panel if it ever leaks.
  • Never mark an order paid from the browser, a return URL or the create answer — only from a verified IPN or a verified success status.
  • Verify signature and status_signature with a constant-time compare.
  • Make your IPN handler idempotent: the same IPN can arrive more than once.
  • Use a new identifier for every attempt.
  • Check amount_status and the amounts before delivering.
  • Keep a cron job (cron job guide) for orders still pending, in case your server was down when the IPN came.