BchainPayBchainPay

Create a payment intent

POST/v1/payment-intents

Creates a new payment intent in the created status. The intent records how much the customer owes and optionally pins a network and token. To generate a blockchain address for the customer to pay into, call Generate Address as a second step.

Request body

FieldTypeRequiredDescription
amount_centsintegerrequiredAmount to charge in the smallest unit of currency (e.g. USD cents). Must be greater than 0.
currencystringrequiredISO-4217 fiat currency code, 3–4 characters (e.g. USD).
settlement_currencystringoptionalCrypto token to settle in. If omitted the merchant default is used.
networkstringoptionalBlockchain network. One of ethereum, solana, tron, bnbchain.
tokenstringoptionalToken symbol. One of ETH, USDT, USDC, DAI, SOL, TRX, BNB, BUSD. Must be valid for the chosen network (see table below).
referencestringoptionalYour internal reference (e.g. order ID). Max 255 characters. Echoed back in the response and on webhooks.
metadataobjectoptionalArbitrary key/value pairs attached to the intent.

Supported tokens by network

NetworkTokens
ethereumETH, USDT, USDC, DAI
solanaSOL, USDT, USDC
tronTRX, USDT, USDC
bnbchainBNB, USDT, USDC, BUSD

Example

curl -X POST https://api.bchainpay.com/v1/payment-intents \
-H "Authorization: Bearer $BCHAINPAY_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
  "amount_cents": 4999,
  "currency": "USD",
  "network": "ethereum",
  "token": "USDC",
  "reference": "order_2026_001"
}'

Response — 201 Created

{
  "id": "pi_3L9kX42",
  "merchant_id": "merch_abc123",
  "amount_cents": 4999,
  "received_amount_cents": 0,
  "remaining_amount_cents": 4999,
  "currency": "USD",
  "network": "ethereum",
  "token": "USDC",
  "status": "requires_action",
  "reference": "order_2026_001",
  "metadata": {},
  "created_at": "2026-04-27T12:00:00Z",
  "updated_at": "2026-04-27T12:00:00Z"
}
FieldTypeRequiredDescription
idstringrequiredUnique payment intent identifier.
merchant_idstringrequiredYour merchant account ID.
amount_centsintegerrequiredRequested amount in minor currency units.
received_amount_centsintegerrequiredTotal confirmed on-chain amount, in minor currency units. Starts at 0.
remaining_amount_centsintegerrequiredAmount still owed: amount_cents - received_amount_cents.
currencystringrequiredFiat currency code.
settlement_currencystringoptionalSettlement token, if specified.
networkstringoptionalBlockchain network, if specified.
tokenstringoptionalToken symbol, if specified.
crypto_amountstringoptionalRaw crypto amount (smallest unit). Populated after Generate Address.
crypto_amount_decimalstringoptionalHuman-readable crypto amount (e.g. "4.99").
token_price_centsintegeroptionalToken price snapshot at generation time, in minor currency units.
statusstringrequiredCurrent status: requires_action, processing, completed, failed, cancelled, expired.
referencestringoptionalYour reference string, echoed back.
metadataobjectoptionalArbitrary metadata. After address generation, includes blockchain_address.
created_atstringrequiredISO 8601 timestamp.
updated_atstringrequiredISO 8601 timestamp of the last update.

Errors

StatusCodeMeaning
400invalid_requestMissing or invalid field — check error.details.
400missing_idempotency_keyIdempotency-Key header was not provided.
401unauthorizedInvalid or missing API key.
409conflictIdempotency key reused with a different body.
422invalid_currencyThe provided currency is not supported.
Last updated Edit on GitHub