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

ParameterTypeDescription
amount *NumberTransaction amount (e.g., 10.50)
bakongid *StringYour Bakong Account ID
merchantname *StringMerchant display name
usernameStringOptional 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

ParameterLocationDescription
tran_id *PathUnique Transaction ID (8 chars)
bakongid *QueryYour 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

ParameterLocationDescription
md5 *QueryThe 32-character MD5 hash of the KHQR
bakongid *QueryYour Bakong Account ID

Response Example

JSON
{
  "responseCode": 0,
  "responseMessage": "Success",
  "data": {
    "status": "SUCCESS",
    "amount": 25.50,
    "hash": "94kd8231...a1"
  }
}