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.
| Create | POST https://zurvapay.com/payment/initiate (hosted checkout) |
|---|---|
| Amount | Always USD (currency=USD). The customer pays the coin amount we quote. |
| Minimum | USD 1.00. |
| Maximum | No limit. |
| Rate lock | 59 minutes from creation. |
| Fee | No gateway charge on crypto at present (charge = 0). The customer pays the network fee. |
How it works
- Create the payment — your server calls
POST /payment/initiatewithcurrency=USDand the USD amount, and gets a checkouturl. - Redirect — send the customer to our crypto checkout (the
urlwith/crypto-checkout). - 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.
- Confirmed — the payment becomes
success, the signed IPN is POSTed to youripn_url, the customer returns to yoursuccess_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.
coin | Coin and network |
|---|---|
USDT_TRC20 | USDT on TRON (TRC-20) |
USDT_BEP20 | USDT on BNB Smart Chain (BEP-20) |
USDT_ERC20 | USDT on Ethereum (ERC-20) |
USDT_SPL | USDT on Solana |
USDT_POLYGON | USDT on Polygon |
USDT_TON | USDT on TON |
USDT_ARBITRUM | USDT on Arbitrum One |
USDT_AVALANCHE | USDT on Avalanche C-Chain |
USDC_ERC20 | USDC on Ethereum |
USDC_SPL | USDC on Solana |
USDC_BEP20 | USDC on BNB Smart Chain |
USDC_POLYGON | USDC on Polygon |
USDC_ARBITRUM | USDC on Arbitrum One |
USDC_AVALANCHE | USDC on Avalanche C-Chain |
BTC | Bitcoin |
ETH | Ether (ERC-20 network) |
SOL | Solana |
BNB | BNB (BSC / BEP-20) |
TRX | TRON |
XRP | XRP Ledger (memo required) |
LTC | Litecoin |
DOGE | Dogecoin |
BCH | Bitcoin Cash |
ADA | Cardano |
DASH | Dash |
ZEC | Zcash |
AVAX_C | Avalanche C-Chain |
POL_POLYGON | POL on Polygon |
POL_ERC20 | POL on Ethereum |
DAI_BEP20 | DAI on BNB Smart Chain |
SHIB | Shiba Inu (ERC-20) |
GRAM | GRAM on TON |
memo (destination tag). Show it and tell the customer it is required — without it the deposit cannot be matched to the payment.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).
| Field | Value |
|---|---|
status | success |
identifier | Your identifier. |
signature, status_signature | See 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. |
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.
signature | UPPER(HMAC_SHA256(amount + identifier, SECRET_KEY)) |
status_signature | UPPER(HMAC_SHA256("success|" + identifier + "|" + amount, SECRET_KEY)) |
- Check both signatures (constant-time compare).
- Find the order by
identifier. Already paid? Answer 200 and stop — IPNs can arrive more than once. - Check
data[amount_status]: onunderpaiddecide whether to deliver or ask fordata[shortfall_amount]. - 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 sent | What happens | IPN |
|---|---|---|
| Exactly the amount | Settles once confirmed. | amount_status=exact |
| More than the amount | Settles 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 payment | Not 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
successstatus. - Verify
signatureandstatus_signaturewith a constant-time compare. - Make your IPN handler idempotent: the same IPN can arrive more than once.
- Use a new
identifierfor every attempt. - Check
amount_statusand 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.