Create a payment intent
Create a provider-neutral payment intent. `hosted` always enters branded AnyPay checkout; `merchant` requires a payment method and returns a canonical next action. An optional Provider is a strict policy-governed pin with no fallback. Idempotent on the complete create fingerprint under both `merchant_reference` and `Idempotency-Key`: identical replays return the original intent and changed input conflicts. The key's environment stamps the intent.
Create a provider-neutral payment intent. hosted always enters branded AnyPay checkout; merchant requires a payment method and returns a canonical next action. An optional Provider is a strict policy-governed pin with no fallback. Idempotent on the complete create fingerprint under both merchant_reference and Idempotency-Key: identical replays return the original intent and changed input conflicts. The key's environment stamps the intent.
Authorization
apiKey Merchant API key pair. Send as Authorization: Basic base64(publicKey:secretKey) — username is the public key (pk_live_… / pk_test_…), password is the secret key (sk_live_… / sk_test_…). The public key prefix determines the environment of every order created by the request — there is no body, query, or header override.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Create one provider-neutral Payment intent. Omitted checkout_mode means hosted; provider is a strict policy-governed pin and never falls back.
Positive integer amount in the currency's minor units, encoded as a string to preserve precision (e.g. "10000" for MYR 100.00).
^[1-9]\d*$Checkout owner. hosted always returns an AnyPay-hosted presentation URL; merchant requires payment_method and returns a canonical next action.
"hosted"Value in
- "hosted"
- "merchant"
ISO 3166-1 alpha-2 country code, e.g. "MY".
^[A-Z]{2}$ISO 4217 currency code (e.g. "MYR", "USD") or a 3–6 letter token symbol. Uppercase.
^[A-Z]{3,6}$Customer identity. Required fields vary by routed payment method.
1 <= length <= 256Merchant-side idempotency key. A repeat POST with identical create fields returns the original intent.
1 <= length <= 256Value in
- "FPX"
- "PROMPTPAY"
- "TRUEMONEY"
- "BANK_TRANSFER"
- "TNG"
- "BOOST"
- "CARD"
- "GRABPAY"
- "ALIPAY"
- "UMOBILE"
- "EMONEI"
- "DUITNOW_QR"
- "WECHAT_PAY"
- "UNIONPAY"
Flat canonical options for the selected payment_method. Required fields are determined by the resolved payment route; FPX accepts only an optional bank.
An opaque provider selection configured for this merchant. Available selections are not enumerated in the merchant API.
^[a-z0-9][a-z0-9_-]*$1 <= length <= 64Optional hosted-checkout terminal return URL. AnyPay returns this URL unmodified and does not append an asserted payment status.
urilength <= 2048Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/payment_intents" \ -H "Content-Type: application/json" \ -d '{ "amount": "string", "country": "string", "currency": "string", "customer": {}, "merchant_reference": "string" }'{ "amount": "10000", "checkout_mode": "hosted", "country": "MY", "created_at": "2026-05-09T12:34:00.000Z", "currency": "MYR", "environment": "test", "failure_code": null, "failure_message": null, "id": "dord_01HZYABCDXYZ", "merchant_reference": "order-2026-05-09-0001", "next_action": { "expires_at": "2026-05-09T12:49:00.000Z", "type": "redirect_to_url", "url": "https://checkout.example/pay/dord_01HZYABCDXYZ" }, "object": "payment_intent", "payment_method": "FPX", "processing_reason": null, "receipt": null, "status": "requires_action", "updated_at": "2026-05-09T12:34:02.000Z"}Get a payment intent GET
Fetch a payment intent by id. Scoped to the authenticating merchant and the key's stamped environment; intents that belong to another merchant or environment return 404 indistinguishably from unknown ids.
Cancel pending payment at provider POST
Request cancel-pending at the routed provider for a payment that is still pending. The provider call runs durably; poll the intent or wait for webhooks until status is terminal.