GuidesTest mode
Test KHQR payments without a bank account
You can build and test a full KHQR checkout before connecting any bank account. Create a dk_test_ key in Dalo, create payments exactly as in production, then move each one to paid, expired or failed with the simulate endpoint or the buttons on the checkout page. Your webhook receives real signed events marked livemode: false. No money moves.
1. Get a test key
Sign in at dalodesk.com/app with your email, add a store, open API keys, tick Test key and create it. The key starts with dk_test_. It works right away, before the store is linked or verified.
2. Create a test payment
curl https://dalodesk.com/v1/payments \
-H "Authorization: Bearer $DALO_TEST_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: test_order_1_1" \
-d '{ "amount": "2.50", "reference_id": "test_order_1" }'
The response looks like a live payment with "livemode": false and a placeholder QR that no bank will pay. Open checkout_url: the page shows a TEST MODE banner and three buttons, Simulate scanned, Simulate paid and Simulate expired.
3. Choose the outcome
curl -X POST https://dalodesk.com/v1/payments/pay_T3st.../simulate \
-H "Authorization: Bearer $DALO_TEST_KEY" \
-H "Content-Type: application/json" \
-d '{ "status": "paid" }'
Status can be scanned, paid, expired or failed. Simulating paid behaves exactly like a real payment: approved_at is set, the payment.completed webhook fires and the checkout page redirects to your success URL.
4. Webhooks in test mode
Test events are real deliveries, signed with your endpoint's secret, with livemode: false in the body and X-KHQR-Livemode: false in the headers. Your production handler should acknowledge them with a 2xx and ship nothing.
POST /webhooks/dalo
X-KHQR-Event: payment.completed
X-KHQR-Delivery: del_7KcZ2qa1
X-KHQR-Livemode: true
X-KHQR-Signature: t=1762924212,v1=5d2c…(64 hex characters)
{"id":"evt_3m9Qx1Zb","type":"payment.completed","livemode":true,
"data":{"payment":{"id":"pay_8Qm2kV3xLp9c","status":"paid","amount":"4.50","reference_id":"order_1024", …}}}
5. What to test before going live
- A paid payment marks the order paid once, even if the webhook arrives twice.
- An expired payment lets the customer get a new QR (new
Idempotency-Key). - A tampered body or a signature older than 5 minutes gets a 401.
- The return page shows the real status, not the
?status=from the URL. - Events with
livemode: falseortest: truenever ship goods.
Then link your ABA Payment Link, verify the store in the dashboard, and swap dk_test_ for dk_live_. Nothing else in your code changes.
Step-by-step code: Laravel, Node.js, Next.js, Django, Telegram bot.
Questions
Do test payments count toward my plan?
No. Test payments never count toward plan limits, statistics or revenue, and never send Telegram alerts.
Can a customer pay a test QR by mistake?
No. A test payment carries a placeholder QR that no bank will pay.
Can test keys see live payments?
No. Test keys only see test payments and live keys only see live payments; the other mode's ids return 404.
Get a test key in two minutes.
Sign in with your email, create a store in test mode and copy a dk_test_ key. No merchant application, no paperwork. Free up to 50 sales a month.
More guidesKHQR payment APILaravelNode.jsNext.jsDjangoTelegram botCheck payment statusFlask and FastAPIStatic websiteChoosing an API