Skip to main content
POST
Create a Payment Intent
Returns 201 Created with the intent id, client_secret, and the supplied order_reference when present. Hand the id and client_secret to the JavaScript SDK to render the card fields and confirm the payment. Card data is never sent to this endpoint.
Never expose the secret key in a browser or mobile app. The browser SDK uses your publishable key (pk_) instead, scoped to this intent by its client_secret. See What is client_secret?
order_reference participates in idempotency comparison. Reusing an Idempotency-Key with a different order reference returns 409 instead of changing the existing intent.
Confirmation happens in the browser through the SDK, not through a REST call you make yourself. See Confirm the payment.

Authorizations

X-API-Key
string
header
required

Server-side secret key (sk_...) supplied in X-API-Key. Never expose this key in a browser or mobile app.

Headers

Idempotency-Key
string
required

Unique client-generated identifier for Payment Intent creation. Allowed characters: letters, digits, dot (.), hyphen (-), and underscore (_); 8-64 characters. Reusing the same key for the same branch with an identical body returns the existing intent; reusing it with a different body returns a conflict.

Required string length: 8 - 64
Pattern: ^[A-Za-z0-9._-]{8,64}$

Body

application/json
amount
integer<int64>
required

Amount to charge in the currency's smallest unit (for PHP, centavos). 86500 = PHP 865.00. Integer, range 1 to 99,999,999.

Required range: 1 <= x <= 99999999
Example:

86500

currency
string
required

ISO 4217 currency code: a string of exactly 3 uppercase letters (for example, PHP). Must be a currency enabled for your account.

Required string length: 3
Pattern: ^[A-Z]{3}$
expires_at
string<date-time>
required

Required RFC 3339 timestamp when the intent stops being payable. It must be in the future and is normalized to UTC.

Example:

"2030-01-01T10:00:00Z"

merchant_branch_reference_number
string

Target branch reference. Required for partner- and merchant-scoped secret keys. A branch-scoped key may omit it and can only target its own branch.

Maximum string length: 100
description
string | null

Optional human-readable label. When supplied, it must contain at least one non-whitespace character and be at most 500 characters.

Maximum string length: 500
Example:

"Order #1234"

order_reference
string | null

Optional merchant-defined order reference for reconciliation. It can contain at most 100 Unicode characters. Omit it or send null when the intent has no order reference.

Maximum string length: 100
Example:

"ORD-2026-1234"

metadata
object

Free-form string key/value pairs stored with the intent. Max 50 keys; each key <=40 characters, each value <=500 characters; <=10,000 serialized bytes. Sensitive payment or credential data is prohibited.

Response

Payment intent created.

id
string<uuid>
required

Unique payment intent identifier (UUID v7). Pass this to the SDK.

Example:

"b7e2c1a4-9f3d-4c6b-8a21-5e0f7d9c3b18"

client_secret
string<uuid>
required

Client secret that authorizes confirming this one intent. Pass it to the SDK with id. Keep it out of logs and URLs.

amount
integer<int64>
required

Amount in the smallest currency unit.

Example:

86500

currency
string
required

ISO 4217 currency code.

Example:

"PHP"

status
enum<string>
required

Current lifecycle status of the newly created Payment Intent.

Available options:
ACTIVE,
CONSUMED,
EXPIRED,
CANCELLED
expires_at
string<date-time>
required

RFC 3339 UTC timestamp when the intent stops being payable.

Example:

"2030-01-01T10:00:00Z"

order_reference
string

Merchant-defined order reference supplied in the create request. Omitted when no order reference was supplied.

Maximum string length: 100
Example:

"ORD-2026-1234"