QR API

Base URL: https://checkout-sandbox.payway.com.kh/Copy to clipboard
POST
  • Support both online/instore merchant
  • Supported payment options
  • Transaction currency KHR: ABA PAY, KHQR
  • Transaction curency USD: ABA PAY, KHQR, WeChat and Alipay

Request

Header Params
stringrequired

Example: application/json

Body Params application/json

stringrequired

Request date and time in UTC format as YYYYMMDDHHmmss.

stringrequired

A unique merchant key which provided by ABA Bank.

<= 30 characters
stringrequired

This is the unique transaction ID that identifies the transaction.

<= 20 characters
stringoptional

Payer's first name.

<= 20 characters
stringoptional

Payer's last name.

<= 20 characters
stringoptional

Payer's email address.

<= 50 characters
stringoptional

Payer's phone number.

<= 20 characters
numberrequired

The total transaction amount must be at least 100 KHR or 0.01 USD and cannot be null.

stringrequired

Supported transaction currencies: KHR and USD. Not case-sensitive.

<= 3 characters
stringoptional

Supported values: pre-auth and purchase. If the merchant does not provide a value, the default will be purchase.

Note: Alipay & WeChat do not support pre-auth.

<= 20 characters
stringrequired

Supported payment options:

  • abapay_khqr : Payway will response ABA KHQR.
  • wechat : PayWay will respond with a WeChat QR (only for USD transactions).
  • alipay : PayWay will respond with an Alipay QR (only for USD transactions).
<= 20 characters
stringoptional

A Base64-encoded JSON array describing the items being purchased. It supports up to 50 line items with no character limit.

Note: This is only description/remark. The price or quantity in this info will not be used for calculation or any validation purposes

PHP Sample Code

$items = base64_encode('[
    {"name":"Item 1","quantity":1,"price":1.00},
    {"name":"Item 2","quantity":1,"price":4.00}
]');
<= 500 characters
stringoptional

URL to receive callbacks upon payment completion, encrypted with Base64.

PHP Sample Code

$callback_url = base64_encode('YOUR CALL BACK URL');
<= 255 characters
stringoptional

PHP Sample Code

$return_deeplink = base64_encode('{"android_scheme": "{YOUR ANDROID SCHEME}", "ios_scheme":"{YOUR IOS SCHEME}"}');
<= 255 characters
stringoptional

Additional custom fields to attach to the QR, encrypted with Base64.

PHP Sample Code

$custom_fields = base64_encode('{"Province":"ABC", "Province": "Male" }');
<= 255 characters
stringoptional

Additional information to include in the pushback once the payment is completed.

PHP Sample Code

$return_params = '{"key_1": "Value 1","key_2": "Value 2"}';
stringoptional

Payout instructions in a Base64-encoded JSON string.

PHP Sample Code

$payout = base64_encode('[
    {"account":"201030101","amount":1.72},
    {"account":"012538302","amount":1.72}
]');
<= 255 characters
integerrequired

Transaction lifetime in minutes. Default: 30 days.

  • Minimum: 3 mins
  • Maximum: 120 days
stringrequired

The QR image comes with various options to suit your needs. Please refer to the link below for details templates.

<= 20 characters
stringrequired

Base64 encode of hash hmac sha512 encryption of concatenated values req_time, merchant_id, tran_id, amount, items, first_name, last_name, email, phone, purchase_type, payment_option, callback_url, return_deeplink, currency, custom_fields, return_params, payout, lifetime, and qr_image_template

PHP Sample Code

// public key provided by ABA Bank
$api_key = 'API KEY PROVIDED BY ABA BANK';

// Prepare the data to be hashed
$b4hash = $req_time . $merchant_id . $tran_id . $amount . $items . $first_name . $last_name . $email
. $phone . $purchase_type . $payment_option . $callback_url . $return_deeplink . $currency .
$custom_fields . $return_params . $payout . $lifetime . $qr_image_template;

// Generate the HMAC hash using SHA-512 and encode it in Base64
$hash = base64_encode(hash_hmac('sha512', $b4hash, $api_key, true));

Example

{
  "req_time": "",
  "merchant_id": "",
  "tran_id": "",
  "first_name": "",
  "last_name": "",
  "email": "",
  "phone": "",
  "amount": "",
  "currency": "",
  "purchase_type": "",
  "payment_option": "",
  "items": "",
  "callback_url": "",
  "return_deeplink": "",
  "custom_fields": "",
  "return_params": "",
  "payout": "",
  "lifetime": "",
  "qr_image_template": "",
  "hash": ""
}
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R

Responses