Promptpay

Overview

Introduction

Promptpay is a payment method which allows to process payments in Thai bahts by using bank accounts in Thailand. This method supports purchases, two channels can be used for purchase processing— channel 1 involves redirection of the customer to the provider service, and channel 2 is performed without the redirection of the customer. For more information about the applicable processing channel, refer to your ecommpay key account manager.

This article provides information about working with the Promptpay method: general insights are presented in the Overview section, while information about the actions required to process payments and perform other actions is presented in the sections that follow.

General information

Payment method type QR code payments
Payment instruments bank accounts
Countries and regions TH
Payment currencies THB
Currency conversion
One-time purchases +
Credential-on-file purchases
Full refunds
Partial refunds
Payouts
Chargebacks
Notes
  • for purchase processing with redirection of the customer to the provider service the expiration time of the QR code on the provider side is 6 minutes.
  • for purchase processing without redirection of the customer to the provider service the expiration time of the QR code on the side of the ecommpay payment platform can be configured. To set the expiration time of the QR code, contact ecommpay technical support specialists.
Onboarding and access fee refer to your ecommpay account manager; more information is available in ecommpay shop

Interaction diagram

Payment processing by using the Promptpay method involves the merchant's web service, one of ecommpay interfaces, the ecommpay payment platform, and technical facilities of the provider service.



Operations support

Various platform interfaces can be used to process payments and perform operations using the Promptpay method. Purchases can be processed by using Payment Page, Gate and Dashboard (using payment links), refunds and payouts—by using Gate and Dashboard. At the same time, regardless of the interfaces used, the following properties are applicable.

When working with the Promptpay the following properties are applicable.

  Timespans ²
basic time threshold time
Purchases 3-4 minutes
Note:
  1. The base and threshold times are defined as follows:
    • The base time is the average estimated time between the moment a payment is initiated in the payment platform to the moment the payment result is sent to the web service. The base time evaluation is made on the assumption of normal operation of all technical facilities and communication channels and typical customer behaviour (if any input from the customer is required). Use the base time to estimate when to react to the absence of payment result callbacks or when to check payment status (details).
    • The threshold time is the maximum possible time between the moment a payment is initiated in the payment platform to the moment the web service receives the callback with the payment result. A payment is automatically assigned the decline status if it wasn't processed within the threshold time. For individual customisation of the threshold time limit, contact ecommpay technical support.

Processing scenarios

To perform a purchase by using the Promptpay method, you need to redirect customer to the provider service or display the payment instructions to the customer.

Scenarios for performing operations via the main interfaces of the payment platform correspond to those presented in the diagrams. Similarly, when additional features (such as payment links) are used, scenarios for performing operations also correspond to the specifics of those features.

Purchases by using Payment Page. Channel 1: with redirection of the customer

General information

To process a purchase through Payment Page by using the Promptpay method, the merchant's web service is required to send a request with all required parameters and signature to the ecommpay URL and receive a callback with the result. The full sequence and special aspects of purchase processing are provided below.



Figure: Purchase processing by using Payment Page: step-by-step description

  1. A customer initiates a purchase in the web service.
  2. The web service sends the request for opening Payment Page to the specified ecommpay URL.
  3. The request for opening Payment Page is sent to the payment platform.
  4. The payment platform receives the request and validates the required parameters and signature.
  5. Payment Page is generated based on the project and request parameters.
  6. Payment Page is displayed to the customer.
  7. The customer selects the Promptpay method.
  8. The payment platform receives the request for processing the payment by using the Promptpay method.
  9. The payment platform performs the internal purchase request processing.
  10. The data for redirecting the customer is sent from the payment platform to Payment Page.
  11. The customer is redirected to the provider service.
  12. The customer completes all required payment steps.
  13. The purchase is processed in the provider service.
  14. The customer is redirected to Payment Page.
  15. The provider service sends a notification about the result to the payment platform.
  16. The payment platform sends the payment result callback to the web service.
  17. The payment platform sends the result information to Payment Page.
  18. The result information is displayed to the customer on Payment Page.

Information about the formats of requests and callbacks used for processing payments by using the Promptpay method via Payment Page is presented further in this section; general information about working with the Payment Page API is presented in Interaction concepts.

