Merchant API

Create a payment intent

Create and start a direct Payment with one complete Provider-neutral request.

Use a Payment intent when your application has already selected the payment method and will render the returned Provider-neutral action. Use Hosted Checkout when the payer should choose the method in the Checkout application.

Endpoint

POST /payment_intents

Authorization, Content-Type: application/json, and Idempotency-Key headers are required.

Request

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",
    "merchant_reference": "order_12345",
    "payment_method": "FPX",
    "payment_method_options": { "bank": "MB2U0227" },
    "customer": {
      "name": "Aisyah Rahman",
      "email": "aisyah@example.com"
    },
    "return_url": "https://merchant.example/payments/complete"
  }'

Required fields are amount, currency, country, merchant_reference, payment_method, and customer. amount is a positive minor-unit integer string. Discover eligible direct methods and their required payer fields with:

curl -s "$API_BASE/payment_methods?amount=10000&currency=MYR&country=MY" \
  -u "$API_PUBLIC_KEY:$API_SECRET_KEY"

The API rejects a missing method, unavailable Payment configuration, or missing method-required payer data before creating a Payment. It does not accept checkout_mode; the endpoint itself owns direct execution.

Response

{
  "object": "payment_intent",
  "id": "dord_01K2VK4V0C7Y6HG4H3ED4HPR2F",
  "status": "requires_action",
  "amount": "10000",
  "currency": "MYR",
  "country": "MY",
  "merchant_reference": "order_12345",
  "payment_method": "FPX",
  "next_action": {
    "type": "redirect_to_url",
    "url": "https://api.example.com/continue/session_123",
    "expires_at": "2026-08-16T10:15:00.000Z"
  }
}

Render next_action according to its type: redirect, QR code, or bank-transfer instructions. Redirect URLs always point to an Init-controlled continuation. Provider URLs and form fields are never exposed in this response.

Once the Payment is persisted, Provider rejection and unknown creation outcomes are returned as a normal 201 Payment projection (failed or asynchronous processing). Retry a lost response with the same Idempotency-Key; never create a replacement Payment with a new Merchant reference.

See Payment creation surfaces for the boundary between direct Payments and Hosted Checkouts.

On this page