Skip to main content
POST
Create a PaymentIntent

Authorizations

Authorization
string
header
required

Use your secret API key. Example: Authorization: Bearer sk_test_xxx

Headers

Xerobi-Version
string
default:2026-01-01
required

API version header. Use '2026-01-01' for the latest version.

Idempotency-Key
string

Idempotency key for safely retrying POST requests.

X-Request-Id
string

Optional client-provided request id for tracing.

Body

application/json
amount
integer
required
Example:

1500

currency
string
required
Example:

"BDT"

customer
string
automatic_payment_methods
boolean
default:true
capture_method
enum<string>
default:automatic
Available options:
automatic,
manual
metadata
object

Response

Payment intent created

Represents an intent to collect payment from a customer. Use confirm to finalize.

id
string
required
Example:

"pi_1Hh1X2AbCdEf"

amount
integer
required

Amount in smallest currency unit

Example:

1500

currency
string
required
Example:

"BDT"

status
enum<string>
required
Available options:
requires_payment_method,
requires_confirmation,
processing,
succeeded,
requires_action,
canceled
Example:

"requires_payment_method"

client_secret
string
required

Client-side secret used by frontends

Example:

"cs_test_abc"

object
string
Example:

"payment_intent"

capture_method
enum<string>
Available options:
automatic,
manual
Example:

"automatic"

customer
string | null
Example:

"cus_123"

payment_method
string | null
Example:

"pm_card_abc"

metadata
object
created_at
string<date-time>
updated_at
string<date-time>
charges
object[]