API reference
Payouts
Send crypto from your JagPay balance to any wallet: pay suppliers, partners or customers. Payouts are grouped into on-chain batches every couple of minutes.
Before you start#
Payouts move real money, so a few safeguards must be in place first:
- Two-factor authentication on the project owner's account (Settings → Security). Without it, payout requests fail with
403anddetails.code: "two_factor_not_enabled". - A payout signing secret (Settings → Payout signing → Generate). It starts with
pss_and is shown once. Every API payout request must be signed with it (see Signing requests), so a leaked API key alone can't move funds. - Enough balance in the currency, covering amount + fee + network fee.
How a payout is processed
| Status | What's happening |
|---|---|
pending | Accepted. amount + fee + gas_fee were debited from your balance. Waiting for the next batch (every ~2 minutes). |
batched | Included in an on-chain batch transaction; waiting for confirmations. |
sent | Confirmed on-chain. tx_hash is set. Final. |
failed | The transfer failed on-chain. amount + fee are returned to your balance; the network fee was spent. Final. |
If the payout vault is temporarily short (deposits are still being moved into it), the batch waits and retries automatically; the payout stays pending.
The payout object#
Fields
payout_idstring- Unique ID, prefixed po_.
kindstringpayout(you sent it),refund(a payment refund) orsettlement(an auto-settle transfer).payment_idstring | null- The refunded payment, for refunds.
statusstringpending→batched→sentorfailed.currency / addressstring- What is sent, and where.
amountstring- What the recipient receives.
feestring- Service fee: 0.5% of the amount, minimum $0.50 (0 for auto-settlements).
gas_feestring- Network fee share, estimated when the payout is created.
totalstring- amount + fee + gas_fee, debited from your balance at creation.
tx_hashstring | null- The on-chain transaction once sent.
order_id / notes / webhook_urlstring | null- As sent when creating the payout.
created_at / updated_atstring- ISO 8601 timestamps (UTC).
{ "payout_id": "po_2Hk9sLq4Xv7Bn1Cz", "kind": "payout", "payment_id": null, "status": "sent", "currency": "BSC_USDT", "address": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", "amount": "1200", "fee": "6", "gas_fee": "0.12", "total": "1206.12", "tx_hash": "0x9a8b7c6d5e4f30211fedcba9876543210fedcba9876543210fedcba98765432", "order_id": "supplier-0091", "notes": "November invoice", "webhook_url": "https://shop.example/hooks/jagpay", "created_at": "2026-11-26T10:00:00.000Z", "updated_at": "2026-11-26T10:04:00.000Z"}Signing requests#
API-key calls to POST /api/v1/payouts and POST /api/v1/payouts/simulate must carry a JagPay-Signature header. Requests from the dashboard don't need one (they use 2FA codes instead).
JagPay-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256> signed string = "<t>.POST.<path>.<raw body>" key = your payout signing secret (pss_…)
pathis the URL path only, e.g./api/v1/payouts(no host, no query string).raw bodyis the exact JSON string you send. Serialize once and sign that same string; re-serializing can reorder keys.tmust be within 5 minutes of our clock, and each signature works once. Sign every request fresh, including retries.
import crypto from "node:crypto";function signPayout(secret, path, body, timestamp = Math.floor(Date.now() / 1000)) { // HMAC-SHA256 over "<timestamp>.POST.<path>.<raw body>" with your payout signing secret (pss_…) const v1 = crypto.createHmac("sha256", secret).update(`${timestamp}.POST.${path}.${body}`).digest("hex"); return `t=${timestamp},v1=${v1}`;}const path = "/api/v1/payouts";const body = JSON.stringify({ "currency": "BSC_USDT", "address": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", "amount": "1200", "order_id": "supplier-0091", "notes": "November invoice", "webhook_url": "https://shop.example/hooks/jagpay"}); // sign the exact string you sendconst res = await fetch(`https://www.jagpay.io${path}`, { method: "POST", headers: { Authorization: `Bearer ${process.env.JAGPAY_API_KEY}`, "Content-Type": "application/json", "JagPay-Signature": signPayout(process.env.JAGPAY_PAYOUT_SECRET, path, body), }, body,});const { status, data, error } = await res.json();Signature errors
| 401 message | Fix |
|---|---|
| Generate a payout signing secret in dashboard Settings → Payout signing… | No secret exists yet for this project. Generate one. |
| Missing or malformed jagpay-signature header | Send the header as t=<unix>,v1=<hex>. |
| Signature timestamp is outside the 5-minute window | Sync your server clock (NTP) and sign right before sending. |
| Invalid signature | Check the secret, the path and that you signed the exact body bytes. |
| Signature already used | Each signature works once; sign retries again. |
Simulate a payout#
/api/v1/payouts/simulateAuth: API key + signatureSame body and validation as creating a payout, but nothing is reserved or sent. Returns the service fee, the current network fee, the total and whether your balance covers it. The network fee is live, so it can move slightly before you create the payout.
Body parameters
currencystringrequired- A currency code you hold a balance in, e.g.
BSC_USDT. addressstringrequired- Recipient wallet on that currency's network. Validated for the network (0x… for BNB Chain / Ethereum, T… for Tron).20–64 characters.
amountstringrequired- What the recipient should receive, as a decimal string. Fees are added on top.
order_idstringoptional- Your reference and idempotency key: posting the same order_id again returns the existing payout instead of paying twice.1–128 characters. Strongly recommended.
notesstringoptional- Internal notes, visible in your dashboard.Up to 2000 characters.
webhook_urlstringoptional- Receives
payout.sent/payout.failed.https URL.
BODY='{"currency":"BSC_USDT","address":"0x71C7656EC7ab88b098defB751B7401B5f6d8976F","amount":"1200","order_id":"supplier-0091","notes":"November invoice","webhook_url":"https://shop.example/hooks/jagpay"}'TS=$(date +%s)SIG=$(printf '%s' "$TS.POST./api/v1/payouts/simulate.$BODY" | openssl dgst -sha256 -hmac "$JAGPAY_PAYOUT_SECRET" | sed 's/^.* //')curl -X POST https://www.jagpay.io/api/v1/payouts/simulate \ -H "Authorization: Bearer $JAGPAY_API_KEY" \ -H "Content-Type: application/json" \ -H "JagPay-Signature: t=$TS,v1=$SIG" \ -d "$BODY"{ "status": true, "data": { "currency": "BSC_USDT", "address": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", "amount": "1200", "fee": "6", "gas_fee": "0.12", "total": "1206.12", "balance": "12480.5", "sufficient": true }}Create a payout#
/api/v1/payoutsAuth: API key + signatureDebits amount + fee + gas_fee from your balance and queues the payout. It's sent in the next batch, usually within a few minutes; you get payout.sent or payout.failed at webhook_url.
Body parameters
currencystringrequired- A currency code you hold a balance in, e.g.
BSC_USDT. addressstringrequired- Recipient wallet on that currency's network. Validated for the network (0x… for BNB Chain / Ethereum, T… for Tron).20–64 characters.
amountstringrequired- What the recipient should receive, as a decimal string. Fees are added on top.
order_idstringoptional- Your reference and idempotency key: posting the same order_id again returns the existing payout instead of paying twice.1–128 characters. Strongly recommended.
notesstringoptional- Internal notes, visible in your dashboard.Up to 2000 characters.
webhook_urlstringoptional- Receives
payout.sent/payout.failed.https URL.
Safe retries
Always send anorder_id. If a request times out, retry with the same order_id (and a new signature): you get the original payout back instead of a second one.Errors to handle
409 Insufficient balance for amount + fee + network fee422invalid address for the network, unsupported currency, orPayouts in … are not available yet403the owner has no 2FA;401signature problems
BODY='{"currency":"BSC_USDT","address":"0x71C7656EC7ab88b098defB751B7401B5f6d8976F","amount":"1200","order_id":"supplier-0091","notes":"November invoice","webhook_url":"https://shop.example/hooks/jagpay"}'TS=$(date +%s)SIG=$(printf '%s' "$TS.POST./api/v1/payouts.$BODY" | openssl dgst -sha256 -hmac "$JAGPAY_PAYOUT_SECRET" | sed 's/^.* //')curl -X POST https://www.jagpay.io/api/v1/payouts \ -H "Authorization: Bearer $JAGPAY_API_KEY" \ -H "Content-Type: application/json" \ -H "JagPay-Signature: t=$TS,v1=$SIG" \ -d "$BODY"{ "status": true, "data": { "payout_id": "po_2Hk9sLq4Xv7Bn1Cz", "kind": "payout", "payment_id": null, "status": "pending", "currency": "BSC_USDT", "address": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", "amount": "1200", "fee": "6", "gas_fee": "0.12", "total": "1206.12", "tx_hash": null, "order_id": "supplier-0091", "notes": "November invoice", "webhook_url": "https://shop.example/hooks/jagpay", "created_at": "2026-11-26T10:00:00.000Z", "updated_at": "2026-11-26T10:00:00.000Z" }}List payouts#
/api/v1/payoutsAuth: API keyReturns payouts (including refunds and auto-settlements) newest first.
Query parameters
limitintegeroptional- Page size.1–100, default 25.
cursorstringoptional- next_cursor from the previous page.
curl https://www.jagpay.io/api/v1/payouts?limit=25 \ -H "Authorization: Bearer $JAGPAY_API_KEY"{ "status": true, "data": { "payouts": [ { "payout_id": "po_2Hk9sLq4Xv7Bn1Cz", "kind": "payout", "payment_id": null, "status": "sent", "currency": "BSC_USDT", "address": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", "amount": "1200", "fee": "6", "gas_fee": "0.12", "total": "1206.12", "tx_hash": "0x9a8b7c6d5e4f30211fedcba9876543210fedcba9876543210fedcba98765432", "order_id": "supplier-0091", "notes": "November invoice", "webhook_url": "https://shop.example/hooks/jagpay", "created_at": "2026-11-26T10:00:00.000Z", "updated_at": "2026-11-26T10:04:00.000Z" } ], "next_cursor": null }}Retrieve a payout#
/api/v1/payouts/:payout_idAuth: API keyReturns one payout. Poll this if you don't use webhooks; a payout is final once it's sent or failed.
Path parameters
payout_idstringrequired- The po_… ID.
curl https://www.jagpay.io/api/v1/payouts/po_2Hk9sLq4Xv7Bn1Cz \ -H "Authorization: Bearer $JAGPAY_API_KEY"{ "status": true, "data": { "payout_id": "po_2Hk9sLq4Xv7Bn1Cz", "kind": "payout", "payment_id": null, "status": "sent", "currency": "BSC_USDT", "address": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", "amount": "1200", "fee": "6", "gas_fee": "0.12", "total": "1206.12", "tx_hash": "0x9a8b7c6d5e4f30211fedcba9876543210fedcba9876543210fedcba98765432", "order_id": "supplier-0091", "notes": "November invoice", "webhook_url": "https://shop.example/hooks/jagpay", "created_at": "2026-11-26T10:00:00.000Z", "updated_at": "2026-11-26T10:04:00.000Z" }}Resend a webhook#
/api/v1/payouts/:payout_id/webhooks/resendAuth: API keyRe-sends the latest webhook for this payout. Returns 404 if none was ever sent.
curl -X POST https://www.jagpay.io/api/v1/payouts/po_2Hk9sLq4Xv7Bn1Cz/webhooks/resend \ -H "Authorization: Bearer $JAGPAY_API_KEY"{ "status": true, "data": { "delivery_id": "evt_Rk8w2N5pXc1Lm7Ts" }}