Skip to main content
POST
/
checkouts
Create a checkout
curl --request POST \
  --url https://api.billing.io/v1/checkouts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "amount_usd": 49.99,
  "expires_in_seconds": 1800,
  "metadata": {
    "order_id": "ord_12345",
    "customer_email": "user@example.com"
  }
}
'
{
  "checkout_id": "co_1a2b3c4d5e",
  "deposit_address": "<string>",
  "amount_usd": 123,
  "amount_atomic": "49990000",
  "tx_hash": "<string>",
  "confirmations": 123,
  "required_confirmations": 19,
  "expires_at": "2023-11-07T05:31:56Z",
  "detected_at": "2023-11-07T05:31:56Z",
  "confirmed_at": "2023-11-07T05:31:56Z",
  "created_at": "2023-11-07T05:31:56Z",
  "metadata": {}
}
Create a new checkout session. Returns a unique deposit address where the customer sends crypto.
curl -X POST https://api.billing.io/v1/checkouts \
  -H "Authorization: Bearer $BILLING_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "amount_usd": 49.99,
    "chain": "tron",
    "token": "USDT",
    "metadata": {
      "order_id": "ord_12345"
    }
  }'
Response
{
  "checkout_id": "co_a1b2c3d4e5f6a7b8c9d0e1f2",
  "deposit_address": "TXqH4jB8nPz1rL9kVw2mYd6sQ5cFgA3hJe",
  "chain": "tron",
  "token": "USDT",
  "amount_usd": 49.99,
  "amount_atomic": "49990000",
  "status": "pending",
  "confirmations": 0,
  "required_confirmations": 19,
  "expires_at": "2025-01-15T12:30:00Z",
  "created_at": "2025-01-15T12:00:00Z"
}

Authorizations

Authorization
string
header
required

Use your secret API key as a Bearer token. Keys are prefixed: sk_live_ (production) or sk_test_ (sandbox).

Headers

Idempotency-Key
string<uuid>

Client-generated UUID. If a request with the same key was already processed, the original response is returned. Keys expire after 24h.

Body

application/json
amount_usd
number<double>
required

Amount in USD

Required range: x >= 0.01
Example:

49.99

chain
enum<string>
required

Blockchain network

Available options:
tron,
arbitrum
token
enum<string>
required

Stablecoin token

Available options:
USDT,
USDC
expires_in_seconds
integer
default:1800

Checkout TTL in seconds (5 min to 24 hr)

Required range: 300 <= x <= 86400
metadata
object

Arbitrary key-value pairs (max 20 keys, max 500 chars per value)

Example:
{
"order_id": "ord_12345",
"customer_email": "user@example.com"
}

Response

Checkout created

checkout_id
string

Unique identifier (prefixed co_)

Example:

"co_1a2b3c4d5e"

deposit_address
string

Blockchain address to send funds to

chain
enum<string>

Blockchain network

Available options:
tron,
arbitrum
token
enum<string>

Stablecoin token

Available options:
USDT,
USDC
amount_usd
number<double>

Original USD amount

amount_atomic
string

Token amount in smallest unit (string to avoid precision loss)

Example:

"49990000"

status
enum<string>
  • pending — Waiting for payment
  • detected — Transaction seen on-chain, unconfirmed
  • confirming — Confirmations in progress
  • confirmed — Payment fully confirmed (terminal)
  • expired — Checkout TTL exceeded without payment (terminal)
  • failed — Unrecoverable error (terminal)
Available options:
pending,
detected,
confirming,
confirmed,
expired,
failed
tx_hash
string | null

On-chain transaction hash (null until detected)

confirmations
integer

Current confirmation count

required_confirmations
integer

Confirmations needed for this chain

Example:

19

expires_at
string<date-time>
detected_at
string<date-time> | null
confirmed_at
string<date-time> | null
created_at
string<date-time>
metadata
object