Skip to content

Create an order

POST
/v1/orders
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.

Idempotency-Key
required
string
>= 1 characters <= 255 characters

Any unique string per logical request (a UUID); see the introduction.

Media typeapplication/json
object
merchant_order_no
required

Your order number (trimmed); unique per mode.

string
>= 1 characters <= 128 characters
amount
required

Price in currency; positive, at most 8 decimals and 1000000000000.

string
/^\d+(\.\d+)?$/
currency
required

Pricing currency, any case (stored uppercase), e.g. USD; tokens pegged to it pay 1:1.

string
>= 1 characters <= 16 characters
prices

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
key
additional properties

Decimal amount as a string (no floats).

string
/^\d+(\.\d+)?$/
tokens

Accepted token symbols, any case (stored uppercase). Default: stablecoins, plus the token whose symbol is currency.

Array<string>
chains

Accepted chain ids (default: every enabled chain serving the key’s mode).

Array<integer>
customer_email

Receipt recipient; prefills the checkout (stored encrypted, sent in order events).

string format: email
<= 254 characters
split_rule_id

An active split rule (not with splits).

string format: uuid
splits

Splits for this order (not with split_rule_id).

Array<object>
>= 1 items <= 10 items

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
payee_id
string format: uuid
payee_ref

The payee’s reference (alternative to payee_id). The payee must be active.

string
address

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.

string
name

With address: the recipient’s name, shown in the console and statements (default: the address; a later name replaces it).

string
<= 80 characters
kind
required
string
Allowed values: ratio fixed
bps

For ratio: share of what the fixed members leave, in basis points; the ratio members sum to 10000.

integer
<= 10000
fixed_amount

For fixed: an amount in the order’s currency (the plan’s for subscriptions).

string
/^\d+(\.\d+)?$/
return_url

Http(s) URL the checkout sends the payer back to, with signed result parameters.

string format: uri
<= 2048 characters
expires_in

Seconds until the order expires (default from the configuration, order_ttl).

integer
>= 60 <= 604800
locale

Checkout and receipt language; any case (EN is stored as en). Others answer 400 invalid_request with params.allowed.

string
Allowed values: zh-CN en
metadata

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"
],
"customer_email": "[email protected]",
"return_url": "https://shop.example/orders/SO-10023/done",
"metadata": {
"description": "Annual plan × 1"
}
}

Created (or the replayed first answer)

Media typeapplication/json

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
id
required
string format: uuid
livemode
required

false for a test order (created with a test key).

boolean
merchant_order_no
required

Unique per mode.

string
order_hash
required

On-chain order id (bytes32).

string
/^0x[0-9a-f]{64}$/
status
required

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).

string
Allowed values: pending paid_unconfirmed paid expired reverted duplicate_paid refunded partially_refunded
amount
required

Decimal amount as a string (no floats).

string
/^\d+(\.\d+)?$/
currency
required
string
prices
required

The per-token prices given at creation, by listed symbol.

object | null
tokens
required

Accepted symbols as given (uppercase); null: the default.

Array<string> | null
chains
required
Array<integer> | null
split_rule_id
required

The rule the splits were taken from; null for splits given with the order.

string | null format: uuid
payment
required

The payment the order is booked on (the first confirmed one, which a later duplicate never displaces); null until one is seen.

object
chain_id
required
integer
chain
required

The chain a record is on: its id (chain_id as well, unchanged), CAIP-2 identifier and family.

object
id
required
integer
caip2
required

eip155:<id>, tron:0x2b6653dc, solana:<genesis hash prefix>.

string
family
required

Chain family: decides the address and transaction id forms, and the wallets that can pay.

string
Allowed values: evm tron solana
token_id
required

The listed token (see the console’s tokens).

string | null format: uuid
symbol
required

The token’s symbol as listed (e.g. USDC); null if the token was removed since.

string | null
decimals
required

The token’s decimals: amount / 10^decimals is the amount in tokens.

integer | null
amount
required

Token base units.

string | null
/^\d+$/
payer
required
One of:
Any of:

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.

string
/^0x[0-9a-fA-F]{40}$/
tx_hash
required
One of:
Any of:

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).

string
/^0x[0-9a-f]{64}$/
paid_at
required

When the payment was first seen.

string | null format: date-time
confirmed_at
required

When it reached its confirmations.

string | null format: date-time
splits
required
Array<object>
object
position
required

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.

integer
payee_id
required
string format: uuid
payee_ref
required
string
kind
required
string
Allowed values: ratio fixed
bps
required
integer | null
fixed_amount
required

Fixed members: the amount in fixed_currency.

string | null
fixed_currency
required

Currency of fixed_amount (fixed members).

string | null
address
required
One of:
Any of:

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.

string
/^0x[0-9a-fA-F]{40}$/
amount
required

Token base units the member received, once paid.

string | null
/^\d+$/
risk_flag
required

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).

string | null
Allowed values: frozen review hit_after_paid
locale
required
string | null
Allowed values: zh-CN en
return_url
required
string | null
metadata
required

As given at creation (null when none).

expires_at
required
string format: date-time
created_at
required
string format: date-time
checkout_url

API answers only: the hosted checkout for the payer (<public_url>/pay/{id}).

string format: uri
payments

Order events only: every payment seen (removed ones left out), the booked one first.

Array<object>
object
chain_id
required
integer
chain
required

The chain a record is on: its id (chain_id as well, unchanged), CAIP-2 identifier and family.

object
id
required
integer
caip2
required

eip155:<id>, tron:0x2b6653dc, solana:<genesis hash prefix>.

string
family
required

Chain family: decides the address and transaction id forms, and the wallets that can pay.

string
Allowed values: evm tron solana
tx_hash
required
Any of:

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).