Request format

There are several things you need to consider when using the Promptpay method:

  1. The following parameters required for any payment must be specified:
    • project_id—project identifier obtained from ecommpay during integration
    • payment_id—payment identifier unique within the project
    • payment_currency—payment currency code in the ISO-4217 alpha-3 format
    • payment_amount—payment amount in the smallest currency unit
    • customer_id—customer identifier unique within the project
  2. The following parameters required for any payment must be specified: project_id, payment_id, payment_currency, payment_amount, customer_id.
  3. The currency of payment can only be THB.
  4. If you need to have the payment form displayed with the Promptpay method selected, set the force_payment_method parameter to promptpay.
  5. Additionally, any other parameters available for working with Payment Page can be used (details).
  6. After all target parameters are specified, generate a signature (details).

Thus, a correct request for opening the payment form using the Promptpay method must contain the project identifier, basic payment information (identifier, amount, and currency code), customer identifier and signature.

{
   "project_id": 120,
   "payment_id": "580",
   "payment_amount": 1000,
   "payment_currency": "THB",
   "customer_id": "customer1",
   "signature": "kUi2x9dKHAVNU0FYldOcZzUCwX6R\/ekpZhkIQg=="
}

Figure: Example of sufficient data in a purchase request

{
   "project_id": 120,
   "payment_id": "580",
   "payment_amount": 1000,
   "payment_currency": "THB",
   "customer_id": "customer1",
   "signature": "kUi2x9dKHAVNU0FYldOcZzUCwX6R\/ekpZhkIQg=="
}

Callback format

The Promptpay method uses the standard format for callbacks to deliver purchase results. For more information, see Callbacks.

The following is the example of a callback with information about a 1000.00 THB purchase made by the 123 customer in the 382 project.

Figure: Example of callback data indicating that the purchase has been processed

{
        "project_id": 382,
        "payment": {
            "type": "purchase",
            "sum": {
                "amount": 100000,
                "currency": "THB"
            },
            "status": "success",
            "method": "promptpay",
            "id": "cfaf576641101077ec3440ffaf476a9d",
            "date": "2020-09-07T12:44:54+0000"
        },
        "customer": {
            "id": "123"
        },
        "operation": {
            "type": "sale",
            "sum_initial": {
                "currency": "THB",
                "amount": 100000
            },
            "sum_converted": {
                "currency": "THB",
                "amount": 100000
            },
            "status": "success",
            "request_id": "057cdba3b2b54b994a5f9c3c4080ff...fdec3b0b0be6b-00089013",
            "provider": {
                "payment_id": "079253339",
                "id": 3351,
                "date": "2020-09-07T04:44:52+0000"
            },
            "message": "Success",
            "id": 89012010009801,
            "date": "2020-09-07T12:44:54+0000",
            "created_date": "2020-09-07T12:42:17+0000",
            "code": "0"
        },
        "signature": "mwiKFBdPKMUEmDieNYeJ...w0R0GGfIBVExvubTbimclPgfx2/CY8Yq+g=="
    }
}

The following is the example of a callback with information about a declined purchase.

Figure: Example of callback data indicating that the purchase has been declined

{
        "project_id": 383,
        "payment": {
            "type": "purchase",
            "sum": {
                "amount": 185384,
                "currency": "THB"
            },
            "status": "decline",
            "method": "promptpay",
            "id": "bde45cdea1ac5c4a75e2d04689a06ad4",
            "date": "2020-09-07T11:01:34+0000"
        },
        "customer": {
            "id": "456"
        },
        "operation": {
            "type": "sale",
            "sum_initial": {
                "currency": "THB",
                "amount": 185384
            },
            "sum_converted": {
                "currency": "THB",
                "amount": 185384
            },
            "status": "decline",
            "request_id": "c7d5631fdd81a4394e85d82...eb70af0e207f1a133-00085510",
            "provider": {
                "payment_id": "079243093",
                "id": 3351,
                "date": "2020-09-07T03:01:32+0000"
            },
            "message": "General decline",
            "id": 85509010009741,
            "date": "2020-09-07T11:01:34+0000",
            "created_date": "2020-09-07T10:09:31+0000",
            "code": "20000"
        },
        "signature": "FEPNq/ijls1WTCdNdz8FD1bM6kWe04AO...Lri/KEHcn/ihMSmzv/cNmQ=="
    }
}

