Confirm a payment intent
POST/v1/payment-intents/:id/confirm
Confirms a payment intent, transitioning it through intermediate states into processing. The API automatically walks through the required state transitions (created → requires_action → processing).
This endpoint is idempotent: if the intent is already in the processing state, the current state is returned without side effects.
Path parameters
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | required | Payment intent ID (e.g. pi_3L9kX42). |
Request body
No request body is required.
Example
curl -X POST https://api.bchainpay.com/v1/payment-intents/pi_3L9kX42/confirm \
-H "Authorization: Bearer $BCHAINPAY_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"Response — 200 OK
Returns the full PaymentIntentResponse with the updated status.
{
"id": "pi_3L9kX42",
"merchant_id": "merch_abc123",
"amount_cents": 4999,
"received_amount_cents": 0,
"remaining_amount_cents": 4999,
"currency": "USD",
"network": "ethereum",
"token": "USDC",
"crypto_amount": "4990000",
"crypto_amount_decimal": "4.99",
"token_price_cents": 100,
"status": "processing",
"reference": "order_2026_001",
"metadata": {
"blockchain_address": "0x9f3a...b41C"
},
"created_at": "2026-04-27T12:00:00Z",
"updated_at": "2026-04-27T12:01:30Z"
}State transitions
| Previous status | Result |
|---|---|
created | Automatically transitions through requires_action → processing. |
requires_action | Transitions to processing. |
processing | No-op — returns current state (idempotent). |
succeeded or canceled | Returns 409 invalid_state_transition. Terminal states cannot be confirmed. |
Errors
| Status | Code | Meaning |
|---|---|---|
400 | missing_idempotency_key | Idempotency-Key header was not provided. |
401 | unauthorized | Invalid or missing API key. |
404 | not_found | Payment intent does not exist. |
409 | invalid_state_transition | The intent is in a terminal state and cannot be confirmed. |