Receive KHQR payments inside your own app.
Paste your ABA Payment Link, get an API key. No merchant application, no paperwork. Free up to 50 sales a month.
You build on a computer. Send this page to yourself and pick it up there.
API documentation
Quick startAuthenticationCreate a paymentRetrieve & listCancelStatusesWebhooksHosted checkoutErrorsGet your ABA Payment LinkGoing liveAI assistantMore: test mode, usage, QR behaviour, busy shops, branches
Quick start
Create a payment from your server, send the customer to checkout_url (or show qr_image_url yourself), then wait for the payment.completed webhook or poll the payment until status is paid.
No bank link yet? Add a store in test mode, create a dk_test_ key and build the whole flow with simulated payments. Connect the ABA Payment Link when you are ready to go live.
curl https://dalodesk.com/v1/payments \
-H "Authorization: Bearer dk_live_..." \
-H "Idempotency-Key: order_1024" \
-H "Content-Type: application/json" \
-d '{ "amount": "1.50", "currency": "USD", "reference_id": "order_1024",
"success_url": "https://shop.example/orders/1024" }'
201 Created
{
"id": "pay_8Qm2…",
"status": "pending",
"amount": "1.50",
"currency": "USD",
"reference_id": "order_1024",
"store_id": "store_…",
"branch": null,
"checkout_url": "https://dalodesk.com/pay/pay_8Qm2…?t=…",
"qr_image_url": "https://dalodesk.com/api/public/payments/pay_8Qm2…/qr.svg",
"expires_at": "2026-10-09T05:19:00.000Z",
"created_at": "2026-10-09T05:09:00.000Z",
"qr_string": "00020101021230510016abaakhppxxx@abaa…6304A1B2",
"deeplink": { "ios": "https://dpayment-epreprod.ababank.com/deep-link?type=payway&qrcode=…", "android": "intent://ababank.com?type=payway&qrcode=…#Intent;package=com.paygo24.ibank;…;scheme=abamobilebank;end;" }
}
Each QR stays open for 5 minutes by default; the store can choose 1–30 minutes in its settings, and a single payment can set its own lifetime with expires_in (seconds). expires_at is exact. Creating a payment takes about a second. Send the buyer to checkout_url exactly as returned: it carries a short token that lets the page cancel the order; without it the page is view-only. Show qr_image_url for scanning, or render qr_string yourself; on the customer's own phone, send them to deeplink.ios or deeplink.android to open ABA Mobile with the QR pre-filled.
Step-by-step guides with tested code: Laravel, Node.js, Next.js, Django, Telegram bot and test mode.
Build with an AI assistant
Dalo is small enough for an AI coding assistant to integrate in one sitting. Three steps:
- Copy the prompt for your stack. It is a complete brief: every endpoint, field, status and error code, webhook signature verification, redirect handling and the security rules, plus framework-specific instructions. Generated from the same source as this page.
- Paste it into your assistant (Claude Code, Cursor, Copilot, ChatGPT, Windsurf…) inside your project and let it build the three pieces: the server-side create-payment step, the webhook handler and the return page.
- Test, then go live. Create a test API key (
dk_test_) and a webhook endpoint in the dashboard, run your flow end to end with simulated payments (see Test mode), then swap in a live key and run the $0.01 store verification.
Preview the prompt
Loading…Agents that can browse can read llms-full.txt (the full reference as plain text), llms.txt or openapi.json directly.
Authentication
Every store has its own API keys. Create one in the dashboard under API & webhooks; it is shown once. Send it as a bearer token:
Authorization: Bearer dk_live_… # real payments
Authorization: Bearer dk_test_… # test mode: simulated payments, no money
Keys belong to one store, so payments created with a key are always for that store's ABA account. Never put a key in browser or mobile app code; call Dalo from your server. Revoke a key from the dashboard if it leaks.
Create a payment
POST /v1/payments
| Field | Required | Notes |
|---|---|---|
amount | yes | 0.01 to 10000, at most two decimals. String or number. |
currency | no | Must be USD (the store's settlement currency). Defaults to USD. |
reference_id | no | Your order id, up to 255 characters. Shown on the checkout page and in webhooks. |
expires_in | no | Seconds the QR stays open, 60 to 1800 (30 minutes). Defaults to the store's QR lifetime. The returned expires_at is exact. |
success_url | no | HTTPS URL (or a relative path). The checkout page redirects here about 2 seconds after the payment is confirmed. |
metadata | no | Any JSON object you want back in the payment and in webhooks. |
branch | no | A branch id (br_…) of the store, see Branches. Defaults to the API key's branch, if the key is bound to one; otherwise the payment is store-wide. |
The response includes livemode: true for a dk_live_ key, false for a dk_test_ key (see Test mode).
Idempotency. Send an Idempotency-Key header (or idempotency_key field) with a value unique to the order. Repeating the same request returns the original payment with 200 instead of creating a second QR. Without a key, asking again for the same reference_id and amount while its QR is still open also returns that payment with 200, so a page refresh or a double click never makes a second QR. Another order gets its own QR; for a fresh QR on the same order, use a new reference_id.
One at a time per store. If a QR is still being generated for the same store you get 409 payment_creation_in_progress with a Retry-After header. Wait and retry.
Retrieve and list
GET /v1/payments/{id}
GET /v1/payments?status=paid&limit=50 # newest first, limit up to 100
GET /v1/payments?branch=br_… # one branch only
Polling every 2–3 seconds is fine while a checkout is open. For anything else use webhooks. A key only ever sees payments of its own mode: a live key gets 404 for a test payment and vice versa.
Cancel
POST /v1/payments/{id}/cancel
Only pending or scanned payments can be cancelled; otherwise you get 409 payment_not_cancellable. Cancelling does not reverse money that has already been paid.
Payment statuses
| Status | Meaning |
|---|---|
pending | QR created, waiting for the customer. |
scanned | ABA shows the QR was scanned. The customer still has to confirm in their app. Not proof of payment. |
paid | Money arrived. ABA displayed the payment as paid with the expected merchant, amount and currency. Fulfil the order only on this status. |
expired | The QR's lifetime (5 minutes by default) passed without payment. Create a new payment to try again. |
failed | ABA showed a paid page that did not match the expected merchant, amount or currency. Check your ABA app before fulfilling anything. |
cancelled | Cancelled by you (API or dashboard) or by the customer on the checkout page. |
status_source tells you what set the status (for example aba_confirmed, expiry_worker or simulated_paid in test mode). approved_at is set when the payment became paid.
Webhooks
Add an HTTPS endpoint per store in the dashboard. You get a signing secret once (whsec_…). Dalo sends a POST for every status change:
| Event | When |
|---|---|
payment.scanned | QR scanned, not yet paid |
payment.completed | Paid and verified — the only event that should trigger fulfilment |
webhook.test | Sample event sent from the dashboard's Send test button; data.payment.test is true. Never fulfil on it |
payment.expired | Timed out |
payment.failed | Paid page did not match |
payment.cancelled | Cancelled |
POST https://shop.example/webhooks/dalo
X-KHQR-Event: payment.completed
X-KHQR-Delivery: del_…
X-KHQR-Livemode: true
X-KHQR-Signature: t=1760000000,v1=5f8a…
{ "id": "evt_…", "type": "payment.completed", "created": "2026-10-09T05:10:12.000Z", "livemode": true,
"data": { "payment": { "id": "pay_8Qm2…", "status": "paid", "livemode": true, "amount": "1.50",
"branch": { "id": "br_7Qx2", "name": "Riverside" }, … } } }
Test payments send the same events with "livemode": false and X-KHQR-Livemode: false, signed with the same secret. Use them to test your handler; fulfil only when livemode is true.
Verify the signature
Compute HMAC-SHA256 over t + "." + rawBody with your secret and compare it to v1 in constant time. Reject if t is more than 5 minutes old.
// Node.js (Express with raw body)
import crypto from "node:crypto";
function verify(rawBody, header, secret) {
const m = /^t=(\d+),v1=([a-f0-9]{64})$/.exec(header || "");
if (!m) return false;
if (Math.abs(Date.now() / 1000 - Number(m[1])) > 300) return false;
const expected = crypto.createHmac("sha256", secret).update(`${m[1]}.${rawBody}`).digest("hex");
return crypto.timingSafeEqual(Buffer.from(expected, "hex"), Buffer.from(m[2], "hex"));
}
app.post("/webhooks/dalo", express.raw({ type: "application/json" }), (req, res) => {
if (!verify(req.body, req.get("X-KHQR-Signature"), process.env.DALO_WEBHOOK_SECRET)) return res.sendStatus(401);
const event = JSON.parse(req.body);
if (event.type === "payment.completed" && event.livemode === true) fulfil(event.data.payment.reference_id, req.get("X-KHQR-Delivery"));
res.sendStatus(200);
});
Retries and duplicates. Reply with any 2xx within 8 seconds. Otherwise Dalo retries after 5 s, 30 s, 2 min, 10 min and 1 hour, then marks the delivery as dead-lettered (you can retry it from the dashboard). Retries reuse the same X-KHQR-Delivery id, so store it and ignore repeats.
Hosted checkout
checkout_url opens a mobile-friendly page with the QR, the store name and the amount. It refreshes itself every few seconds, shows "Payment received" when paid, and redirects to success_url if you set one. Customers can cancel from the page when a success_url is present.
If you prefer your own page, embed qr_image_url (an SVG image) and poll GET /v1/payments/{id} from your server.
For a test payment the page shows a TEST MODE banner, a greyed-out placeholder QR and Simulate scanned / paid / expired buttons; redirects and polling behave exactly as for a live payment.
Errors
Errors return a JSON body with error (a stable code) and message (for humans).
| HTTP | error | What to do |
|---|---|---|
| 400 | invalid_amount, invalid_expires_in, invalid_success_url, unsupported_currency, invalid_metadata, invalid_status | Fix the request. |
| 401 | unauthorized | Missing, revoked or wrong API key. |
| 402 | plan_limit_reached | The store's plan limit for this month is used up. Upgrade in the dashboard. |
| 403 | store_not_active, store_disabled, account_suspended, test_mode_only | Finish store verification; the store was removed; contact support; or use a dk_test_ key to simulate. |
| 404 | payment_not_found, branch_not_found | Wrong id, or the payment belongs to another store or to the other mode (live vs test); or the branch is not one of this store's. |
| 409 | payment_creation_in_progress, payment_not_cancellable, payment_not_simulatable, store_not_linked, branch_not_active | Retry after the Retry-After seconds; the payment already ended; the store has no ABA link yet; or the branch's own link still needs its $0.01 verification. |
| 503 | provider_unavailable, provider_busy | The payment service is temporarily unavailable. Retry in a few seconds; show the customer a "try again" message. |
| 502 | provider_error | The QR could not be created. Retry once, then report it. |
Get your ABA Payment Link
To go live, Dalo needs the public Payment Link of the ABA account you want paid. It looks like https://link.payway.com.kh/ABAPAYx…. Money goes straight to that ABA account; Dalo never holds it and never asks for a password, PIN or OTP.
- Open ABA Merchant → Payments → Payment Link (sometimes shown as ABA PAY link).
- Create a link for this store and choose USD.
- Tap Share → Copy link.
- In the dashboard, open your store, paste the link and press Check link. Dalo reads the merchant name from ABA.
- Press Verify and pay the $0.01 QR from ABA Mobile. The store goes live within seconds.
If something goes wrong:
- "Paste the full ABA Payment Link": copy it with Share → Copy link. A screenshot, a KHQR image or an account number will not work.
- The $0.01 check expired: open the store and press Verify again; each check gives a fresh QR.
- The merchant name is not the one you expected: Dalo shows the name ABA has for that link. Make the link from the ABA account you want paid.
Stuck? Message @dalodeskbot on Telegram and we will do it with you. Until then you can build everything in test mode.
Going live checklist
- Build and test with a
dk_test_key (Test mode): simulated payments, real webhooks, no money. - Verify the store with the $0.01 test in the dashboard (the live API returns
403 store_not_activeuntil then). - Create an API key for the store and keep it on your server.
- Add a webhook endpoint, store the secret, and verify signatures.
- Fulfil orders only on
payment.completed/status: "paid"withlivemode: true, never onscannedor on a test event. - Redirects: set a success and failure URL per store in Settings, or pass
success_urlper payment. The checkout appends?status=paid|expired|failed|cancelled&payment_id=…&reference_id=…. Treat the redirect as a hint only; confirm with the webhook orGET /v1/payments/{id}. - Handle
503and409with a retry and a friendly message. - Reconcile against your ABA app or statement for disputes; Dalo reports what ABA displays and is not the bank's ledger. If money arrives for a payment Dalo shows as
expiredorcancelled, use Mark paid in the dashboard.
More
Everything below is optional. The sections above are enough to take a payment.
Test mode
Test mode works like Stripe's: a test key (dk_test_…) uses every endpoint in this document, but every payment it creates is simulated. No ABA QR is generated, no money can move, and nothing it does counts toward your plan, your stats or the revenue in the dashboard. Test payments do fire webhooks, signed exactly like live ones, so you can test your handler end to end before a single cent moves. Test keys work even before the store is verified.
- Get a test key. Dashboard → your store → API keys → tick Test key → Create key. It starts with
dk_test_. - Create payments as usual.
POST /v1/paymentswith the test key returns the normal payment object with"livemode": false,"provider": "test", a 3-minuteexpires_atand a workingcheckout_url/qr_image_url(a placeholder KHQR; banking apps will not pay it). - Choose the outcome. Either call the simulate endpoint, or open
checkout_url: the page shows a TEST MODE banner and the buttons Simulate scanned, Simulate paid, Simulate expired.
POST /v1/payments/{id}/simulate
Authorization: Bearer dk_test_…
Content-Type: application/json
{ "status": "paid" } # or "scanned", "expired", "failed"
→ 200 { "id": "pay_…", "status": "paid", "livemode": false, "status_source": "simulated_paid", … }
Simulation is allowed only for test payments and only with a test key of the same store: a live key gets 403 test_mode_only; a payment that already ended gets 409 payment_not_simulatable; an unknown status gets 400 invalid_status. A payment left alone expires by itself after 3 minutes and sends payment.expired.
Telling live from test. Every payment object carries livemode (true or false). Every webhook event carries livemode at the top level and in data.payment, plus the header X-KHQR-Livemode: true|false. Fulfil orders only when livemode is true and the event is payment.completed.
Isolation. Live keys never see test payments and test keys never see live ones: GET, list and cancel are filtered by mode, and the other mode's ids return 404 payment_not_found. Idempotency keys are scoped per mode too. The dashboard shows both, with a Test badge and a Test filter in Payments. Test payments never send Telegram "Payment received" messages.
Usage and quota
GET /v1/usage returns where the account stands this calendar month: the same numbers that decide whether a create call is accepted. Quota is pooled across all stores of the account, so every key returns the same figures. Only paid live payments count; expired, cancelled and test payments never do.
{
"plan": "free", "limit": 50, "used": 12, "remaining": 38,
"period_start": "2026-10-01T00:00:00.000Z", "period_end": "2026-11-01T00:00:00.000Z",
"stores": { "used": 1, "limit": 1 }
}
When remaining is 0, creating a live payment returns 402 plan_limit_reached until the next month or an upgrade.
How the QR behaves
- Every payment has its own QR. Two customers with open QRs for the same amount never get mixed up: paying one marks only that payment
paid. expires_atis when the QR stops being accepted. 5 minutes by default, 1 to 30 minutes per store in Settings, or per payment withexpires_in.
Busy shop?
Many customers paying at the same time works: every order gets its own QR. A few habits keep checkout fast and avoid "try again" messages at rush hour.
- Create the payment when the customer taps "Pay", not when the cart or checkout page opens. QRs made before the customer has decided mostly expire unpaid, and each one uses the same Payment Link capacity as a real sale.
- Give slow payers more time. Raise the QR lifetime in Settings (up to 30 minutes), or send
expires_infor one payment. Fewer QRs expire while the customer is still in their banking app. - Ask again for the same order instead of making a new one. Repeating the request with the same
reference_idand amount (or the sameIdempotency-Key) while its QR is open returns that QR, so a refresh or a double tap costs nothing. - Handle
503with itsRetry-After. In a rush, new QRs on one Payment Link are made one after another, about 1.5 seconds apart; a request that would wait too long gets503 provider_unavailablewith the seconds to wait. Show "one moment" and retry after that time. - Very busy? Use branches with their own Payment Link. Each branch with its own link (its own ABA account) has its own capacity, so tills or counters on different links do not wait on each other. Branches that share the store's link share its capacity.
Limits per store: at most 25 unpaid QRs created in the last 10 minutes, and 300 open in total. Paid, expired and cancelled QRs stop counting at once. Per API key: 60 new payments a minute.
Branches
A store is one shop. If the shop has several branches, add them in the dashboard (Settings → Branches, up to 20 per store; they do not count toward your plan's store limit). Each branch either shares the store's ABA Payment Link or has its own link (a separate ABA account, verified once with a $0.01 payment like the store), and either shares the store's Telegram chat or has its own. The Telegram "Payment received" message names the branch.
- Route a payment to a branch with
"branch": "br_…"inPOST /v1/payments, or bind an API key to a branch in the dashboard so every payment it creates defaults to that branch (an explicitbranchstill wins). A branch with its own link gets its QR on that link; a branch sharing the store's link gets the store's QR. - Every payment carries
"branch": { "id": "br_…", "name": "Riverside" }ornull, in API responses and in webhookdata.payment. List one branch withGET /v1/payments?branch=br_…; the dashboard filters and the CSV export have a branch column. - Errors:
404 branch_not_foundfor an id outside this store,409 branch_not_activewhile the branch's own link is unverified (test keys are exempt).
Questions? Message @dalodeskbot on Telegram, we answer there. See also the Terms of Service and Privacy Policy.