Useful links

The following articles can be useful when implementing purchases via Payment Page:

Purchases by using Payment Page. Channel 2: without redirection of the customer

General information

To process a purchase through Payment Page by using the Promptpay method, the merchant's web service is required to send a request with all required parameters and signature to the ecommpay URL and receive a callback with the result. The full sequence and special aspects of purchase processing are provided below.



Figure: Purchase processing by using Payment Page: Step-by-step description

  1. A customer initiates a purchase in the web service.
  2. The web service sends the request for opening Payment Page to the specified ecommpay URL.
  3. The request for opening Payment Page is sent to the payment platform.
  4. The payment platform receives the request and validates the required parameters and signature.
  5. Payment Page is generated based on the project and request parameters.
  6. Payment Page is displayed to the customer.
  7. The customer selects the Promptpay method.
  8. The request for processing the payment by using the Promptpay method is received by the payment platform.
  9. The payment platform processes the request.
  10. The data for displaying the payment instructions to the customer is sent from the provider service to the payment platform.
  11. The payment instructions are displayed to the customer.
  12. The customer completes all required payment steps.
  13. The purchase is processed in the provider service.
  14. The provider service sends a notification about the result to the payment platform.
  15. The payment platform sends the payment result callback to the web service.
  16. The payment platform sends the result information to Payment Page.
  17. The result information is displayed to the customer on Payment Page.

Information about the formats of requests and callbacks used for processing payments by using the Promptpay method via Payment Page is presented further in this section; general information about working with the Payment Page API is presented in Interaction concepts.

Request format

There are several things you need to consider when using the Promptpay method:

  1. The following parameters required for any payment must be specified:
    • project_id—project identifier obtained from ecommpay during integration
    • payment_id—payment identifier unique within the project
    • payment_currency—payment currency code in the ISO-4217 alpha-3 format
    • payment_amount—payment amount in the smallest currency unit
    • customer_id—customer identifier unique within the project
  2. The following parameters required for any payment must be specified: project_id, payment_id, payment_currency, payment_amount, customer_id.
  3. The currency of payment can only be THB.
  4. If you need to have the payment form displayed with the Promptpay method selected, set the force_payment_method parameter to promptpay.
  5. Additionally, any other parameters available for working with Payment Page can be used (details).
  6. After all target parameters are specified, generate a signature (details).

Thus, a correct request for opening the payment form using the Promptpay method must contain the project identifier, basic payment information (identifier, amount, and currency code), customer identifier and signature.

{
   "project_id": 120,
   "payment_id": "580",
   "payment_amount": 1000,
   "payment_currency": "USD",
   "customer_id": "customer1",
   "signature": "kUi2x9dKHAVNU0FYldOcZzUCwX6R\/ekpZhkIQg=="
}

Figure: Example of sufficient data in a purchase request

{
   "project_id": 120,
   "payment_id": "580",
   "payment_amount": 1000,
   "payment_currency": "USD",
   "customer_id": "customer1",
   "signature": "kUi2x9dKHAVNU0FYldOcZzUCwX6R\/ekpZhkIQg=="
}

Callback format

The Promptpay method uses the standard format for callbacks to deliver purchase results. For more information, see Callbacks.

The following is the example of a callback with information about a 1000.00 THB purchase made by the 123 customer in the 456 project.

Figure: Example of callback data indicating that the purchase has been processed

