Create an order
const url = 'https://pay.example.com/v1/orders';const options = { method: 'POST', headers: { 'Idempotency-Key': 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"merchant_order_no":"SO-10023","amount":"100.00","currency":"USD","tokens":["USDC","USDT"],"customer_email":"[email protected]","return_url":"https://shop.example/orders/SO-10023/done","metadata":{"description":"Annual plan × 1"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://pay.example.com/v1/orders \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: example' \ --data '{ "merchant_order_no": "SO-10023", "amount": "100.00", "currency": "USD", "tokens": [ "USDC", "USDT" ], "customer_email": "[email protected]", "return_url": "https://shop.example/orders/SO-10023/done", "metadata": { "description": "Annual plan × 1" } }'Creates an order priced in currency and payable with the tokens and chains in its options; the answer
carries the checkout_url to send the payer to. Splits come from splits, else split_rule_id, else the
default split rule (with neither and no default rule: 400 invalid_request). Fixed split amounts are in
their currency (the rule member’s, or currency for splits given here) and are only paid in tokens
pegged to that currency: other tokens are not offered. An order nobody could pay is refused (422).
Idempotent (see the introduction). Requires orders:write.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Any unique string per logical request (a UUID); see the introduction.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Your order number (trimmed); unique per mode.
Price in currency; positive, at most 8 decimals and 1000000000000.
Pricing currency, any case (stored uppercase), e.g. USD; tokens pegged to it pay 1:1.
Per-token prices (the amount of that token to pay, at most 18 decimals) by token symbol, overriding the
conversion of amount; tokens not named pay amount as usual (pegged tokens only). Symbols in any case
(USDE prices USDe; stored in the listing’s spelling). A symbol no listed token has is rejected
(400 invalid_request, params.field prices.<key>, params.token).
object
Decimal amount as a string (no floats).
Accepted token symbols, any case (stored uppercase). Default: stablecoins, plus the token whose symbol is currency.
Accepted chain ids (default: every enabled chain serving the key’s mode).
Receipt recipient; prefills the checkout (stored encrypted, sent in order events).
An active split rule (not with splits).
Splits for this order (not with split_rule_id).
A split member: {payee_ref | payee_id, kind: ratio, bps} or {payee_ref | payee_id, kind: fixed, fixed_amount}, naming a payee registered in the console (the split whitelist).
With the split whitelist switched off in the console, a member may name its recipient by address (with an
optional name) instead of payee_id / payee_ref. The address is checked as at registration (checksum,
not zero, not a system address: 400 invalid_request, params.field splits[i].address) and screened on
every enabled chain of its family that could pay (risk lists, sanctions, token blocklists, account type);
a hit refuses the request (422 payee_blocked). The first member of a list with an address is the main
payee (payTo[0], which takes the remainder and bears refunds) and must be a ratio member
(400 main_payee_first) naming a registered payee (400 main_payee_not_registered). The address appears in
splits[] of the order or subscription as a payee whose payee_ref is <family>:<address> (e.g.
evm:0xab…). With the whitelist on, address answers 400 split_address_not_allowed.
object
The payee’s reference (alternative to payee_id). The payee must be active.
The recipient’s address (the split whitelist off), not with payee_id / payee_ref: EVM 0x + 40 hex
digits (EIP-55 checked when mixed case), TRON T… (Base58Check) or a Solana Base58 public key.
With address: the recipient’s name, shown in the console and statements (default: the address; a later name replaces it).
For ratio: share of what the fixed members leave, in basis points; the ratio members sum to 10000.
For fixed: an amount in the order’s currency (the plan’s for subscriptions).
Http(s) URL the checkout sends the payer back to, with signed result parameters.
Seconds until the order expires (default from the configuration, order_ttl).
Checkout and receipt language; any case (EN is stored as en). Others answer 400 invalid_request with params.allowed.
Any JSON value (an object is recommended), returned as given in the order and its events.
Example
{ "merchant_order_no": "SO-10023", "amount": "100.00", "currency": "USD", "tokens": [ "USDC", "USDT" ], "return_url": "https://shop.example/orders/SO-10023/done", "metadata": { "description": "Annual plan × 1" }}Responses
Section titled “Responses”Created (or the replayed first answer)
An order. GET /v1/orders… and POST /v1/orders add checkout_url; order events (data of order.*) add
payments and customer_email instead, and order.refunded the refund.
object
false for a test order (created with a test key).
Unique per mode.
On-chain order id (bytes32).
pending (awaiting payment) → paid_unconfirmed (a payment seen, not yet at its confirmations) →
paid (order.paid). expired: unpaid at expires_at (order.expired; a late payment still books it).
duplicate_paid: a second confirmed payment (order.duplicate_paid; a refund is opened for it).
reverted: a confirmed payment left the chain (order.payment_reverted). partially_refunded /
refunded: the booked payment partly, or every payment fully, refunded (order.refunded).
Decimal amount as a string (no floats).
The per-token prices given at creation, by listed symbol.
Accepted symbols as given (uppercase); null: the default.
The rule the splits were taken from; null for splits given with the order.
The payment the order is booked on (the first confirmed one, which a later duplicate never displaces); null until one is seen.
object
The chain a record is on: its id (chain_id as well, unchanged), CAIP-2 identifier and family.
object
eip155:<id>, tron:0x2b6653dc, solana:<genesis hash prefix>.
Chain family: decides the address and transaction id forms, and the wallets that can pay.
The listed token (see the console’s tokens).
The token’s symbol as listed (e.g. USDC); null if the token was removed since.
The token’s decimals: amount / 10^decimals is the amount in tokens.
Token base units.
An account address in its chain family’s own form: EVM 0x + 40 hex digits (orders, subscriptions and
tickets give it in lowercase hex; the risk list EIP-55 checksummed), TRON Base58Check (T…, 34
characters), Solana Base58 (32 bytes, 32-44 characters). Requests accept any of the three.
An account address in its chain family’s own form: EVM 0x + 40 hex digits (orders, subscriptions and
tickets give it in lowercase hex; the risk list EIP-55 checksummed), TRON Base58Check (T…, 34
characters), Solana Base58 (32 bytes, 32-44 characters). Requests accept any of the three.
An account address in its chain family’s own form: EVM 0x + 40 hex digits (orders, subscriptions and
tickets give it in lowercase hex; the risk list EIP-55 checksummed), TRON Base58Check (T…, 34
characters), Solana Base58 (32 bytes, 32-44 characters). Requests accept any of the three.
A transaction id in its chain family’s own form: EVM 0x + 64 hex digits (lowercase), TRON 64 hex digits
without 0x, Solana a Base58 signature (64 bytes, 87-88 characters).
A transaction id in its chain family’s own form: EVM 0x + 64 hex digits (lowercase), TRON 64 hex digits
without 0x, Solana a Base58 signature (64 bytes, 87-88 characters).
A transaction id in its chain family’s own form: EVM 0x + 64 hex digits (lowercase), TRON 64 hex digits
without 0x, Solana a Base58 signature (64 bytes, 87-88 characters).
When the payment was first seen.
When it reached its confirmations.
object
The member’s place in the rule or splits. On chain the main payee (first ratio member, who takes the rounding remainder) is paid first.
Fixed members: the amount in fixed_currency.
Currency of fixed_amount (fixed members).
An account address in its chain family’s own form: EVM 0x + 40 hex digits (orders, subscriptions and
tickets give it in lowercase hex; the risk list EIP-55 checksummed), TRON Base58Check (T…, 34
characters), Solana Base58 (32 bytes, 32-44 characters). Requests accept any of the three.
An account address in its chain family’s own form: EVM 0x + 40 hex digits (orders, subscriptions and
tickets give it in lowercase hex; the risk list EIP-55 checksummed), TRON Base58Check (T…, 34
characters), Solana Base58 (32 bytes, 32-44 characters). Requests accept any of the three.
An account address in its chain family’s own form: EVM 0x + 40 hex digits (orders, subscriptions and
tickets give it in lowercase hex; the risk list EIP-55 checksummed), TRON Base58Check (T…, 34
characters), Solana Base58 (32 bytes, 32-44 characters). Requests accept any of the three.
Token base units the member received, once paid.
Set when a payer was listed at booking. frozen: a payment came from a blocked address; it is frozen and does not count toward the order (see order.payment_frozen). review: a review-level entry or over the payer’s daily limit; hold fulfilment for review. hit_after_paid: orders booked before frozen payments existed (they stay paid).
As given at creation (null when none).
API answers only: the hosted checkout for the payer (<public_url>/pay/{id}).
Order events only: every payment seen (removed ones left out), the booked one first.
object
The chain a record is on: its id (chain_id as well, unchanged), CAIP-2 identifier and family.
object
eip155:<id>, tron:0x2b6653dc, solana:<genesis hash prefix>.
Chain family: decides the address and transaction id forms, and the wallets that can pay.
A transaction id in its chain family’s own form: EVM 0x + 64 hex digits (lowercase), TRON 64 hex digits
without 0x, Solana a Base58 signature (64 bytes, 87-88 characters).
A transaction id in its chain family’s own form: EVM 0x + 64 hex digits (lowercase), TRON 64 hex digits
without 0x, Solana a Base58 signature (64 bytes, 87-88 characters).
A transaction id in its chain family’s own form: EVM 0x + 64 hex digits (lowercase), TRON 64 hex digits
without 0x, Solana a Base58 signature (64 bytes, 87-88 characters).
An account address in its chain family’s own form: EVM 0x + 40 hex digits (orders, subscriptions and
tickets give it in lowercase hex; the risk list EIP-55 checksummed), TRON Base58Check (T…, 34
characters), Solana Base58 (32 bytes, 32-44 characters). Requests accept any of the three.
An account address in its chain family’s own form: EVM 0x + 40 hex digits (orders, subscriptions and
tickets give it in lowercase hex; the risk list EIP-55 checksummed), TRON Base58Check (T…, 34
characters), Solana Base58 (32 bytes, 32-44 characters). Requests accept any of the three.
An account address in its chain family’s own form: EVM 0x + 40 hex digits (orders, subscriptions and
tickets give it in lowercase hex; the risk list EIP-55 checksummed), TRON Base58Check (T…, 34
characters), Solana Base58 (32 bytes, 32-44 characters). Requests accept any of the three.
Token amount in base units (integer string; 1 USDC = “1000000”).
The payer had a block verdict at booking: the payment does not count toward the order and cannot be refunded.
Order events only: the receipt address, when one was given.
order.payment_frozen only: the payment just frozen.
object
The chain a record is on: its id (chain_id as well, unchanged), CAIP-2 identifier and family.
object
eip155:<id>, tron:0x2b6653dc, solana:<genesis hash prefix>.
Chain family: decides the address and transaction id forms, and the wallets that can pay.
A transaction id in its chain family’s own form: EVM 0x + 64 hex digits (lowercase), TRON 64 hex digits
without 0x, Solana a Base58 signature (64 bytes, 87-88 characters).
A transaction id in its chain family’s own form: EVM 0x + 64 hex digits (lowercase), TRON 64 hex digits
without 0x, Solana a Base58 signature (64 bytes, 87-88 characters).
A transaction id in its chain family’s own form: EVM 0x + 64 hex digits (lowercase), TRON 64 hex digits
without 0x, Solana a Base58 signature (64 bytes, 87-88 characters).
An account address in its chain family’s own form: EVM 0x + 40 hex digits (orders, subscriptions and
tickets give it in lowercase hex; the risk list EIP-55 checksummed), TRON Base58Check (T…, 34
characters), Solana Base58 (32 bytes, 32-44 characters). Requests accept any of the three.
An account address in its chain family’s own form: EVM 0x + 40 hex digits (orders, subscriptions and
tickets give it in lowercase hex; the risk list EIP-55 checksummed), TRON Base58Check (T…, 34
characters), Solana Base58 (32 bytes, 32-44 characters). Requests accept any of the three.
An account address in its chain family’s own form: EVM 0x + 40 hex digits (orders, subscriptions and
tickets give it in lowercase hex; the risk list EIP-55 checksummed), TRON Base58Check (T…, 34
characters), Solana Base58 (32 bytes, 32-44 characters). Requests accept any of the three.
An account address in its chain family’s own form: EVM 0x + 40 hex digits (orders, subscriptions and
tickets give it in lowercase hex; the risk list EIP-55 checksummed), TRON Base58Check (T…, 34
characters), Solana Base58 (32 bytes, 32-44 characters). Requests accept any of the three.
An account address in its chain family’s own form: EVM 0x + 40 hex digits (orders, subscriptions and
tickets give it in lowercase hex; the risk list EIP-55 checksummed), TRON Base58Check (T…, 34
characters), Solana Base58 (32 bytes, 32-44 characters). Requests accept any of the three.
An account address in its chain family’s own form: EVM 0x + 40 hex digits (orders, subscriptions and
tickets give it in lowercase hex; the risk list EIP-55 checksummed), TRON Base58Check (T…, 34
characters), Solana Base58 (32 bytes, 32-44 characters). Requests accept any of the three.
Token amount in base units (integer string; 1 USDC = “1000000”).
order.refunded only: the refund just booked.
object
The chain a record is on: its id (chain_id as well, unchanged), CAIP-2 identifier and family.
object
eip155:<id>, tron:0x2b6653dc, solana:<genesis hash prefix>.
Chain family: decides the address and transaction id forms, and the wallets that can pay.
An account address in its chain family’s own form: EVM 0x + 40 hex digits (orders, subscriptions and
tickets give it in lowercase hex; the risk list EIP-55 checksummed), TRON Base58Check (T…, 34
characters), Solana Base58 (32 bytes, 32-44 characters). Requests accept any of the three.
An account address in its chain family’s own form: EVM 0x + 40 hex digits (orders, subscriptions and
tickets give it in lowercase hex; the risk list EIP-55 checksummed), TRON Base58Check (T…, 34
characters), Solana Base58 (32 bytes, 32-44 characters). Requests accept any of the three.
An account address in its chain family’s own form: EVM 0x + 40 hex digits (orders, subscriptions and
tickets give it in lowercase hex; the risk list EIP-55 checksummed), TRON Base58Check (T…, 34
characters), Solana Base58 (32 bytes, 32-44 characters). Requests accept any of the three.
Token amount in base units (integer string; 1 USDC = “1000000”).
An account address in its chain family’s own form: EVM 0x + 40 hex digits (orders, subscriptions and
tickets give it in lowercase hex; the risk list EIP-55 checksummed), TRON Base58Check (T…, 34
characters), Solana Base58 (32 bytes, 32-44 characters). Requests accept any of the three.
An account address in its chain family’s own form: EVM 0x + 40 hex digits (orders, subscriptions and
tickets give it in lowercase hex; the risk list EIP-55 checksummed), TRON Base58Check (T…, 34
characters), Solana Base58 (32 bytes, 32-44 characters). Requests accept any of the three.
An account address in its chain family’s own form: EVM 0x + 40 hex digits (orders, subscriptions and
tickets give it in lowercase hex; the risk list EIP-55 checksummed), TRON Base58Check (T…, 34
characters), Solana Base58 (32 bytes, 32-44 characters). Requests accept any of the three.
An account address in its chain family’s own form: EVM 0x + 40 hex digits (orders, subscriptions and
tickets give it in lowercase hex; the risk list EIP-55 checksummed), TRON Base58Check (T…, 34
characters), Solana Base58 (32 bytes, 32-44 characters). Requests accept any of the three.
An account address in its chain family’s own form: EVM 0x + 40 hex digits (orders, subscriptions and
tickets give it in lowercase hex; the risk list EIP-55 checksummed), TRON Base58Check (T…, 34
characters), Solana Base58 (32 bytes, 32-44 characters). Requests accept any of the three.
An account address in its chain family’s own form: EVM 0x + 40 hex digits (orders, subscriptions and
tickets give it in lowercase hex; the risk list EIP-55 checksummed), TRON Base58Check (T…, 34
characters), Solana Base58 (32 bytes, 32-44 characters). Requests accept any of the three.
A transaction id in its chain family’s own form: EVM 0x + 64 hex digits (lowercase), TRON 64 hex digits
without 0x, Solana a Base58 signature (64 bytes, 87-88 characters).
A transaction id in its chain family’s own form: EVM 0x + 64 hex digits (lowercase), TRON 64 hex digits
without 0x, Solana a Base58 signature (64 bytes, 87-88 characters).
A transaction id in its chain family’s own form: EVM 0x + 64 hex digits (lowercase), TRON 64 hex digits
without 0x, Solana a Base58 signature (64 bytes, 87-88 characters).
wallet: sent from the console’s wallet connection; offline: a transaction id entered.
transfer (a token or coin transfer), trace (found in the call trace, e.g. sent by a Safe) or manual (confirmed by an operator).
Example
{ "status": "pending", "payment": { "chain": { "caip2": "eip155:8453", "family": "evm" } }, "splits": [ { "kind": "ratio" } ], "risk_flag": "frozen", "locale": "zh-CN", "payments": [ { "chain": { "caip2": "eip155:8453", "family": "evm" }, "status": "unconfirmed" } ], "frozen_payment": { "chain": { "caip2": "eip155:8453", "family": "evm" } }, "refund": { "chain": { "caip2": "eip155:8453", "family": "evm" }, "method": "wallet", "verification": "transfer" }}invalid_request: the body is not JSON, has an unknown field or a wrong type, or a field is invalid —
params.field names it (merchant_order_no 1-128 characters; amount positive, at most 8 decimals
and max 1000000000000; currency 1-16 characters; prices.<symbol> not a decimal, not positive or
token not listed; expires_in min 60 – max 604800; return_url http(s), max 2048 characters;
customer_email; locale with allowed). Without params: missing Idempotency-Key, both
split_rule_id and splits, an unknown or inactive split payee, a split that is neither {kind: ratio, bps} nor {kind: fixed, fixed_amount}, an unknown split_rule_id, no default split rule.
invalid_splits: the members do not form a rule (1-10 members, at least one ratio member, bps
summing to 10000, no payee or address twice, no member receiving zero). Split addresses (see
SplitInput): split_address_not_allowed (the split whitelist is on), main_payee_first,
main_payee_not_registered, and invalid_request with params.field splits[i].address,
splits[i].name or splits[i] (both a payee and an address).
object
object
English, for logs; may change.
Values for a localized message, e.g. {"field": "expires_in", "min": 60, "max": 604800}. Absent when the error has none.
object
object
Example
{ "error": { "code": "invalid_request" }}unauthorized: no Authorization: Bearer header, or an unknown or revoked key.
object
object
English, for logs; may change.
Values for a localized message, e.g. {"field": "expires_in", "min": 60, "max": 604800}. Absent when the error has none.
object
object
Example
{ "error": { "code": "unauthorized" }}insufficient_scope: the key lacks the operation’s scope.
object
object
English, for logs; may change.
Values for a localized message, e.g. {"field": "expires_in", "min": 60, "max": 604800}. Absent when the error has none.
object
object
Example
{ "error": { "code": "insufficient_scope" }}duplicate_order: merchant_order_no exists in this mode already. request_in_progress.
object
object
English, for logs; may change.
Values for a localized message, e.g. {"field": "expires_in", "min": 60, "max": 604800}. Absent when the error has none.
object
object
Example
{ "error": { "code": "duplicate_order" }}payload_too_large: the body is over 64 KiB (the bulk import: 4 MiB).
object
object
English, for logs; may change.
Values for a localized message, e.g. {"field": "expires_in", "min": 60, "max": 604800}. Absent when the error has none.
object
object
Example
{ "error": { "code": "payload_too_large" }}split_total_too_small: the amount does not cover the fixed splits (params: amount, currency,
fixed[{payee_id, amount, currency}]). split_currency_mismatch: no accepted token is pegged to a fixed
split’s currency (params: currency, fixed[]). no_payable_route: no enabled network and token can
settle the order otherwise (token filter, prices, payee addresses screened on the chain); when the payees’
addresses are the reason, params.reason is payee_address, with payees[{payee_id, name, problem}]
(problem: missing no address for the network’s family, unscreened not screened there yet,
blocked refused by screening) and the candidate chains[{chain_id, name}].
amount_out_of_range: a live order priced in the limits’ currency outside the configured order limits
(params: limit min | max, bound, currency, amount). payee_blocked: a split address failed
screening on a chain that could pay (params: field, address, chain_id, hits);
no_payable_route also when no enabled network of a split address’s family can pay (params: field,
family). idempotency_key_reused.
object
object
English, for logs; may change.
Values for a localized message, e.g. {"field": "expires_in", "min": 60, "max": 604800}. Absent when the error has none.
object
object
Example
{ "error": { "code": "split_total_too_small" }}chain_unavailable: none of the networks that could pay a split address could be reached to screen it.
Nothing is recorded (not replayed for the Idempotency-Key): retry later.
object
object
English, for logs; may change.
Values for a localized message, e.g. {"field": "expires_in", "min": 60, "max": 604800}. Absent when the error has none.
object
object
Example
{ "error": { "code": "chain_unavailable" }}