POST /v1/checkout/sessions
POST
/v1/checkout/sessions
Creates a new payment session. Returns a url for redirecting the customer
to the hosted checkout page.
Supports Idempotency-Key header for safe retries.
If the same key is used with the same request body, returns cached response.
If the same key is used with different request body, returns 409 Conflict.
授权
bearer_auth
API key authentication. Use sk_test_... for sandbox or sk_live_... for production.
类型
HTTP (bearer)
参数
请求头参数
Idempotency-Key
Optional unique key for idempotent requests (recommended: UUID v4)
类型
[
"string",
"null"
]
X-Sub-Merchant-Code
Sub-merchant code for PSP context switch. When provided, the session is created under the specified sub-merchant.
类型
[
"string",
"null"
]
请求体
application/json
JSON "cancel_url": "https://example.com/cancel", "client_reference_id": "order_20260211_001", "currency": "USDT", "network": "string", "pricing_amount": "10.50", "pricing_currency": "USD", "success_url": "https://example.com/success"
{
}
响应
Session created
application/json
JSON "amount": "10.5", "amount_received": "10.5", "cancel_url": "https://example.com/cancel", "chain_family": "string", "client_reference_id": "order_20260211_001", "created_at": "2026-02-11T03:56:00Z", "currency": "USDT", "currency_contract": "string", "detection_rpc_url": "string", "expires_at": "2026-02-11T04:26:00Z", "fee_amount": "1", "id": "cs_abc123def456", "livemode": false, "merchant_logo_url": "string", "merchant_name": "Acme Store", "net_amount": "9.5", "network": "TRON", "pay_address": "TQFEyGNzHZAJmebJUvsoZvJghHm2yNhXAD", "pricing": { "amount": "10.50", "currency": "USD", "exchange_rate": "1.00000000" }, "status": "string", "sub_merchant_code": "shop_tokyo", "success_url": "https://example.com/success", "transactions": [ { "amount": "10.5", "created_at": "2026-02-11T03:56:00Z", "network": "TRON", "status": "Confirmed", "tx_hash": "8d490254caa24a5ff0b6522976a52d90d0e0fc4187dd78659ea2b78236fc8afc" } ], "url": "https://checkout.ironixpay.com/cs_abc123def456"
{
}