Create your first sandbox invoice with the CrptoX API

Configure a TEST wallet and key, list payment methods, create an invoice and verify its payment status. Follow the CrptoX sandbox API quickstart.

1. Create merchant account

Verify your email, add an active TRON Shasta wallet in sandbox mode and create a TEST API key. The key selects the environment; there is no separate sandbox API hostname.

2. Check available payment methods

Bash / cURL BASH
read -r -s -p 'TEST API key: ' CRPTOX_TEST_KEY
printf '\n'

curl --fail-with-body --silent --show-error \
  -H "Authorization: Bearer $CRPTOX_TEST_KEY" \
  -H 'Accept: application/json' \
  'https://crptox.com/api/v1/payment-methods'

Empty methods or merchant_wallet_unavailable: add an active wallet in the same environment and network as the invoice. A LIVE wallet does not serve a TEST key.

3. Create an invoice

POST /api/v1/invoices BASH
curl --fail-with-body --silent --show-error \
  -X POST 'https://crptox.com/api/v1/invoices' \
  -H "Authorization: Bearer $CRPTOX_TEST_KEY" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{"amount":"1","network":"tron","asset":"USDT","expires_in":1800}'
Create an Invoice

4. Pay the invoice and check its status

Use data.invoice.uuid from the response to open the payment page and retrieve the invoice. Send the exact data.payment.amount using test tokens on Shasta, then wait for on-chain confirmation. Test tokens have no real monetary value.

GET /api/v1/invoices/{uuid} BASH
read -r -p 'data.invoice.uuid: ' CRPTOX_INVOICE_UUID
printf '%s\n' "https://crptox.com/pay/$CRPTOX_INVOICE_UUID"

curl --fail-with-body --silent --show-error \
  -H "Authorization: Bearer $CRPTOX_TEST_KEY" \
  -H 'Accept: application/json' \
  "https://crptox.com/api/v1/invoices/$CRPTOX_INVOICE_UUID"

Fulfill the order only when data.invoice.status is paid. A detected or confirming payment has not reached final confirmation.

Keep the API key on your server. Verify webhook signatures and fetch the invoice with the same environment key before fulfilling an order. A browser return or payment screenshot is not proof of payment.

If the first request fails

  • 401: check the Bearer key, its expiry and whether it is active. Never paste it into public support messages.
  • Empty methods or merchant_wallet_unavailable: add an active wallet in the same environment and network as the invoice. A LIVE wallet does not serve a TEST key.
  • 422: inspect error.details and supported network/token combinations. For quota errors, check the shared TEST/LIVE subscription allowance. For 429, slow down and retry after the indicated delay.
Errors