QR API
POST
/api/payment-gateway/v1/payments/generate-qr
Request
Header Params
Content-Type
string
required
Example:
application/json
Body Params application/json
req_time
string
required
merchant_id
string
required
<= 30 characters
tran_id
string
required
<= 20 characters
first_name
string
optional
<= 20 characters
last_name
string
optional
<= 20 characters
email
string
optional
<= 50 characters
phone
string
optional
<= 20 characters
amount
number
required
currency
string
required
KHR
and USD
. Not case-sensitive.<= 3 characters
purchase_type
string
optional
pre-auth
and purchase
. If the merchant does not provide a value, the default will be purchase
.<= 20 characters
payment_option
string
required
abapay
: PayWay will respond with a proprietary ABA QR, which can only be scanned and paid via ABA Mobile.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
items
string
optional
PHP Sample Code
<= 500 characters
callback_url
string
optional
<= 255 characters
return_deeplink
string
optional
<= 255 characters
custom_fields
string
optional
<= 255 characters
return_params
string
optional
payout
string
optional
<= 255 characters
lifetime
integer
required
hash
string
required
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
Example
{
"req_time": "20250312095439",
"merchant_id": "oldme",
"tran_id": "20250311033231",
"first_name": "ABA",
"last_name": "Bank",
"email": "aba.bank@gmail.com",
"phone": "012345678",
"amount": 0.01,
"purchase_type": "purchase",
"payment_option": "abapay_khqr",
"items": null,
"currency": "USD",
"callback_url": "aHR0cHM6Ly9hcGkuY2FsbGJhY2suY29tL25vdGlmeQ==",
"return_deeplink": null,
"custom_fields": null,
"return_params": null,
"payout": null,
"lifetime": 6,
"qr_image_template": "template1",
"hash": "ZyDmMe/kznbY2e...ZB6tMnqv57V06T13du8807dcbPTg=="
}
Request samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/api/payment-gateway/v1/payments/generate-qr' \
--header 'Content-Type: application/json' \
--data-raw '{
"req_time": "20250312095439",
"merchant_id": "oldme",
"tran_id": "20250311033231",
"first_name": "ABA",
"last_name": "Bank",
"email": "aba.bank@gmail.com",
"phone": "012345678",
"amount": 0.01,
"purchase_type": "purchase",
"payment_option": "abapay_khqr",
"items": null,
"currency": "USD",
"callback_url": "aHR0cHM6Ly9hcGkuY2FsbGJhY2suY29tL25vdGlmeQ==",
"return_deeplink": null,
"custom_fields": null,
"return_params": null,
"payout": null,
"lifetime": 6,
"qr_image_template": "template1",
"hash": "ZyDmMe/kznbY2e...ZB6tMnqv57V06T13du8807dcbPTg=="
}'
Responses
🟢200Success
application/json
Body
qr_string
string
required
qr_image
string
required
abapay_deeplink
string
required
app_store
string
required
abapay_deeplink
and the payer does not have ABA Mobile installed, you can redirect the user to the app store to download ABA Mobile.play_store
string
required
abapay_deeplink
and the payer does not have ABA Mobile installed, you can redirect the user to the play store to download ABA Mobile.amount
number
required
currency
string
required
status
object
required
code
string
required
0
: Success.1
: Wrong Hash.6
: Requested Domain is not in whitelist.8
: Something went wrong. Please reach out to our digital support team for assistance12
: Payment currency is not allowed.16
: Invalid First Name. It must not contain numbers or special characters or not more than 100 characters.17
: Invalid Last Name. It must not contain numbers or special characters or not more than 100 characters.18
: Invalid Phone Number.19
: Invalid Email.21
: End of API lifetime.23
: Selected Payment Option is not enabled for this Merchant Profile.32
: Service is not enable.35
: Payout Info is invalid.44
: Purchase amount has reached transaction limit.47
: KHR Amount must be greater than 100 KHR.48
: Something went wrong with requested parameters. Please try again or contact the merchant for help.96
: Invalid merchant data102
: The URL is not in the whitelist.403
: Duplicated Transaction ID429
: You've reached the maximum attempt limit. Please try again in (min)message
string
required
code
for the details.tran_id
string
required
trace_id
string
required
Example
{
"qrString": "00020101021230510016abaakhppxxx@abaa01151250212145328460208ABA Bank52048249530384054040.015802KH5925OLD ME 25 CHAR WINNER IP",
"qrImage": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAACgCAYAAACLz2ctAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAOC0lEQVR4nO2deahV1RfHl6ZlaaZ",
"abapay_deeplink": "abamobilebank://ababank.com?type=payway&qrcode=00020101021230510016abaakhppxxx%40abaa01151250212145328460208ABA+Bank5",
"app_store": "https://itunes.apple.com/al/app/aba-mobile-bank/id968860649?mt=8",
"play_store": "https://play.google.com/store/apps/details?id=com.paygo24.ibank",
"amount": 0.01,
"currency": "USD",
"status": {
"code": "0",
"message": "Success.",
"tran_id": "20250311033231",
"trace_id": "b9f93f45b49f08e26dfcfb8c2da396c6"
}
}