string
/^0x[0-9a-f]{64}$/
block_number
required
integer
payer
required
Any of:

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.

string
/^0x[0-9a-fA-F]{40}$/
amount
required

Token amount in base units (integer string; 1 USDC = “1000000”).

string
/^\d+$/
status
required
string
Allowed values: unconfirmed confirmed
frozen

The payer had a block verdict at booking: the payment does not count toward the order and cannot be refunded.

boolean
customer_email

Order events only: the receipt address, when one was given.

string | null
frozen_payment

order.payment_frozen only: the payment just frozen.

object
id
required
string format: uuid
chain_id
required
integer
chain
required

The chain a record is on: its id (chain_id as well, unchanged), CAIP-2 identifier and family.

object
id
required
integer
caip2
required

eip155:<id>, tron:0x2b6653dc, solana:<genesis hash prefix>.

string
family
required

Chain family: decides the address and transaction id forms, and the wallets that can pay.

string
Allowed values: evm tron solana
tx_hash
required
Any of:

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).

string
/^0x[0-9a-f]{64}$/
log_index
required
integer
block_number
required
integer
payer
required
Any of:

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.

string
/^0x[0-9a-fA-F]{40}$/
token
required
Any of:

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.

string
/^0x[0-9a-fA-F]{40}$/
amount
required

Token amount in base units (integer string; 1 USDC = “1000000”).

string
/^\d+$/
frozen_at
required
string format: date-time
refund

order.refunded only: the refund just booked.

object
id
required
string format: uuid
payment_id
required
string | null format: uuid
chain_id
required
integer | null
chain
required
One of:

The chain a record is on: its id (chain_id as well, unchanged), CAIP-2 identifier and family.

object
id
required
integer
caip2
required

eip155:<id>, tron:0x2b6653dc, solana:<genesis hash prefix>.

string
family
required

Chain family: decides the address and transaction id forms, and the wallets that can pay.

string
Allowed values: evm tron solana
token
required
One of:
Any of:

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.

string
/^0x[0-9a-fA-F]{40}$/
amount
required

Token amount in base units (integer string; 1 USDC = “1000000”).

string
/^\d+$/
to
required
One of:
Any of:

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.

string
/^0x[0-9a-fA-F]{40}$/
from
required
One of:
Any of:

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.

string
/^0x[0-9a-fA-F]{40}$/
tx_hash
required
One of:
Any of:

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).

string
/^0x[0-9a-f]{64}$/
reason
required
string | null
method
required

wallet: sent from the console’s wallet connection; offline: a transaction id entered.

string | null
Allowed values: wallet offline
verification
required

transfer (a token or coin transfer), trace (found in the call trace, e.g. sent by a Safe) or manual (confirmed by an operator).

string | null
Allowed values: transfer trace manual
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).

Media typeapplication/json
object
error
required
object
code
required
string
message
required

English, for logs; may change.

string
params

Values for a localized message, e.g. {"field": "expires_in", "min": 60, "max": 604800}. Absent when the error has none.

object
key
additional properties
any
error
required
object
code
Allowed values: invalid_request invalid_splits split_address_not_allowed main_payee_first main_payee_not_registered
Example
{
"error": {
"code": "invalid_request"
}
}

unauthorized: no Authorization: Bearer header, or an unknown or revoked key.

Media typeapplication/json
object
error
required
object
code
required
string
message
required

English, for logs; may change.

string
params

Values for a localized message, e.g. {"field": "expires_in", "min": 60, "max": 604800}. Absent when the error has none.

object
key
additional properties
any
error
required
object
code
Allowed values: unauthorized
Example
{
"error": {
"code": "unauthorized"
}
}

insufficient_scope: the key lacks the operation’s scope.

Media typeapplication/json
object
error
required
object
code
required
string
message
required

English, for logs; may change.

string
params

Values for a localized message, e.g. {"field": "expires_in", "min": 60, "max": 604800}. Absent when the error has none.

object
key
additional properties
any
error
required
object
code
Allowed values: insufficient_scope
Example
{
"error": {
"code": "insufficient_scope"
}
}

duplicate_order: merchant_order_no exists in this mode already. request_in_progress.

Media typeapplication/json
object
error
required
object
code
required
string
message
required

English, for logs; may change.

string
params

Values for a localized message, e.g. {"field": "expires_in", "min": 60, "max": 604800}. Absent when the error has none.

object
key
additional properties
any
error
required
object
code
Allowed values: duplicate_order request_in_progress
Example
{
"error": {
"code": "duplicate_order"
}
}

payload_too_large: the body is over 64 KiB (the bulk import: 4 MiB).

Media typeapplication/json
object
error
required
object
code
required
string
message
required

English, for logs; may change.

string
params

Values for a localized message, e.g. {"field": "expires_in", "min": 60, "max": 604800}. Absent when the error has none.

object
key
additional properties
any
error
required
object
code
Allowed values: payload_too_large
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.

Media typeapplication/json
object
error
required
object
code
required
string
message
required

English, for logs; may change.

string
params

Values for a localized message, e.g. {"field": "expires_in", "min": 60, "max": 604800}. Absent when the error has none.

object
key
additional properties
any
error
required
object
code
Allowed values: split_total_too_small split_currency_mismatch no_payable_route amount_out_of_range payee_blocked idempotency_key_reused
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.

Media typeapplication/json
object
error
required
object
code
required
string
message
required

English, for logs; may change.

string
params

Values for a localized message, e.g. {"field": "expires_in", "min": 60, "max": 604800}. Absent when the error has none.

object
key
additional properties
any
error
required
object
code
Allowed values: chain_unavailable
Example
{
"error": {
"code": "chain_unavailable"
}
}