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
| Field | Type | Required | Description |
|---|---|---|---|
| amount_cents | integer | required | Amount to charge in minor units of currency (USD cents). |
| currency | string | required | ISO-4217 currency the amount is denominated in. Supported: USD. |
| settlement_currency | string | required | Coin to settle in. One of USDC, USDT, ETH, MATIC, SOL, TRX, BNB. |
| network | string | required | Chain to receive on. One of ethereum, polygon, solana, tron, bnb. |
| reference | string | optional | Your internal reference (e.g. order ID). Echoed back on every webhook. |
| metadata | object | optional | Up to 20 key/value pairs. Values must be strings ≤ 500 chars. |
| expires_in | integer | optional | Seconds 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
| Status | Code | Meaning |
|---|---|---|
400 | invalid_network | Network is not in the supported list. |
400 | invalid_settlement_currency | Coin is not available on that network. |
401 | invalid_api_key | Bearer token missing or revoked. |
409 | idempotency_conflict | Idempotency key reused with a different body. |