Mobile Banking
Mobile Banking in Thailand allows customers to complete payments directly through their bank's mobile application using real-time bank transfer rails. Consumers authenticate the transaction through their banking app after selecting their bank during checkout. The payment is processed instantly through Thailand's banking network, enabling merchants to receive funds securely and efficiently.
This guide will walk you through integrating Mobile Banking via API, covering essential steps like initiating payments, handling user redirection, checking payment statuses, and managing notifications.
Requirements
- API credentials - Ensure you have your EBANX integration key. If not, complete the Merchant Signup Form.
- Familiarity with EBANX Direct - This setup follows the same general structure as other payment methods, with a few unique parameters. See Direct API for more info.
Supported Banks
| Bank Name | Bank Code |
|---|---|
| Bangkok Bank (Bualuang mBanking) | bbl |
| KBank (K PLUS) | kbank |
| Krung Thai (KTB NEXT) | ktb |
| Krungsri (KMA) | bay |
| SCB (SCB Easy) | scb |
How it works
Web-to-App Flow
- The customer selects Mobile Banking as the payment method during checkout.
- The customer chooses their preferred bank from the list of supported banks.
- A QR code is displayed on the customer's screen.
- The customer logs into their bank application and scans the QR code.
- The merchant receives a payment confirmation once the transaction is completed.
The QR code can only be scanned with the previously selected bank app.
App-to-App Flow
- The customer selects Mobile Banking as the payment method.
- The customer selects their bank from the available bank list.
- The customer is redirected or deep-linked to the selected bank's mobile app.
- The customer authenticates the payment within the banking app.
- The merchant receives a success notification once the payment is confirmed.
When the redirect URL is rendered on the web, it generates a QR code which the customer scans using their selected bank app. When the redirect URL is rendered on mobile, it performs a redirect or deep link to the bank app.
Technical flow
-
Request payment - Call the
ws/directendpoint with the parameters defined below. -
Payment instructions - In response to this request, EBANX will return a redirect link to the bank's payment environment, to which the merchant must redirect the customer to complete the transaction.
-
Customer completes the payment - Once the customer is redirected, the transaction will be set on our platform with the status pending (
PE). -
Payment confirmation - Once the transaction is successful, the customer receives a confirmation on their banking app, and the merchant is updated with the transaction status.
-
EBANX notification - EBANX sends you a webhook notification confirming the successful transaction, allowing you to fulfill your customer's order.
Instructions
Follow the steps below.
- Select your environment
Select the appropriate environment for your integration. Use the sandbox environment for testing or the production environment for live transactions.
Select the appropriate environment for your integration. Use the sandbox environment for testing, or the production environment for live transactions. Use the URL for your HTTP requests based on your selection.
https://sandbox.ebanx.com/ws/direct - Define your parameters
To create a Mobile Banking payment, you need to define the parameters in your request. The following tables outline the required parameters for the payment process.
Basic parameters
Parameter Requirement Description operationRequired Set to requestintegration_keyRequired Your EBANX integration key payment_type_codeRequired Set to mobile-bankingcountryRequired Set to thfor ThailandCustomer data
Parameter Requirement Description nameRequired Customer name emailRequired Customer email phone_numberOptional Customer phone Charge parameters
Parameter Requirement Description merchant_payment_codeRequired Unique merchant payment code currency_codeRequired Supported value: THBamount_totalRequired Total amount to be charged bank_details.bank_codeRequired Bank code for the selected bank (see Supported Banks) redirect_urlRequired URL the customer is redirected to after payment completion Transaction Limits- Minimum: THB 20.00
- Maximum: THB 150,000.00
Please note these are generic limits. Actual limits may vary depending on the customer and their bank.
- Payment request
Once your customer submits a Mobile Banking payment, create a payment request using the ws/direct endpoint.
Sample request
curl -X POST \
--location 'https://sandbox.ebanx.com/ws/direct' \
--header 'Content-Type: application/json' \
--data '{
"integration_key": "{{integration_key}}",
"operation": "request",
"payment": {
"name": "John Doe",
"email": "john.doe@example.com",
"country": "th",
"phone_number": "5555555555",
"payment_type_code": "mobile-banking",
"merchant_payment_code": "{{unique_merchant_code}}",
"currency_code": "THB",
"amount_total": 99.85,
"redirect_url": "https://merchant.example.com/callback",
"bank_details": {
"bank_code": "kbank"
}
}
}' - Payment successful response
A successful request will return a response similar to the example below.
{
"payment": {
"hash": "59acc5f00945fa382ab051651440826da7701533249b3a475",
"country": "th",
"merchant_payment_code": "{{unique_merchant_code}}",
"order_number": null,
"status": "PE",
"status_date": "{{YYYY-MM-DD HH:mm:ss}}",
"open_date": "{{YYYY-MM-DD HH:mm:ss}}",
"confirm_date": null,
"transfer_date": null,
"amount_br": "99.85",
"amount_ext": "99.85",
"amount_iof": "1",
"currency_rate": "1",
"currency_ext": "THB",
"due_date": "{{YYYY-MM-DD}}",
"instalments": "1",
"payment_type_code": "mobile-banking",
"redirect_url": "https://merchant.example.com/callback",
"bank_details": {
"bank_code": "kbank"
},
"pre_approved": false,
"capture_available": null
},
"status": "SUCCESS"
}At this stage, the payment will appear as pending (PE) in yourEBANX Dashboardchevron_rightredirect_url behaviorNote that the address returned from EBANX in
redirect_urlon the response (the address to which the customer must be redirected to continue with the transaction within the bank environment) is different from theredirect_urlspecified by the merchant in the transaction request (the address to which the customer will be redirected at the end of the transaction). - Redirect customer to bank environment
The merchant must use the redirect URL to direct the customer to the bank's mobile app (in case of mobile) or display the QR code (in case of web flow).
"redirect_url": "https://merchant.example.com/callback"Each bank has its own payment timeout, which is not configurable:
Bank Name Web/QR Timeout App/Mobile Timeout Bangkok Bank (Bualuang mBanking) 15 mins 15 mins KBank (K PLUS) 10 mins 3 mins SCB (SCB Easy) 30 mins 30 mins Krung Thai (KTB NEXT) 30 mins 30 mins Krungsri (KMA) 15 mins 15 mins Sandbox BehaviorWhen testing in sandbox, a simulator environment will be rendered to accept or decline the payment.
- Monitor payment for status changes
After the customer completes the payment, EBANX will send a confirmed (
CO) payment status to the merchant.Notifications
-
EBANX will send a notification whenever a payment status changes.
-
Make sure your system is set up to receive notifications from EBANX for any changes in payment status.
Status
-
After receiving a notification that the status has changed, retrieve the payment status.
-
When a payment is confirmed, the status will change from pending (PE) to confirmed (CO). If the customer does not complete the payment, the status will eventually change to cancelled (CA).
-
- Congratulations!
You have successfully integrated Mobile Banking for Thailand.
For more information, refer to theDirect API reference guidechevron_right
Resources
Use the following resources when testing in your sandbox environment.
API Reference
Click here to access detailed API documentation to integrate efficiently.
Mock Customer Data
Click here to view mock customer data for testing and validating user flows.
Error Codes
Click here to review common error codes to troubleshoot and resolve issues quickly.
Still need help?
We hope this article was helpful. If you still have questions, you can explore the following options:
- Merchant support: Contact our support team at sales.engineering@ebanx.com for assistance.
- Not a partner yet? Please complete the Merchant Signup Form, and our commercial team will reach out to you.