PromptPay

Learn about PromptPay, an instant funds transfer service popular in Thailand.

PromptPay is an infrastructure solution developed and regulated by the payment policy-making authority Bank of Thailand (BoT). Their Payment System Roadmaps modernize the payment infrastructure in the country alongside banks. To transfer funds between banks, users are identified through proxies such as mobile phone number, national identification number, corporate registration number, or digital wallet number.

Features #

Processing currenciesTHB
Settlement currenciesUSD
Minimum transaction amount1 THB
Maximum transaction amount5,000 THB
Refunds
Partial Refunds
Multiple partial refund
Chargeback

Payment flow #

pic_2@2x.png

Integration Method #

Payment method enumeration values: promptpay

There are two integration methods for PromptPay

  1. Direct API
  2. Checkout

Direct API #

How to integration #

For direct API integration, you can create a PaymentIntent and get url in only one step. The following is the demo of creating payment intent:

Create a PaymentIntent

A PaymentIntent is an object that represents your intent to collect payment from your customer and tracks the lifecycle of the payment process. Create a PaymentIntent on your server and specify the amount to collect and a supported currency. If you have an existing Payment Intents integration, add promptpay to the list of payment method types.

Request

{
    "amount":1000,
    "currency":"THB",
    "confirm":true,
    "payment_method_data" : {
        "type":"promptpay"
    },
    "return_url":"https://your.website"
}

Response

{
    "id": "pi_1664208234002513920",
    "object": "payment_intent",
    "created": 1685613137000,
    "currency": "THB",
    "amount": 1000,
    "status": "requires_action",
    "livemode": false,
    "client_secret": "pi_1664208234002513920_secret_tzDL9JipXe0RE3qGTkNVty9j",
    "next_action": {
        "type": "promptpay_handle_redirect",
        "promptpay_handle_redirect": {
            "url": "https://apitest.wooshpay.com/v1/receives/c12/pay/pi_1664208234002513920"
        }
    },
    "payment_method_types": [
        "promptpay"
    ],
    "confirmation_method": "automatic",
    "return_url": "https://your.website",
    "payment_method": "pm_1664208233880879104",
    "capture_method": "automatic"
}

Checkout #

Create a seesion #

Request

{
    "cancel_url": "www.wooshpay.com",
    "mode": "payment",
    "success_url": "https://wooshpay.com/",
    "payment_method_types": [
        "promptpay"
    ],
    "line_items": [
        {
            "price_data": {
                "currency": "THB",
                "unit_amount": 100,
                "nickname": "apple",
                "product_data": {
                    "name": "apple"
                },
                "billing_scheme": "testscheme",
                "lookup_key": "test_lookup_key"
            },
            "quantity": 1
        }
    ]
}

Response

{
    "id": "cs_1676158633408200704",
    "object": "checkout.session",
    "created": 1688462334000,
    "livemode": false,
    "currency": "THB",
    "customer": "",
    "mode": "payment",
    "status": "open",
    "url": "https://checkouttest.wooshpay.com/pay/cs_test_1676158633408200704?key=pk_test_NTE2NzQzMzIzODEyNTI4MTY4OTYxOjEyVWdaRjhhSGpqOFZhRDZvaFRyc1RZbzE2ODgwMjY5MjU5NTk",
    "cancel_url": "www.wooshpay.com",
    "line_items": {
        "object": "list",
        "data": [
            {
                "id": "li_1676158633437560832",
                "object": "item",
                "currency": "THB",
                "description": "apple",
                "price": {
                    "id": "price_1676158633450143744",
                    "object": "price",
                    "created": 1688462334000,
                    "livemode": false,
                    "active": true,
                    "currency": "THB",
                    "nickname": "apple",
                    "product": {
                        "id": "prod_1676158633462726656",
                        "object": "product",
                        "created": 1688462334000,
                        "livemode": false,
                        "active": true,
                        "name": "apple",
                        "updated": 1688462334000
                    },
                    "type": "one_time",
                    "unit_amount": 100,
                    "billing_scheme": "per_unit",
                    "lookup_key": "test_lookup_key"
                },
                "quantity": 1,
                "amount_subtotal": 100,
                "amount_total": 100
            }
        ]
    },
    "payment_intent": "pi_1676158633626304512",
    "payment_method_types": [
        "promptpay"
    ],
    "payment_status": "unpaid",
    "success_url": "https://wooshpay.com/",
    "amount_subtotal": 100,
    "amount_total": 100,
    "billing_address_collection": "auto",
    "expires_at": 1688548734385,
    "payment_link": "",
    "client_secret": "pi_1676158633626304512_secret_JbvbX6yCPEBB886Z46Rs5vw8"
}

Next step #

You can add more features to your integration as needed

Create a Webhook #

Listen to events on your WooshPay account so your integration can automatically trigger reactions. Create a webhook that mainly focuses on enabled_events and url.

What are your feelings
Updated on August 8, 2023