Create Payment — THB
สร้างคำขอชำระเงินผ่าน PromptPay QR หรือโอนผ่านธนาคาร
https://testnet.trustsig.xyz/v1/payment/createInvoicePayment/fiatAuthentication Status
API Key is required for all requests Webhook Secret
Headers
x-api-keyYour shop API key
x-signatureHMAC-SHA256 of timestamp|method|fullUrl|body signed with your secret key, sent as 64 hex characters
How to create the signaturex-timestampCurrent Unix time in milliseconds — must be the same value used to create x-signature
Parameters (Request Body)
order_idYour 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_referenceYour 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_typeOptional. PROMPTPAY_QR is the only accepted value and the default. Any other value returns 422.
amountAmount 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_currencyCurrency the customer pays. Must be THB.
to_currencyCurrency the shop is credited in. Must be THB.
payer_bank_providerBank 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_numberThe 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_nameThe 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.
lifetimeHow 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_percentDiscount 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_domainStored with the payment for your reference only. It does not change payment_url; the system chooses the payment page domain itself.
url_returnURL to return the customer to after payment. Optional; empty by default.
url_successRedirect URL for a successful payment. Optional; empty by default.
url_failedRedirect URL for a failed payment. Optional; empty by default.
additional_dataAny extra data to keep with the payment, stored as sent. Do not use the keys source or p2p_topup; the system uses them.
display.colorPayment 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.themeColour mode of the payment page.
display.nameShop 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.