Attach Payment Method to Payment Intent
Attach an existing payment method (or ephemeral) to an intent. Idempotent by Idempotency-Key.
POST
Attach a Payment Method to a PaymentIntent
Authorizations
Use your secret API key. Example: Authorization: Bearer sk_test_xxx
Headers
API version header. Use '2026-01-01' for the latest version.
Idempotency key for safely retrying POST requests.
Path Parameters
Body
application/json
Response
Updated PaymentIntent
Represents an intent to collect payment from a customer. Use confirm to finalize.
Example:
"pi_1Hh1X2AbCdEf"
Amount in smallest currency unit
Example:
1500
Example:
"BDT"
Available options:
requires_payment_method, requires_confirmation, processing, succeeded, requires_action, canceled Example:
"requires_payment_method"
Client-side secret used by frontends
Example:
"cs_test_abc"
Example:
"payment_intent"
Available options:
automatic, manual Example:
"automatic"
Example:
"cus_123"
Example:
"pm_card_abc"