Skip to content
ChainPesaDocsTest mode
Dashboard

API reference · Payments

Create a payment

Creates a hosted checkout with its own deposit address. Send either amount (a fixed stablecoin amount) or price (a local-currency price).

With price, the customer pays the stablecoin equivalent at a rate locked for 30 minutes, fees are included so you receive the full price, and you are settled in that currency.

POST/api/v1/payments

Requires the payments:write scope. Returns 201 on success. Accepts an Idempotency-Key.

Body parameters

amountstringsometimes required
Stablecoin amount to collect, between 1 and 1,000,000. Send this or price, never both.
priceobjectsometimes required
A local-currency price. Send this or amount.
price.amountstringsometimes required
The price in major units, for example "1500.00".
price.currencystringsometimes required
A local currency you have linked in Settlements, for example NGN.
currencystringrequired
The stablecoin the customer pays with: USDT or USDC.
networkstringrequired
TRON, BSC or ETHEREUM.
settle_tostringoptional
With amount, convert what you receive into this linked local currency. Leave out to keep it in USD.
referencestringoptional
Your own order reference, up to 100 characters. It is returned on the payment and its webhooks.

Common errors

StatusCodeWhen
400invalid_requestA field is missing or wrong; the message says which
401unauthorizedBad or revoked key, or a disallowed address
403forbiddenThe key lacks the scope
429rate_limitedSlow down; see Retry-After

All error codes

Request
curl -X POST https://dev.chainpesa.com/api/v1/payments \
  -H "Authorization: Bearer $CHAINPESA_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": "250.00",
    "currency": "USDT",
    "network": "TRON",
    "reference": "order_1042"
  }'
Response 201
{
  "id": "pay_Qm3x9Tq1LbZa",
  "object": "payment",
  "status": "pending",
  "mode": "test",
  "amount": "250.000000",
  "paid_amount": "0.000000",
  "currency": "USDT",
  "network": "TRON",
  "address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",
  "settle_to": null,
  "reference": "order_1042",
  "price": null,
  "checkout_url": "https://dev.chainpesa.com/pay/pay_Qm3x9Tq1LbZa",
  "expires_at": "2027-01-12T10:45:00.000Z",
  "created_at": "2027-01-12T09:45:00.000Z"
}
Send a test request

Runs against your test data. Your key is not saved and is cleared when you leave the page.