Create a payment intent
POST /payment_intents with idempotency, merchant_reference, customer details, and next_action.
Create a payment intent. The platform resolves an eligible payment method, begins processing, and returns next_action when a payer action is required.
Endpoint
POST /payment_intentsRequired headers:
Authorization: Basic <base64(publicKey:secretKey)>.Content-Type: application/json.
Optional but recommended:
Idempotency-Key: <uuid>.
Request
Request shape
customer
Required on every request. Payer identity and contact details.
Prop
Type
payment_method_options
Optional route inputs for the selected payment method.
Prop
Type
customer and payment_method_options are separate namespaces. Discovery describes required
payer data in options.payer; map those names to the create-request paths below instead of sending
the discovery object back unchanged.
| Discovery field | Create request field |
|---|---|
options.payer.customer_name | customer.name |
options.payer.customer_phone | customer.phone |
options.payer.account_name | payment_method_options.account_name |
options.payer.account_number | payment_method_options.account_number |
options.payer.bank | payment_method_options.bank |
options.payer.name_th | payment_method_options.name_th |
Hosted checkout lets the payer choose from the eligible payment methods. Omit payment_method and
payment_method_options when the payer should make that choice in the hosted page.
curl -s -X POST "$API_BASE/payment_intents" \
-u "$API_PUBLIC_KEY:$API_SECRET_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"amount": "10000",
"currency": "MYR",
"country": "MY",
"checkout_mode": "hosted",
"merchant_reference": "order_12345",
"customer": {
"name": "Aisyah Rahman",
"email": "aisyah@example.com",
"reference": "customer_8421"
}
}'Body fields
Prop
Type
Success
{
"object": "payment_intent",
"id": "dord_01HZX...",
"amount": "10000",
"currency": "MYR",
"country": "MY",
"environment": "test",
"checkout_mode": "hosted",
"status": "requires_action",
"merchant_reference": "order_12345",
"payment_method": "FPX",
"next_action": {
"type": "redirect_to_url",
"url": "https://checkout.example.com/checkout/signed-token",
"expires_at": "2026-05-09T12:15:00.000Z"
},
"failure_code": null,
"failure_message": null,
"created_at": "2026-05-09T12:00:00.000Z",
"updated_at": "2026-05-09T12:00:02.000Z"
}Response fields
Prop
Type
next_action is null when no customer action is required. When present, type is one of
redirect_to_url, display_qr_code, or display_bank_transfer_instructions. The shape per type
and the merchant checkout mode that drives it are documented in Checkout
mode.
Notes
amountis a minor-unit decimal string. See Currency.merchant_referenceis your application order id. A repeat POST with the same value returns the original intent.- Reusing
merchant_referencewith any changed create field returns409 idempotency_conflict. - See Idempotency for retry semantics.