{
        "project_id": 456,
        "payment": {
            "id": "125",
            "type": "purchase",
            "status": "success",
            "date": "2021-02-15T10:34:21+0000",
            "method": "promptpay",
            "sum": {
                "amount": 100000,
                "currency": "THB"
            },
            "description": ""
        },
        "customer": {
            "id": "123"
        },
        "operation": {
            "id": 76,
            "type": "sale",
            "status": "success",
            "date": "2021-02-15T10:34:21+0000",
            "created_date": "2021-02-15T10:33:59+0000",
            "request_id": "a8ee115e2c7f2f9cd69a743f...c161bf1fcde0-00000001",
            "sum_initial": {
                "amount": 100000,
                "currency": "THB"
            },
            "sum_converted": {
                "amount": 100000,
                "currency": "THB"
            },
            "code": "0",
            "message": "Success",
            "provider": {
                "id": 4821,
                "payment_id": "0123456789",
                "auth_code": "",
                "date": "2021-02-15T10:34:13+0000"
            }
        },
        "signature": "+II2IHZ3IjQcqVsIZ9oYb...atXOn2Czyo7L8g9NN1+WVtR+MGQ=="
    }
}

The following is the example of a callback with information about a declined purchase.

Figure: Example of callback data indicating that the purchase has been declined

{
        "project_id": 321,
        "payment": {
            "id": "ABC456",
            "type": "purchase",
            "status": "decline",
            "date": "2021-03-11T14:01:41+0000",
            "method": "promptpay",
            "sum": {
                "amount": 100000,
                "currency": "THB"
            },
            "description": ""
        },
        "operation": {
            "id": 123456789,
            "type": "sale",
            "status": "decline",
            "date": "2021-03-11T14:01:41+0000",
            "created_date": "2021-03-11T07:07:18+0000",
            "request_id": "09916aa29732a5e59890c409adaa1fd671...ca33-00088600",
            "sum_initial": {
                "amount": 100000,
                "currency": "THB"
            },
            "sum_converted": {
                "amount": 100000,
                "currency": "THB"
            },
            "code": "20000",
            "message": "General decline",
            "provider": {
                "id": 4821,
                "payment_id": "",
                "auth_code": ""
            }
        },
        "signature": "Lk+5aUd6Hp3lR6ZRPXXA0vJ78tdwOrY80kTp...2f1ilyK1bkNrYw=="
    }
}

Useful links

The following articles can be useful when implementing purchases via Payment Page:

Purchases by using Gate. Channel 1: with redirection of the customer

General information

To process a purchase through Gate by using the Promptpay method, the merchant's web service is required to do the following:

  1. Send a request with all the required parameters and signature to the ecommpay URL.
  2. Receive an intermediate callback from the payment platform and redirect the customer to the Promptpay service.
  3. Receive the final callback from the payment platform.

The full sequence and special aspects of purchase processing are provided below.



Figure: Purchase processing by using Gate: step-by-step description

  1. A customer initiates a purchase by using the Promptpay method in the web service.
  2. The web service sends the request for processing the purchase by using Gate to the specified ecommpay URL.
  3. The payment platform receives the request.
  4. The payment platform validates the required parameters and signature in the request.
  5. The payment platform sends the response to the web service with information about the receipt of the request and its validity (details).
  6. The payment platform performs the internal purchase request processing.
  7. The payment platform sends the callback with the redirection data to the web service.
  8. The customer is redirected from the web service to the provider service.
  9. The customer completes all required payment steps.
  10. The purchase is processed in the provider service.
  11. The customer is redirected to the web service.
  12. The provider service sends the payment result notification to the payment platform.
  13. The payment platform sends the payment result callback to the web service.
  14. The customer receives the payment result information from the web service.

Information about the formats of requests and callbacks used for processing payments by using the Promptpay method via Gate is presented further in this section. General information about working with the Gate API is presented in Interaction concepts.

Request format

There are several things you need to consider when sending purchase requests by using the Promptpay method:

  1. To initiate each purchase, send a separate POST request to the /v2/payment/banks/promptpay/sale endpoint. This endpoint belongs to the ]] group /v2/payment/banks/{payment_method}/sale.
  2. Each request must include the following objects and parameters:
    • Object general—general purchase information:
      • project_id—project identifier obtained from ecommpay during integration
      • payment_id—payment identifier unique within the project
      • signature—request signature generated after all required parameters are specified (details—in the Signature generation and verification) (details)
    • Object payment—payment information:
      • amount—payment amount in the smallest currency unit
      • currency—payment currency code in the ISO-4217 alpha-3 format
    • Object customer—customer information:
      • id—customer identifier unique within the project
      • ip_address—customer IP address relevant for the initiated payment
    • Object return_url—URL for redirecting a customer from the provider website:
      • success—URL for redirecting a customer after a processed purchase
  3. The currency of purchase can only be THB.
  4. Additionally, any other parameters included in the specification can be used.

