Skip to main content
PromptPay is an interbank real-time near-instant payment system that enables users to easily receive and transfer funds using either their Citizen ID or mobile phone number.

Integrating on your website / application

Step 1: Create a payin

Tazapay uses a payin object to represent your intent to collect a payment from your customer. The payin object tracks state changes from promptpay creation to payment completion.
Create a payin on your server with an amount, invoice_currency THB and a transaction_description using the create payin API
A payin is created with the status requires_payment_method.

Sample cURL

Step 2: Confirm a payin

Confirm the payin created in step 1 using the confirm payin API. Upon confirmation of the payin, a QR code is generated to display to your customer. The status of the payin moves to requires_action

Sample cURL

Combining Steps 1 and 2 into a single step

Instead of making 2 API calls, you can also combine steps 1 and 2 into a single API call. To do so, pass the parameters in both the create payin and confirm payin endpoints to the create payin API. Also, pass the following field

Sample cURL

Step 3: Display the QR code on your screen

After confirming the payin, you will receive the following response

Step 4: Handle post-payment events

Tazapay sends a payin.succeeded event as soon as the funds are received from the customer. Use the webhook_url field in the payin API to receive these events and run actions (for example, sending an order confirmation email to your customers, logging the sale in a database, starting a shipping workflow, etc.) If the payment is not made by the customer within the stipulated active time of the QR and the QR expires, Tazapay sends a payment_attempt.failed event. Display a CTA on your screen beside the QR to allow the customer to generate a new QR. To generate a new QR, confirm the payin again using Step 2.

Test the Integration

In test mode (sandbox),
  1. All the promptpay_thb payment attempts will succeed 3 minutes after creation by default. You will receive a payin.succeeded event.
  2. All the promptpay_thb payment attempts created with value 100 THB (invoice_currency - THB, amount - 10000) will fail 3 minutes after creation by default. You will receive a payment_attempt.failed event and the status of the payin will move to requires_payment_method.

Integrating Refunds

You can refund a transaction in two ways - using the dashboard or using Refund API. Promptpay supports partial refunds. Specify the amount (lesser than the invoice amount of the payin) for the refund before initiating.

Prerequisite:

Promptpay mandatorily requires customers phone number to initiate a refund.

Refunding using dashboard.

Refer to this guide: https://support.tazapay.com/how-do-i-request-a-refund-from-my-dashboard

Refund using API

Sample cURL
NOTE: For full refund, specifying the amount and currency is not required to initiate a refund.