BchainPayBchainPay

Create a payment intent


title: "Create a payment intent" description: "POST /v1/payment-intents — accept a stablecoin payment on any supported chain." section: "API reference" order: 11 updated: "2026-04-18" sourcePath: "content/docs/api/payment-intents/create.mdx"

POST/v1/payment-intents

Creates a payment intent and returns a fresh on-chain address. The customer pays into that address; once confirmed, the funds land in the matching pocket and a payment_intent.completed webhook fires.

Request body

FieldTypeRequiredDescription
amount_centsintegerrequiredAmount to charge in minor units of currency (USD cents).
currencystringrequiredISO-4217 currency the amount is denominated in. Supported: USD.
settlement_currencystringrequiredCoin to settle in. One of USDC, USDT, ETH, MATIC, SOL, TRX, BNB.
networkstringrequiredChain to receive on. One of ethereum, polygon, solana, tron, bnb.
referencestringoptionalYour internal reference (e.g. order ID). Echoed back on every webhook.
metadataobjectoptionalUp to 20 key/value pairs. Values must be strings ≤ 500 chars.
expires_inintegeroptionalSeconds until the intent expires. Default 3600, max 86400.

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",
  "settlement_currency": "USDC",
  "network": "polygon",
  "reference": "INV-2026-001"
}'

Response — 201 Created

{
  "id": "pi_3L9k...42",
  "object": "payment_intent",
  "status": "requires_payment",
  "amount_cents": 4999,
  "currency": "USD",
  "settlement_currency": "USDC",
  "network": "polygon",
  "address": "0x9f3a...b41C",
  "pocket_id": "pkt_usdc_polygon",
  "reference": "INV-2026-001",
  "expires_at": "2026-04-18T13:00:00Z",
  "created_at": "2026-04-18T12:00:00Z"
}

Errors

StatusCodeMeaning
400invalid_networkNetwork is not in the supported list.
400invalid_settlement_currencyCoin is not available on that network.
401invalid_api_keyBearer token missing or revoked.
409idempotency_conflictIdempotency key reused with a different body.
Last updated Edit on GitHub