Thus, a correct purchase request by using the Promptpay method must contain the project identifier, basic payment information (identifier, amount, and currency code), customer identifier and IP address, URL for customer redirection, as well as signature.

{
    "general": {
      "project_id": 125,
      "payment_id": "1234567",
      "signature": "GINgwlggTvpF9AnlYc9Mtb3LvE4...JChDjj40xI5vOA7w=="
    },
    "customer": {
      "id": "123",
      "ip_address": "192.0.2.0"
    },
    "payment": {
      "amount": 10000,
      "currency": "THB"
    },
    "return_url": {
      "success" : "http://example.com" 
  }
}

Figure: Example of sufficient data in a purchase request

{
    "general": {
      "project_id": 125,
      "payment_id": "1234567",
      "signature": "GINgwlggTvpF9AnlYc9Mtb3LvE4...JChDjj40xI5vOA7w=="
    },
    "customer": {
      "id": "123",
      "ip_address": "192.0.2.0"
    },
    "payment": {
      "amount": 10000,
      "currency": "THB"
    },
    "return_url": {
      "success" : "http://example.com" 
  }
}

Formats of intermediate callbacks for customer redirection

Each payment made with the Promptpay method requires redirection of customers from the merchant's web service to the Promptpay service. To redirect a customer it is necessary to receive an intermediate callback from the payment platform and use the information included in the redirect_data object. The format of such callbacks is standard (details), and the following objects and parameters are included in the redirect_data object:

  • body—object with data to be sent in the request body
  • method—parameter specifying the HTTP method for sending the request (GET or POST)
  • url—parameter containing a link for redirection

Figure: redirect_data example

    "redirect_data":{
        "url":"http://api.example.biz/MerchantTransfer",
        "method":"POST",
        "body":{
            "Reference":"2000016",
            "Amount": "58.00",
            "Merchant": "M0114",
            "Currency": "THB",
            "Key": "21312434tgdfgdjif",
            "Datetime":"2017-09-19 02:55:00PM",
            "FrontURI": "http://example.com",
            "BackURI": "http://test.example2.com",
            "Bank":"123",
            "Language": "en-us",
            "ClientIP":"183.171.94.142",
            "Customer":"tester77"
            }
         }

Final callback format

The Promptpay method uses the standard format for callbacks to deliver purchase results. For more information, see Callbacks.

The following is the example of a callback with information about a 1000.00 THB purchase made by the 123 customer in the 382 project.

Figure: Example of callback data indicating that the purchase has been processed

{
        "project_id": 382,
        "payment": {
            "type": "purchase",
            "sum": {
                "amount": 100000,
                "currency": "THB"
            },
            "status": "success",
            "method": "promptpay",
            "id": "cfaf576641101077ec3440ffaf476a9d",
            "date": "2020-09-07T12:44:54+0000"
        },
        "customer": {
            "id": "123"
        },
        "operation": {
            "type": "sale",
            "sum_initial": {
                "currency": "THB",
                "amount": 100000
            },
            "sum_converted": {
                "currency": "THB",
                "amount": 100000
            },
            "status": "success",
            "request_id": "057cdba3b2b54b994a5f9c3c4080ff...fdec3b0b0be6b-00089013",
            "provider": {
                "payment_id": "079253339",
                "id": 3351,
                "date": "2020-09-07T04:44:52+0000"
            },
            "message": "Success",
            "id": 89012010009801,
            "date": "2020-09-07T12:44:54+0000",
            "created_date": "2020-09-07T12:42:17+0000",
            "code": "0"
        },
        "signature": "mwiKFBdPKMUEmDieNYeJ...w0R0GGfIBVExvubTbimclPgfx2/CY8Yq+g=="
    }
}

The following is the example of a callback with information about a declined purchase.

Figure: Example of callback data indicating that the purchase has been declined

