Fluid Payments.
Authentication
Bakong-api uses simple ID-based authorization. Include your bakongid in every request to identify your merchant account and authorize transactions.
Parameter
bakongid: "your_account@wing"
Create KHQR
Generate a unique transaction string and QR code data for customer payment.
GET
/khqr/create
Request Parameters
| Parameter | Type | Description |
|---|---|---|
amount * | Number | Transaction amount (e.g., 10.50) |
bakongid * | String | Your Bakong Account ID |
merchantname * | String | Merchant display name |
username | String | Optional identifier for tracking |
Successful Response
JSON
{
"qr": "https://api.bakong-api.online/qr/YvJXiLoT",
"md5": "f2bb7310df261ab64e13fc397b0b86f0",
"tran": "YvJXiLoT"
}
View QR Image
Directly render the KHQR as a PNG image for your frontend mobile or web view.
GET
/qr/:tran_id
Replace :tran_id with the tran value received from the Create endpoint.
Check Status
Verify if a specific transaction has been completed successfully by the customer.
GET
/check/:tran_id
Request Parameters
| Parameter | Location | Description |
|---|---|---|
tran_id * | Path | Unique Transaction ID (8 chars) |
bakongid * | Query | Your Bakong Account ID |
Response Example
JSON
{
"responseCode": 0,
"responseMessage": "Success",
"data": {
"status": "SUCCESS",
"amount": 10.00,
"hash": "83jhd7234...f2"
}
}
Check by MD5
Verify payment status using the MD5 hash generated during the creation process. This is useful for secondary verification logic.
GET
/check_by_md5?md5={hash}&bakongid={id}
Request Parameters
| Parameter | Location | Description |
|---|---|---|
md5 * | Query | The 32-character MD5 hash of the KHQR |
bakongid * | Query | Your Bakong Account ID |
Response Example
JSON
{
"responseCode": 0,
"responseMessage": "Success",
"data": {
"status": "SUCCESS",
"amount": 25.50,
"hash": "94kd8231...a1"
}
}