Invoices

Create an Invoice

Create a payment invoice for one of the payment methods available to your merchant account and environment.

Endpoint

Method
POST
URL
https://crptox.com/api/v1/invoices

Environment

The environment is determined automatically by the API key used to authenticate the request.

Sandbox crx_test_...

Use a Sandbox API key to create invoices on supported test networks without using real funds.

Live crx_live_...

Use a Live API key to create production invoices on supported main networks.

Do not send an environment or mode field in the request body. A crx_test_ key always operates in Sandbox, while a crx_live_ key always operates in Live.

Choose a Payment Method

Before creating an invoice, you can retrieve the payment methods currently available for your merchant account and API key environment.

Example BASH
curl https://crptox.com/api/v1/payment-methods \
  -H "Authorization: Bearer YOUR_API_SECRET" \
  -H "Accept: application/json"

Using the Payment Methods endpoint is recommended instead of hard-coding supported networks or assets in your integration.

Request Body

network
string Required

The blockchain network on which the invoice should receive payment.

tron ethereum bsc polygon

The selected network must be available for your merchant account in the current API key environment.

asset
string Required

The token or asset accepted for this invoice.

usdt usdc

The asset must be enabled on the selected network and available to your merchant account.

amount
string Required

The amount that must be paid for the invoice.

Send monetary amounts as strings to preserve decimal precision.

description
string Optional

An optional description for the invoice, such as an order number or customer reference.

expires_in
integer Optional

The number of seconds before the invoice expires.

After the invoice expires, it can no longer be used as an active payment request.

Supported Network & Asset Combinations

The network and asset fields must form a supported payment combination. The following combinations are currently available.

Network Assets
tron
usdt
ethereum
usdt usdc
bsc
usdt
polygon
usdt usdc
USDT is supported on all four networks. USDC is currently supported only on Ethereum and Polygon. Use the Payment Methods endpoint to retrieve the payment options currently available to your account.

Idempotency

Use the Idempotency-Key header when creating invoices to safely retry requests without accidentally creating duplicate invoices.

HTTP Header TEXT
Idempotency-Key: unique-request-key
Use a unique idempotency key for each logical invoice creation request. Repeating the same request with the same key returns the previously created result.

Example Request

Request BASH
curl -X POST https://crptox.com/api/v1/invoices \
  -H "Authorization: Bearer YOUR_API_SECRET" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Idempotency-Key: order-1001" \
  -d '{
    "network": "bsc",
    "asset": "usdt",
    "amount": "10.000000",
    "description": "Order #1001",
    "expires_in": 1800
  }'

Example Response

Response JSON
{
  "invoice": {
    "uuid": "9f7c2c4a-0000-0000-0000-000000000000",
    "number": "INV-202610050001",
    "status": "pending",
    "amount": "10.000000",
    "asset": "usdt",
    "network": "bsc",
    "expires_at": "2026-10-05T20:30:00+00:00"
  },
  "payment": {
    "uuid": "1c4a0000-0000-0000-0000-000000000000",
    "address": "0xf6222331fe8cd2505561bce3dc4c5837d362b458",
    "amount": "10.000000",
    "asset": "usdt",
    "network": "bsc",
    "status": "pending",
    "expires_at": "2026-10-05T20:30:00+00:00"
  }
}

Testing in Sandbox

Sandbox allows you to test the complete payment flow against supported blockchain test networks before going live.

  1. 1. Create a Sandbox API key from the Developer section of the merchant dashboard.
  2. 2. Add an active wallet under Sandbox Wallets for the test network you want to use.
  3. 3. Create an invoice using your crx_test_ API key and one of the available Sandbox payment methods.
  4. 4. Send the required test token amount from a test wallet to the payment address returned by the invoice.
  5. 5. Retrieve the invoice again and observe the payment progress until the invoice reaches its final payment status.