{
        "project_id": 383,
        "payment": {
            "type": "purchase",
            "sum": {
                "amount": 185384,
                "currency": "THB"
            },
            "status": "decline",
            "method": "promptpay",
            "id": "bde45cdea1ac5c4a75e2d04689a06ad4",
            "date": "2020-09-07T11:01:34+0000"
        },
        "customer": {
            "id": "456"
        },
        "operation": {
            "type": "sale",
            "sum_initial": {
                "currency": "THB",
                "amount": 185384
            },
            "sum_converted": {
                "currency": "THB",
                "amount": 185384
            },
            "status": "decline",
            "request_id": "c7d5631fdd81a4394e85d82...eb70af0e207f1a133-00085510",
            "provider": {
                "payment_id": "079243093",
                "id": 3351,
                "date": "2020-09-07T03:01:32+0000"
            },
            "message": "General decline",
            "id": 85509010009741,
            "date": "2020-09-07T11:01:34+0000",
            "created_date": "2020-09-07T10:09:31+0000",
            "code": "20000"
        },
        "signature": "FEPNq/ijls1WTCdNdz8FD1bM6kWe04AO...Lri/KEHcn/ihMSmzv/cNmQ=="
    }
}

Related topics

The following topics might be useful when implementing payments through Gate:

Purchases by using Gate. Channel 2: without redirection of the customer

General information

To process a purchase through Gate by using the Promptpay method, the merchant's web service is required to do the following:

  1. Send a request with all the required parameters and signature to the ecommpay URL.
  2. Receive an intermediate callback from the payment platform and display the payment instructions to the customer.
  3. Receive the final callback from the payment platform.

The full sequence and special aspects of purchase processing are provided below.



Figure: Purchase processing by using Gate: step-by-step description

  1. A customer initiates a purchase by using the Promptpay method in the web service.
  2. The web service sends the request for processing the purchase by using Gate to the specified ecommpay URL.
  3. The payment platform receives the request.
  4. The payment platform validates the required parameters and signature in the request.
  5. The payment platform sends the response to the web service with information about the receipt of the request and its validity (details).
  6. The payment platform performs the internal payment request processing.
  7. The payment platform sends the callback with the payment instructions data to the web service.
  8. The payment instructions are displayed to the customer.
  9. The customer completes all required payment steps.
  10. The purchase is processed in the provider service.
  11. The provider service sends the payment result notification to the payment platform.
  12. The payment platform sends the payment result callback to the web service.
  13. The customer receives the payment result information from the web service.

Information about the formats of requests and callbacks used for processing payments by using the Promptpay method via Gate is presented further in this section. General information about working with the Gate API is presented in Interaction concepts.

Request format

There are several things you need to consider when sending purchase requests by using the Promptpay method:

  1. To initiate each purchase, send a separate POST request to the /v2/payment/banks/promptpay/sale endpoint. This endpoint belongs to the group /v2/payment/banks/{payment_method}/sale.
  2. Each request must include the following objects and parameters:
    • Object general—general purchase information:
      • project_id—project identifier obtained from ecommpay during integration
      • payment_id—payment identifier unique within the project
      • signature—request signature generated after all required parameters are specified (details—in the Signature generation and verification) (details)
    • Object payment—payment information:
      • amount—payment amount in the smallest currency unit
      • currency—payment currency code in the ISO-4217 alpha-3 format
    • Object customer—customer information:
      • id—customer identifier unique within the project
      • ip_address—customer IP address relevant for the initiated payment
  3. The currency of purchase can only be THB.
  4. Additionally, any other parameters included in the specification can be used.

Thus, a correct purchase request by using the Promptpay method must contain the project identifier, basic payment information (identifier, amount, and currency code), customer identifier and IP address, as well as signature.

{
  "general": {
    "project_id": 210,
    "payment_id": "test_payment",
    "signature": "PJkV8ej\/UG0Di8hTng6JvipTv+AWoXW\/9MTO8yJA=="
  },
  "payment": {
    "amount": 1000,
    "currency": "THB"
  },
  "customer": {
    "id": "customer123",
    "ip_address": "192.0.2.0"
  }
}

Figure: Example of sufficient data in a purchase request

