فاکتورها

ایجاد فاکتور

یک فاکتور پرداخت جدید برای مشتری خود ایجاد کنید.

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.

نمونه 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.

بدنه درخواست

network
string الزامی

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 الزامی

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 الزامی

مبلغ پرداخت.

مبلغ را با حداکثر ۶ رقم اعشار ارسال کنید.

description
string اختیاری

توضیحات اختیاری برای فاکتور.

expires_in
integer اختیاری

مدت اعتبار اختیاری فاکتور بر حسب ثانیه.

محدوده مجاز: ۶۰ تا ۸۶۴۰۰ ثانیه.

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.

نمونه درخواست

درخواست 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
  }'

نمونه پاسخ

پاسخ 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.