Payments2 min read

Accept USDT & USDC stablecoin payments via API

Build a non-custodial USDT/USDC checkout in a few endpoints: unique deposit address, polling confirmation, and built-in fiat reconciliation.

cryptoapi team
Payments · USDT
On this page

Stablecoins are the practical on-ramp for crypto payments: USDT and USDC hold a predictable dollar value, so your customers pay an exact invoice amount and you reconcile against fiat without guessing on price swings. With CryptoAPI you can stand up a non-custodial stablecoin checkout for e-commerce, SaaS billing, donations, or invoicing without running a single node. This guide walks the full flow: generate a deposit address, confirm payment by polling, reconcile against USD, and pay out or refund.

One thing up front: there are no webhooks. Confirmation is done by polling GET /api/blockchain/transactions on an interval. Indexed history covers up to 30 days of live indexed data, so reconcile and persist anything you need to keep before it ages out. Every /api/* call needs your API key in a key header.

1. Create a unique deposit address per order

Generate a receive address in your own signing wallet and record its invoice, network and token contract. Keep the signing key in the wallet. Give the customer the public address, selected network and amount.

Verify that you accept the exact token contract on that network. Use GET /api/info/token-metadata to read its configured decimals when available. Compare amounts with decimal arithmetic.

2. Confirm the payment by polling

Poll the indexed history filtered to your deposit address until a matching incoming transfer appears. network is required; add filters to narrow the result.

bash
curl "https://api.cryptoapi.so/api/blockchain/transactions?network=tron&toAddress=TXYZ...deposit&tokenSymbol=USDT&sortBy=timestamp&sortOrder=desc&limit=10" \
  -H "key: YOUR_API_KEY"

Match toAddress, tokenSymbol, and valueDecimal against the invoice. Prefer to check live balance instead? Call POST /api/wallet/balance with a tokens array — each entry returns balance, decimals, and a ready-made usdValue, so you reconcile fiat directly from the response. Need a deep dive on a single hash subject to provider coverage? Use GET /api/blockchain/transaction with network and transactionId.

3. Reconcile fiat and handle payouts or refunds

For dashboards and accounting, usdValue from the balance call (or usdRate from GET /api/info/supported-coins, refreshed about every minute) gives you the dollar figure without a separate price feed.

Payouts and refunds are non-custodial — CryptoAPI never signs or sees your key. Pull the parameters, sign client-side, then broadcast:

bash
curl "https://api.cryptoapi.so/api/blockchain/transaction-meta?network=tron&address=TXYZ...deposit" \
  -H "key: YOUR_API_KEY"

For Tron, read resource prices and the transaction reference header from data. Build and sign the raw transaction in your own wallet.

Save the transaction object that your Tron wallet signed as signed-transaction.json. Send its JSON text as the string rawTx.

bash
jq -n --arg rawTx "$(cat signed-transaction.json)" \
  '{network: "tron", rawTx: $rawTx}' |
  curl --request POST "https://api.cryptoapi.so/api/wallet/send" \
    --header "key: $CRYPTOAPI_KEY" \
    --header "Content-Type: application/json" \
    --data @-

You get back a data.txid for the broadcast transfer.

Ship it

That is a complete stablecoin checkout: unique addresses, polling confirmation, fiat reconciliation, and non-custodial payouts across Ethereum, BNB, and Tron. Grab an API key in your dashboard and read the full reference at https://api.cryptoapi.so/api/doc.

Was this guide helpful?
Read it, then ship it

Copy the code above and run it today.

Every snippet in this guide works on the free plan. Grab a key and make your first call in a minute.