Create a request
Pass merchant and transaction details through the typed generator.
SDK / 1.1 Bakong payment infrastructure
Generate compliant KHQR payment codes and validate live Bakong transactions from one focused TypeScript toolkit.
Static and dynamic KHQR strings with typed payment data.
Decode payloads and validate CRC integrity before use.
Query Bakong by MD5 or short hash to confirm payment.
QUICK START Minimal surface area
Strong types, explicit results, and no framework lock-in. Move from installation to a scannable code in minutes.
pnpm add @manethpak/khqr-sdk import { createKHQR } from '@manethpak/khqr-sdk'
const khqr = createKHQR({
baseURL: 'https://api-bakong.nbc.gov.kh',
authToken: process.env.BAKONG_TOKEN
})
const payment = khqr.qr.generateKHQR({
bakongAccountID: 'coffee@aclb',
merchantName: 'Tonlé Coffee',
merchantCity: 'Phnom Penh',
amount: 24000,
currency: 'KHR'
})
console.log(payment.result?.qr)
console.log(payment.result?.md5) PAYMENT LOOP Three clear steps
Pass merchant and transaction details through the typed generator.
Render the EMV payload at checkout or in your own interface.
Use the returned hash to query payment status through Bakong.
Ready to test the full loop?