Create Payment Order — FLEX (Hosted Payment Page) ⭐ Recommended

FLEX is the recommended way to create deposit orders — one API call returns a hosted payment_url that handles the entire customer flow. Please use FLEX for all new integrations and migrate existing ones.

Why FLEX?

⚠️ Important : the customer must make the payment through our payment page only. Do not extract the QR/account details and present them in your own UI — the page flow (instructions → transfer → slip submission) is part of how the order gets confirmed.

How it works

  1. Call POST /payment-flex/create → receive payment_url.
  2. Redirect (or open a new tab for) the customer to payment_url.
  3. The payment page guides the customer: shows instructions, the QR code or destination bank account, collects the slip if required, and shows live status.
  4. When the payment is confirmed, the payment gateway calls your notify_url (see Payment Callback) and the page redirects the customer to your redirect_url (if provided).

URL : /payment-flex/create

Method : POST

Request

{
   "merchant_id" : "[Merchant id]",
   "token" : "[Auth Token]",
   "time" : "[Time Stamp]",
   "merchant_order_id" : "[unique merchant order id]",
   "amount" : "[amount]",
   "bank" : "[bank]",
   "account_name" : "[account_name]",
   "account_no" : "[account_no]",
   "notify_url" : "[notify url]",
   "redirect_url" : "[redirect url] (optional)",
   "payment_theme" : "[theme name] (optional)"
}
ParameterDescriptionExample
merchant_order_idUnique merchant reference. Allowed: 0-9 a-z A-Z, max length 40ORDER0123456789789445566
amountAmount, 2 decimals, no thousands separator1000.00
bankCustomer bank codeKBANK
account_nameCustomer account nameJohn Doe
account_noCustomer account number1234567890
notify_urlWebhook URL called on payment status updateshttps://merchant.com/callback/payment
redirect_url(optional) URL to send the customer back to after a successful paymenthttps://merchant.com/return
payment_theme(optional) Payment-page theme name — see the Payment-Page Themes section below. If omitted, resolves to the client → partner default → halo (default theme)halo

payment_theme resolution order: request value → clients.default_payment_themepartners.default_payment_theme → default theme (halo). The resolved value is stored with the order at creation time.

Response

ParameterDescription
platform_order_idThe gateway's unique order id
merchant_order_idMerchant order id
payment_methodMethod the system chose (TRANSFER or QR)
payment_urlHosted payment page URL to open for the customer

Success : 200 OK

{
    "success": 200,
    "data": {
        "platform_order_id": "THBP20260531...",
        "merchant_order_id": "ORDER0123456789789445566",
        "payment_method": "TRANSFER",
        "payment_url": "https://payment.example.com/THBP20260531.../<hash>"
    }
}

Error : 403 (auth) or 500 (other)

{ "error": { "code": 500, "message": "amount must be greater than 20" } }

Pending-order guard (409) — only one open FLEX order is allowed per customer account at a time. A second create returns {"success":false,"code":409,"error":"you have a pending payment order...","data":{"pending_order_id":"THBP..."}}. Cancel that order with Cancel Payment (or let the customer cancel on the payment page), then retry the create.

Payment-Page Themes

The hosted payment page can be styled with the payment_theme parameter. If you do not send one (and no default has been configured for your account), the page uses the default theme halo.

Available themes:

ThemePreview
Halohalo (default)Halo theme
PristinepristinePristine theme
BlueblueBlue theme
VaultvaultVault theme
SunsetsunsetSunset theme
ObsidianobsidianObsidian theme
StackstackStack theme
SiennasiennaSienna theme
MintmintMint theme
PulsepulsePulse theme

Sending payment_theme: "default" also renders the Halo design. An unknown / invalid payment_theme value falls back to the default theme. A per-merchant default theme can also be configured for your account — contact support or set it via the client portal.

Bank Codes

bank codebank
KBANKKasikorn Bank
BBLBangkok Bank
KTBKrungthai Bank
TTBTMBThanachart Bank
SCBSiam Commercial Bank
UOBUOB
BAYKrungsri Ayudthaya
CIMBCIMB
LHLand and House
GSBGovernment Saving Bank
KKKiatnakin Pattara
CITICITIBANK
GHBGovernment Housing Bank
BAACBank for Agriculture and Agricultural Cooperatives
TISCOTISCO
CLICXCLICX Bank