ایجاد فاکتور
یک فاکتور پرداخت جدید برای مشتری خود ایجاد کنید.
Endpoint
Environment
The environment is determined automatically by the API key used to authenticate the request.
crx_test_...
Use a Sandbox API key to create invoices on supported test networks without using real funds.
crx_live_...
Use a Live API key to create production invoices on supported main networks.
Choose a Payment Method
Before creating an invoice, you can retrieve the payment methods currently available for your merchant account and API key environment.
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.
بدنه درخواست
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.
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.
مبلغ پرداخت.
مبلغ را با حداکثر ۶ رقم اعشار ارسال کنید.
توضیحات اختیاری برای فاکتور.
مدت اعتبار اختیاری فاکتور بر حسب ثانیه.
محدوده مجاز: ۶۰ تا ۸۶۴۰۰ ثانیه.
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
|
Idempotency
Use the Idempotency-Key header when creating invoices to safely retry requests without accidentally creating duplicate invoices.
Idempotency-Key: unique-request-key
نمونه درخواست
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
}'
نمونه پاسخ
{
"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. Create a Sandbox API key from the Developer section of the merchant dashboard.
- 2. Add an active wallet under Sandbox Wallets for the test network you want to use.
- 3. Create an invoice using your crx_test_ API key and one of the available Sandbox payment methods.
- 4. Send the required test token amount from a test wallet to the payment address returned by the invoice.
- 5. Retrieve the invoice again and observe the payment progress until the invoice reaches its final payment status.