API reference
Payments
A payment is one order your customer pays in crypto. You create it from your server, send the customer to the hosted checkout, and get a webhook when it's paid.
The payment object#
Every payment endpoint returns this object. Amount fields are decimal strings in the chosen coin's units and are null until the customer picks a coin (for USD-priced payments).
Fields
payment_idstring- Unique ID, prefixed pay_.
order_idstring- Your reference, unique per project.
order_namestring- Shown to the customer at checkout.
statusstring- One of the statuses below.
pricing_currencystringUSD, or a currency code when the price is set in a coin.amount_usd / fee_usdstring | null- USD value of the price and the fee. For coin-priced payments, converted at the quote rate.
accepted_currenciesstring[]- Codes the customer can pay with.
currencystring | null- The code the customer chose. null until they pick one.
amount / fee / pay_amountstring | null- Price, fee and the exact amount the customer must send, in the chosen coin. pay_amount = amount + fee when the customer pays the fee.
received_amountstring | null- Total confirmed on-chain so far.
net_amountstring | null- Credited to your balance once paid (received − fee).
addressstring | null- One-time deposit address for this payment, once a coin is chosen.
payment_urlstring- Hosted checkout page. Send the customer here.
fee_payerstringcustomerormerchant.testnetboolean- true when the accepted currencies are testnet codes.
success_url / cancel_url / webhook_url / notesstring | null- As sent when creating the payment.
refund_addressstring | null- Set when you request a refund.
expires_at / paid_at / created_atstring | null- ISO 8601 timestamps (UTC).
{ "payment_id": "pay_8kQ2mZx7LrT4bW9e", "order_id": "order_4821", "order_name": "Annual plan", "notes": null, "status": "paid", "pricing_currency": "USD", "amount_usd": "250", "fee_usd": "1.25", "accepted_currencies": [ "BSC_USDT", "ETH_USDT", "TRON_USDT" ], "testnet": false, "fee_payer": "customer", "currency": "BSC_USDT", "amount": "250", "fee": "1.25", "pay_amount": "251.25", "received_amount": "251.25", "net_amount": "250", "address": "0x8f3A6b2C91d4E5f708A1b2C3d4E5f6A7b8C992c1", "payment_url": "https://www.jagpay.io/pay/pay_8kQ2mZx7LrT4bW9e", "success_url": "https://shop.example/thanks", "cancel_url": "https://shop.example/cart", "webhook_url": "https://shop.example/hooks/jagpay", "refund_address": null, "expires_at": "2026-11-26T11:00:00.000Z", "paid_at": "2026-11-26T10:12:00.000Z", "created_at": "2026-11-26T10:00:00.000Z"}Statuses#
A payment moves through these states. paid, expired, cancelled and refunded are final. Fulfil orders on paid (ideally from the webhook).
| Status | Meaning |
|---|---|
awaiting_selection | USD-priced and the customer hasn't picked a coin yet. |
pending | Deposit address assigned; waiting for funds. |
confirming | Funds seen on-chain, waiting for block confirmations. |
underpaid | Confirmed funds are less than pay_amount. The customer can top up the same address, or you can accept / refund. |
paid | Fully paid and credited to your balance. Final. |
expired | No funds arrived before expires_at. Final. |
cancelled | The customer cancelled at checkout. Final. |
requires_action | Funds arrived after expiry. Accept or refund. |
refund_requested | You asked for a refund; a refund payout is queued. |
refunded | The refund was confirmed on-chain. Final. |
Fees
Each payment costs 0.5% of the amount, minimum $0.50. With fee_payer: "customer" the fee is added to pay_amount; with "merchant" it's deducted from net_amount.
Overpaid, underpaid and late payments
- Overpaid: the payment becomes
paidand everything received is credited (minus the fee). - Underpaid: status
underpaid. The customer can send the rest to the same address until it expires, or you can accept what arrived or refund it. - Late (funds after
expires_at): statusrequires_action; accept or refund.
Create a payment#
/api/v1/paymentsAuth: API keyCreates a payment and returns it with its payment_url. Price in USD and let the customer choose between several coins, or price directly in one coin (then the deposit address and exact pay_amount are returned straight away).
Body parameters
order_idstringrequired- Your order reference. Must be unique within the project; a duplicate returns 409 with the existing payment_id.1–128 characters.
order_namestringrequired- What the customer is paying for. Shown on the checkout page.1–200 characters.
amountstringrequired- Price as a decimal string. In
USDit's dollars (up to 2 decimals); for a coin it's that coin's units.Must be above the fee whenfee_payerismerchant. currencystringrequiredUSDto price in dollars, or a currency code likeBSC_USDTto price in that coin.accepted_currenciesstring[]optional- USD-priced only: the codes the customer may pay with. With one code the address is assigned immediately; with several the customer chooses at checkout. Must be all mainnet or all testnet. For a coin-priced payment omit it (it's that coin).Up to 20 codes. Required when currency is USD.
fee_payer"customer" | "merchant"requiredcustomer: the fee is added to what the customer sends.merchant: the customer sends the price and the fee is taken from what you receive.expires_inintegeroptional- Seconds until the payment expires.900–604800 (15 min to 7 days). Default 3600.
success_urlstringoptional- Where checkout sends the customer after the payment is paid.https URL.
cancel_urlstringoptional- Where checkout sends the customer if they cancel. Also enables the Cancel button.https URL.
webhook_urlstringoptional- Receives the
payment.paidevent. See Webhooks.https URL. notesstringoptional- Internal notes, visible in your dashboard only.Up to 2000 characters.
Coin-priced example
Price in a coin and the response already contains the deposit address and the exact amount to send:
{ "order_id": "order_4822", "order_name": "Annual plan", "amount": "250", "currency": "BSC_USDT", "fee_payer": "customer"}{ "status": true, "data": { "payment_id": "pay_3nV7cY1qPw8KdS2f", "order_id": "order_4822", "order_name": "Annual plan", "notes": null, "status": "pending", "pricing_currency": "BSC_USDT", "amount_usd": "250", "fee_usd": "1.25", "accepted_currencies": [ "BSC_USDT" ], "testnet": false, "fee_payer": "customer", "currency": "BSC_USDT", "amount": "250", "fee": "1.25", "pay_amount": "251.25", "received_amount": "0", "net_amount": null, "address": "0x8f3A6b2C91d4E5f708A1b2C3d4E5f6A7b8C992c1", "payment_url": "https://www.jagpay.io/pay/pay_3nV7cY1qPw8KdS2f", "success_url": "https://shop.example/thanks", "cancel_url": "https://shop.example/cart", "webhook_url": "https://shop.example/hooks/jagpay", "refund_address": null, "expires_at": "2026-11-26T11:00:00.000Z", "paid_at": null, "created_at": "2026-11-26T10:00:00.000Z" }}curl -X POST https://www.jagpay.io/api/v1/payments \ -H "Authorization: Bearer $JAGPAY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "order_id": "order_4821", "order_name": "Annual plan", "amount": "250.00", "currency": "USD", "accepted_currencies": [ "BSC_USDT", "ETH_USDT", "TRON_USDT" ], "fee_payer": "customer", "expires_in": 3600, "success_url": "https://shop.example/thanks", "cancel_url": "https://shop.example/cart", "webhook_url": "https://shop.example/hooks/jagpay" }'{ "status": true, "data": { "payment_id": "pay_8kQ2mZx7LrT4bW9e", "order_id": "order_4821", "order_name": "Annual plan", "notes": null, "status": "awaiting_selection", "pricing_currency": "USD", "amount_usd": "250", "fee_usd": "1.25", "accepted_currencies": [ "BSC_USDT", "ETH_USDT", "TRON_USDT" ], "testnet": false, "fee_payer": "customer", "currency": null, "amount": null, "fee": null, "pay_amount": null, "received_amount": null, "net_amount": null, "address": null, "payment_url": "https://www.jagpay.io/pay/pay_8kQ2mZx7LrT4bW9e", "success_url": "https://shop.example/thanks", "cancel_url": "https://shop.example/cart", "webhook_url": "https://shop.example/hooks/jagpay", "refund_address": null, "expires_at": "2026-11-26T11:00:00.000Z", "paid_at": null, "created_at": "2026-11-26T10:00:00.000Z" }}List payments#
/api/v1/paymentsAuth: API keyReturns payments newest first. Use next_cursor to page through.
Query parameters
limitintegeroptional- Page size.1–100, default 25.
cursorstringoptional- next_cursor from the previous page.
statusstringoptional- Only payments in this status.
testnet"true" | "false"optional- Only testnet or only mainnet payments.
curl https://www.jagpay.io/api/v1/payments?status=paid&limit=25 \ -H "Authorization: Bearer $JAGPAY_API_KEY"{ "status": true, "data": { "payments": [ { "payment_id": "pay_8kQ2mZx7LrT4bW9e", "order_id": "order_4821", "order_name": "Annual plan", "notes": null, "status": "paid", "pricing_currency": "USD", "amount_usd": "250", "fee_usd": "1.25", "accepted_currencies": [ "BSC_USDT", "ETH_USDT", "TRON_USDT" ], "testnet": false, "fee_payer": "customer", "currency": "BSC_USDT", "amount": "250", "fee": "1.25", "pay_amount": "251.25", "received_amount": "251.25", "net_amount": "250", "address": "0x8f3A6b2C91d4E5f708A1b2C3d4E5f6A7b8C992c1", "payment_url": "https://www.jagpay.io/pay/pay_8kQ2mZx7LrT4bW9e", "success_url": "https://shop.example/thanks", "cancel_url": "https://shop.example/cart", "webhook_url": "https://shop.example/hooks/jagpay", "refund_address": null, "expires_at": "2026-11-26T11:00:00.000Z", "paid_at": "2026-11-26T10:12:00.000Z", "created_at": "2026-11-26T10:00:00.000Z" } ], "next_cursor": "pay_8kQ2mZx7LrT4bW9e" }}Retrieve a payment#
/api/v1/payments/:payment_idAuth: API keyReturns the payment plus transfers: every on-chain deposit seen for it, with its transaction hash, amount, status (confirming, confirmed, dropped) and whether it arrived after expiry (late).
Path parameters
payment_idstringrequired- The pay_… ID.
curl https://www.jagpay.io/api/v1/payments/pay_8kQ2mZx7LrT4bW9e \ -H "Authorization: Bearer $JAGPAY_API_KEY"{ "status": true, "data": { "payment_id": "pay_8kQ2mZx7LrT4bW9e", "order_id": "order_4821", "order_name": "Annual plan", "notes": null, "status": "paid", "pricing_currency": "USD", "amount_usd": "250", "fee_usd": "1.25", "accepted_currencies": [ "BSC_USDT", "ETH_USDT", "TRON_USDT" ], "testnet": false, "fee_payer": "customer", "currency": "BSC_USDT", "amount": "250", "fee": "1.25", "pay_amount": "251.25", "received_amount": "251.25", "net_amount": "250", "address": "0x8f3A6b2C91d4E5f708A1b2C3d4E5f6A7b8C992c1", "payment_url": "https://www.jagpay.io/pay/pay_8kQ2mZx7LrT4bW9e", "success_url": "https://shop.example/thanks", "cancel_url": "https://shop.example/cart", "webhook_url": "https://shop.example/hooks/jagpay", "refund_address": null, "expires_at": "2026-11-26T11:00:00.000Z", "paid_at": "2026-11-26T10:12:00.000Z", "created_at": "2026-11-26T10:00:00.000Z", "transfers": [ { "tx_hash": "0x5e1c0b7a2f3d4e5f60718293a4b5c6d7e8f90123456789abcdef0123456789ab", "currency": "BSC_USDT", "amount": "251.25", "status": "confirmed", "late": false, "block_number": "44219873", "created_at": "2026-11-26T10:10:00.000Z" } ] }}Accept a payment#
/api/v1/payments/:payment_id/acceptAuth: API keyFor an underpaid or requires_action payment: accept what was received. The fee is recalculated on the received amount, the rest is credited and the payment becomes paid (sending payment.paid).
Returns 409 for any other status. No body.
curl -X POST https://www.jagpay.io/api/v1/payments/pay_8kQ2mZx7LrT4bW9e/accept \ -H "Authorization: Bearer $JAGPAY_API_KEY"{ "status": true, "data": { "payment_id": "pay_8kQ2mZx7LrT4bW9e", "order_id": "order_4821", "order_name": "Annual plan", "notes": null, "status": "paid", "pricing_currency": "USD", "amount_usd": "250", "fee_usd": "1.25", "accepted_currencies": [ "BSC_USDT", "ETH_USDT", "TRON_USDT" ], "testnet": false, "fee_payer": "customer", "currency": "BSC_USDT", "amount": "250", "fee": "1.25", "pay_amount": "251.25", "received_amount": "251.25", "net_amount": "250", "address": "0x8f3A6b2C91d4E5f708A1b2C3d4E5f6A7b8C992c1", "payment_url": "https://www.jagpay.io/pay/pay_8kQ2mZx7LrT4bW9e", "success_url": "https://shop.example/thanks", "cancel_url": "https://shop.example/cart", "webhook_url": "https://shop.example/hooks/jagpay", "refund_address": null, "expires_at": "2026-11-26T11:00:00.000Z", "paid_at": "2026-11-26T10:12:00.000Z", "created_at": "2026-11-26T10:00:00.000Z" }}Refund a payment#
/api/v1/payments/:payment_id/refundAuth: API keyFor an underpaid or requires_action payment: send what was received back to the customer. The payment becomes refund_requested, a refund payout is queued, and it becomes refunded once confirmed on-chain.
Body parameters
addressstringrequired- The customer's wallet on the same network as the payment. Validated for that network.20–64 characters.
curl -X POST https://www.jagpay.io/api/v1/payments/pay_8kQ2mZx7LrT4bW9e/refund \ -H "Authorization: Bearer $JAGPAY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "address": "0x4B20993Bc481177ec7E8f571ceCaE8A9e22C02db" }'{ "status": true, "data": { "payment_id": "pay_8kQ2mZx7LrT4bW9e", "order_id": "order_4821", "order_name": "Annual plan", "notes": null, "status": "refund_requested", "pricing_currency": "USD", "amount_usd": "250", "fee_usd": "1.25", "accepted_currencies": [ "BSC_USDT", "ETH_USDT", "TRON_USDT" ], "testnet": false, "fee_payer": "customer", "currency": "BSC_USDT", "amount": "250", "fee": "1.25", "pay_amount": "251.25", "received_amount": "251.25", "net_amount": null, "address": "0x8f3A6b2C91d4E5f708A1b2C3d4E5f6A7b8C992c1", "payment_url": "https://www.jagpay.io/pay/pay_8kQ2mZx7LrT4bW9e", "success_url": "https://shop.example/thanks", "cancel_url": "https://shop.example/cart", "webhook_url": "https://shop.example/hooks/jagpay", "refund_address": "0x4B20993Bc481177ec7E8f571ceCaE8A9e22C02db", "expires_at": "2026-11-26T11:00:00.000Z", "paid_at": null, "created_at": "2026-11-26T10:00:00.000Z" }}Resend a webhook#
/api/v1/payments/:payment_id/webhooks/resendAuth: API keyRe-sends the latest webhook for this payment (same delivery ID and payload, freshly signed). Returns 404 if none was ever sent.
curl -X POST https://www.jagpay.io/api/v1/payments/pay_8kQ2mZx7LrT4bW9e/webhooks/resend \ -H "Authorization: Bearer $JAGPAY_API_KEY"{ "status": true, "data": { "delivery_id": "evt_Qm3x9T2kLp7Vw4Rb" }}Hosted checkout#
payment_url opens a JagPay checkout page branded with your project's name, logo and support link. It shows the exact amount, network, a QR code and the deposit address, and updates live as funds arrive.
- When it's paid, the customer is redirected to
success_url(if set). If they cancel, tocancel_url. - Don't rely on the redirect to fulfil orders: the customer may close the tab. Use the webhook or retrieve the payment.
- Each deposit address is used for one payment only, so funds are always matched to the right order.
Building your own checkout?
Create a coin-priced payment (or a USD payment with one accepted currency) and showaddress and pay_amount in your own UI.