{
  "general": {
    "project_id": 210,
    "payment_id": "test_payment",
    "signature": "PJkV8ej\/UG0Di8hTng6JvipTv+AWoXW\/9MTO8yJA=="
  },
  "payment": {
    "amount": 1000,
    "currency": "THB"
  },
  "customer": {
    "id": "customer123",
    "ip_address": "192.0.2.0"
  }
}

Formats of intermediate callbacks for displaying payment instructions

Each payment made with the Promptpay method requires displaying payment instructions to customers. To display payment instructions it is necessary to receive an intermediate callback from the payment platform and use the information included in the display_data array. The format of such callbacks is standard (details), and the following objects and parameters are included in the display_data array:

  • type—type of data (the value is always qr_img)
  • title—the name of the transferred data that needs to be displayed to the customer (the value is always QR code)
  • data—a string based on which a QR code should be generated on the web service side (according to ISO 18004:2006)

Figure: display_data example

"display_data": [
            {
                "type": "qr_img",
                "title": "QR code",
                "data": "0001101021230620016A000000677010112011505...764540510.005802TH6304XXXX"
            }
]

Final callback format

The Promptpay method uses the standard format for callbacks to deliver purchase results. For more information, see Callbacks.

The following is the example of a callback with information about a 1000.00 THB purchase made by the 123 customer in the 456 project.

Figure: Example of callback data indicating that the purchase has been processed

{
        "project_id": 456,
        "payment": {
            "id": "125",
            "type": "purchase",
            "status": "success",
            "date": "2021-02-15T10:34:21+0000",
            "method": "promptpay",
            "sum": {
                "amount": 100000,
                "currency": "THB"
            },
            "description": ""
        },
        "customer": {
            "id": "123"
        },
        "operation": {
            "id": 76,
            "type": "sale",
            "status": "success",
            "date": "2021-02-15T10:34:21+0000",
            "created_date": "2021-02-15T10:33:59+0000",
            "request_id": "a8ee115e2c7f2f9cd69a743f...c161bf1fcde0-00000001",
            "sum_initial": {
                "amount": 100000,
                "currency": "THB"
            },
            "sum_converted": {
                "amount": 100000,
                "currency": "THB"
            },
            "code": "0",
            "message": "Success",
            "provider": {
                "id": 4821,
                "payment_id": "0123456789",
                "auth_code": "",
                "date": "2021-02-15T10:34:13+0000"
            }
        },
        "signature": "+II2IHZ3IjQcqVsIZ9oYb...atXOn2Czyo7L8g9NN1+WVtR+MGQ=="
    }
}

The following is the example of a callback with information about a declined purchase.

Figure: Example of callback data indicating that the purchase has been declined

{
        "project_id": 321,
        "payment": {
            "id": "ABC456",
            "type": "purchase",
            "status": "decline",
            "date": "2021-03-11T14:01:41+0000",
            "method": "promptpay",
            "sum": {
                "amount": 100000,
                "currency": "THB"
            },
            "description": ""
        },
        "operation": {
            "id": 123456789,
            "type": "sale",
            "status": "decline",
            "date": "2021-03-11T14:01:41+0000",
            "created_date": "2021-03-11T07:07:18+0000",
            "request_id": "09916aa29732a5e59890c409adaa1fd671...ca33-00088600",
            "sum_initial": {
                "amount": 100000,
                "currency": "THB"
            },
            "sum_converted": {
                "amount": 100000,
                "currency": "THB"
            },
            "code": "20000",
            "message": "General decline",
            "provider": {
                "id": 4821,
                "payment_id": "",
                "auth_code": ""
            }
        },
        "signature": "Lk+5aUd6Hp3lR6ZRPXXA0vJ78tdwOrY80kTp...2f1ilyK1bkNrYw=="
    }
}

Related topics

The following topics might be useful when implementing payments through Gate:

Analysis of payments results

To analyse information about payments made with the Promptpay method and other methods, you can use:

  • Dashboard interface toolkit with various lists and analytic panels.
  • Reports in CSV file format, available via the Reports section (one-time and periodically).
  • Data in JSON format, sent by program requests to a specified URL available by using the Data API interface.

If you have any questions, refer to the documentation (Dashboard and Using Data API) and ecommpay technical support.