Skip to main content

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 NameBank 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

  1. The customer selects Mobile Banking as the payment method during checkout.
  2. The customer chooses their preferred bank from the list of supported banks.
  3. A QR code is displayed on the customer's screen.
  4. The customer logs into their bank application and scans the QR code.
  5. The merchant receives a payment confirmation once the transaction is completed.
TIP

The QR code can only be scanned with the previously selected bank app.

App-to-App Flow

  1. The customer selects Mobile Banking as the payment method.
  2. The customer selects their bank from the available bank list.
  3. The customer is redirected or deep-linked to the selected bank's mobile app.
  4. The customer authenticates the payment within the banking app.
  5. The merchant receives a success notification once the payment is confirmed.
Redirect behavior

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/direct endpoint 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.

  1. 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
  2. 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

    ParameterRequirementDescription
    operationRequiredSet to request
    integration_keyRequiredYour EBANX integration key
    payment_type_codeRequiredSet to mobile-banking
    countryRequiredSet to th for Thailand

    Customer data

    ParameterRequirementDescription
    nameRequiredCustomer name
    emailRequiredCustomer email
    phone_numberOptionalCustomer phone

    Charge parameters

    ParameterRequirementDescription
    merchant_payment_codeRequiredUnique merchant payment code
    currency_codeRequiredSupported value: THB
    amount_totalRequiredTotal amount to be charged
    bank_details.bank_codeRequiredBank code for the selected bank (see Supported Banks)
    redirect_urlRequiredURL 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.

  3. 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"
    }
    }
    }'
  4. 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 your
    EBANX Dashboardchevron_right

    redirect_url behavior

    Note that the address returned from EBANX in redirect_url on the response (the address to which the customer must be redirected to continue with the transaction within the bank environment) is different from the redirect_url specified by the merchant in the transaction request (the address to which the customer will be redirected at the end of the transaction).

  5. 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 NameWeb/QR TimeoutApp/Mobile Timeout
    Bangkok Bank (Bualuang mBanking)15 mins15 mins
    KBank (K PLUS)10 mins3 mins
    SCB (SCB Easy)30 mins30 mins
    Krung Thai (KTB NEXT)30 mins30 mins
    Krungsri (KMA)15 mins15 mins
    Sandbox Behavior

    When testing in sandbox, a simulator environment will be rendered to accept or decline the payment.

  6. Monitor payment for status changes

    After the customer completes the payment, EBANX will send a confirmed (CO) payment status to the merchant.

    Notifications

    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).

  7. Congratulations!

    You have successfully integrated Mobile Banking for Thailand.

    For more information, refer to the
    Direct API reference guidechevron_right

Resources

Use the following resources when testing in your sandbox environment.


Still need help?

Help Image

We hope this article was helpful. If you still have questions, you can explore the following options: