Test mode & sandbox
Every account can build and test end-to-end before going live. Test mode uses a mock Bakong provider, so no real money moves and you control every outcome.
Enabling test mode
Use a bk_test_ key. All resources created with a test key are isolated from live data.
Simulating outcomes
Because there’s no real bank in test mode, drive a payment through its lifecycle with the simulate endpoint:
POST /v1/payments/:id/simulate
curl https://api.paykh.cambobia.com/v1/payments/pay_123/simulate \
-H "Authorization: Bearer bk_test_your_key" \
-H "Content-Type: application/json" \
-d '{ "status": "paid" }'status | Effect |
|---|---|
scanned | Customer opened the QR (fires payment.scanned). |
paid | Payment completes (fires payment.completed). |
failed | Payment fails (fires payment.failed). |
expired | Payment expires (fires payment.expired). |
ℹ️ Webhooks fire in test mode
Simulated transitions dispatch the same webhooks as production — the perfect way to test your webhook handler end-to-end.
Going live
Once your account is activated for Bakong, switch to a bk_live_ key. No code changes are needed beyond the key — the base URL and request shapes are identical. In live mode the simulate endpoint is disabled; real customer scans drive the state instead.