Merchant API
Payment Intents

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.

POST
/payment_intents

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.

AuthorizationBasic <token>

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.

amount*string

Positive integer amount in the currency's minor units, encoded as a string to preserve precision (e.g. "10000" for MYR 100.00).

Match^[1-9]\d*$
checkout_mode?string

Checkout owner. hosted always returns an AnyPay-hosted presentation URL; merchant requires payment_method and returns a canonical next action.

Default"hosted"

Value in

  • "hosted"
  • "merchant"
country*string

ISO 3166-1 alpha-2 country code, e.g. "MY".

Match^[A-Z]{2}$
currency*string

ISO 4217 currency code (e.g. "MYR", "USD") or a 3–6 letter token symbol. Uppercase.

Match^[A-Z]{3,6}$
customer*

Customer identity. Required fields vary by routed payment method.

device_fingerprint?string
Length1 <= length <= 256
merchant_reference*string

Merchant-side idempotency key. A repeat POST with identical create fields returns the original intent.

Length1 <= length <= 256
metadata?
payment_method?string

Value in

  • "FPX"
  • "PROMPTPAY"
  • "TRUEMONEY"
  • "BANK_TRANSFER"
  • "TNG"
  • "BOOST"
  • "CARD"
  • "GRABPAY"
  • "ALIPAY"
  • "UMOBILE"
  • "EMONEI"
  • "DUITNOW_QR"
  • "WECHAT_PAY"
  • "UNIONPAY"
payment_method_options?

Flat canonical options for the selected payment_method. Required fields are determined by the resolved payment route; FPX accepts only an optional bank.

provider?string

An opaque provider selection configured for this merchant. Available selections are not enumerated in the merchant API.

Match^[a-z0-9][a-z0-9_-]*$
Length1 <= length <= 64
return_url?string

Optional hosted-checkout terminal return URL. AnyPay returns this URL unmodified and does not append an asserted payment status.

Formaturi
Lengthlength <= 2048

Response 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"}