Create Payment — THB

สร้างคำขอชำระเงินผ่าน PromptPay QR หรือโอนผ่านธนาคาร

THB THB
POSTCreate THB Payment
Endpoint URL
https://testnet.trustsig.xyz/v1/payment/createInvoicePayment/fiat

Authentication Status

API Key is required for all requests Webhook Secret

Headers

x-api-key
Required

Your shop API key

x-signature
Required

HMAC-SHA256 of timestamp|method|fullUrl|body signed with your secret key, sent as 64 hex characters

How to create the signature
x-timestamp
Required

Current Unix time in milliseconds — must be the same value used to create x-signature

Parameters (Request Body)

order_id
string Required

Your reference for this payment, for example a uuid. It must not match any payment already in the system. A reused order_id returns code 9000 (PAYMENT_EXISTS).

order_user_reference
string Optional

Your ID for the customer. If you leave it out, the system uses payer_bank_account_number. A new payment cancels the same customer's earlier payments that are still pending, matched by this value or by the same payer bank and account number. The system also uses this value to pick the receiving account, so a returning customer usually gets the same account, and checks it against the block list (code 9057).

payment_method_type
enum Optional

Optional. PROMPTPAY_QR is the only accepted value and the default. Any other value returns 422.

amount
string Required

Amount in baht, sent as a string of digits such as "200" or "200.50". A JSON number returns 422. The system keeps the whole-baht part and adds a satang value that no other open payment uses, so it can match the transfer. The customer must pay payment_amount from the response, not this value. If every satang value for that baht amount is taken, the system moves up to the next baht. A KTB receiving account gets a whole-baht amount with no satang. The amount must be below 1,000,000 (code 9044) and not below the shop's minimum deposit (code 9040). It does not need to be a multiple of 100.

from_currency
enum Required

Currency the customer pays. Must be THB.

to_currency
enum Required

Currency the shop is credited in. Must be THB.

payer_bank_provider
string Required

Bank of the account the customer pays from. Send the bank code, such as SCB or KBANK (any letter case), or the 3-digit bank number, such as 022 for CIMB. G_WALLET is also accepted. An unsupported code returns 422.

Bank List (GET /v1/ebank/bankConfig)
payer_bank_account_number
string Required

The customer's account number. Dashes and spaces are ignored. The number of digits must match the bank, for example 10 for SCB and KBANK, and 12 or 10 for GSB and BAAC. A mismatch returns 422.

payer_bank_account_name
string Required

The customer's account name. Only Thai and English letters, spaces and dots count. After that cleanup the name needs at least 1 character and at most 200, otherwise you get 422.

lifetime
number Optional

How long the payment stays open, in seconds. The default is 600 (10 minutes), or 300 (5 minutes) when the amount is 100 baht or less.

discount_percent
number Optional

Discount in percent, at most 100. The default is 0. The system takes the discount off amount before it adds the satang, so payment_amount is already the discounted price.

payment_domain
string Optional

Stored with the payment for your reference only. It does not change payment_url; the system chooses the payment page domain itself.

url_return
string Optional

URL to return the customer to after payment. Optional; empty by default.

url_success
string Optional

Redirect URL for a successful payment. Optional; empty by default.

url_failed
string Optional

Redirect URL for a failed payment. Optional; empty by default.

additional_data
object Optional

Any extra data to keep with the payment, stored as sent. Do not use the keys source or p2p_topup; the system uses them.

display.color
string Optional

Payment page colour, sent as "primary" or "primary,background", for example "blue,zinc". Primary: red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, rose. Background: gray, zinc, neutral.

display.theme
enum Optional

Colour mode of the payment page.

display.name
string Optional

Shop name shown on the payment page, up to 100 characters. The display object only changes how the page looks; it has no effect on the amount or the receiving account. An invalid value or an unknown key inside display returns 422.