BakongPay
API Reference
Generate Bakong KHQR payment codes, verify transactions, and build payment flows — all through a single REST API.
Bearer Auth
API key based
5 endpoints
REST / JSON
5 SDKs
JS, Python, PHP…
Rate limited
Per plan
https://khpay.angkorhub.site/api/v1/khqr/createCreates a Bakong-compliant KHQR QR code with a signed transaction ID, MD5 hash, and Base64 PNG image ready for display.
Request Body
Payment amount · e.g. 25
USD or KHR · default: USD
Merchant display name (max 25 chars) · e.g. FINN SHOP
Bakong account ID · e.g. merchant@acleda
Order reference (max 100 chars) · e.g. Order #1234
QR expiry time in seconds · default: 900
Responses
{
"success": true,
"data": {
"transactionId": "uuid-...",
"qrString": "000201...",
"qrImage": "data:image/png;base64,...",
"md5": "a1b2c3d4...",
"deepLink": "bakong://pay?qr=...",
"checkoutUrl": "https://app.../pay/uuid",
"expiresAt": "2026-06-02T14:00:00Z"
}
}curl -X POST https://khpay.angkorhub.site/api/v1/khqr/create \
-H "Authorization: Bearer bk_live_..." \
-H "Content-Type: application/json" \
-d '{
"amount": 25.00,
"currency": "USD",
"merchantName": "FINN SHOP",
"bakongId": "merchant@acleda",
"description": "Order #1234"
}'/api/v1/check/md5Polls the Bakong NBC network for the payment status of a given MD5 hash. Use this after generating a KHQR to confirm payment.
Request Body
32-char hex MD5 from KHQR creation · e.g. a1b2c3d4e5f67890a1b2c3d4e5f67890
Responses
{
"success": true,
"data": {
"md5": "a1b2...",
"status": "SUCCESS",
"transaction": {
"hash": "0x...",
"from": "sender@bank",
"to": "merchant@acleda",
"amount": 25.00,
"currency": "USD",
"timestamp": 1748865600000
}
}
}curl -X POST https://khpay.angkorhub.site/api/v1/check/md5 \
-H "Authorization: Bearer bk_live_..." \
-H "Content-Type: application/json" \
-d '{ "md5": "a1b2c3d4e5f67890a1b2c3d4e5f67890" }'/api/v1/check/bulk Pro+Check up to 50 MD5 hashes in a single request. Ideal for reconciliation jobs. Requires Pro or Enterprise plan.
Request Body
Array of MD5 hashes (max 50)
Responses
{
"success": true,
"data": {
"total": 2,
"results": {
"a1b2...": { "status": "SUCCESS" },
"c3d4...": { "status": "PENDING" }
}
}
}curl -X POST https://khpay.angkorhub.site/api/v1/check/bulk \
-H "Authorization: Bearer bk_live_..." \
-H "Content-Type: application/json" \
-d '{ "md5s": ["a1b2c3...", "d4e5f6..."] }'/api/v1/check/transactionLook up a stored transaction by its ID, MD5, or blockchain hash.
Request Body
The value to search for
Lookup type · default: transactionId
Responses
curl -X POST https://khpay.angkorhub.site/api/v1/check/transaction \
-H "Authorization: Bearer bk_live_..." \
-H "Content-Type: application/json" \
-d '{
"query": "uuid-...",
"type": "transactionId"
}'/api/v1/qr/generateRender a custom-styled QR image from any KHQR string. Supports custom colors and sizes in PNG or SVG.
Request Body
KHQR payload string
Image size in px (100–2000) · default: 300
Foreground hex color · default: #000000
Background hex color · default: #FFFFFF
Output format · default: png
Responses
curl -X POST https://khpay.angkorhub.site/api/v1/qr/generate \
-H "Authorization: Bearer bk_live_..." \
-H "Content-Type: application/json" \
-d '{
"qrString": "000201...",
"size": 400,
"foreground": "#1a1a2e",
"background": "#ffffff",
"format": "png"
}'