API keys and test mode
Create and roll sk_test and sk_live keys, and test your integration in the sandbox with test cards.
Every cashbox has two independent environments: Test and Live. The key decides the mode: everything created with an sk_test_… key lives in test mode, with sk_live_… — in live mode.
Test vs. live
| Test | Live | |
|---|---|---|
| Key | sk_test_… |
sk_live_… |
| Money | No real money moves | Charged to a real card, credited to the cashbox balance |
| Access | Works before the cashbox is approved (email verified, cashbox not blocked) | Approved, active cashbox only; the IP allowlist applies |
expires_in |
300–86,400 seconds, default 1,800 | 300–900 seconds, default 900 |
The modes are fully isolated: a test key can't see live objects and vice versa.
Create a key
- Open Developers and select your cashbox.
- Switch to the mode you need (Switch to test mode or Back to live mode). In test mode a "Test mode — no real money" bar is shown at the top.
- On the API keys page, optionally enter a name and click Create key.
- Copy the key right away — it won't be shown again.
Roll and revoke
- Roll — a new key is created and the old one stops working after 24 hours.
- Cancel (revoke) — the key stops working immediately.
Key statuses: Active, Rolled, Expired, Cancelled.
Never put your secret key in browser code, a mobile app or a public repository — keep it on your server only. If a key leaks, roll it right away.
Sandbox and test cards
The checkout_url of a payment created with a test key opens the sandbox checkout page. No real card or money is used there.
| Card number | Result |
|---|---|
| 8600 0000 0000 0001 | Succeeds (Uzcard) |
| 9860 0000 0000 0001 | Succeeds (Humo) |
| 8600 0000 0000 0002 | failed, code insufficient_funds |
| 8600 0000 0000 0003 | failed, code card_declined |
| 8600 0000 0000 0004 | failed, code expired_card |
- Expiry — any future date (e.g.
12/30). - The SMS code is always
111111. After 3 wrong codes the payment becomesfailed(otp_attempts_exceeded). - Any other number shows a "This is not a test card" error.
For automated tests without a browser (sk_test_ keys only, pending payments only):
POST /api/v3/test_helpers/payments/{id}/succeed
POST /api/v3/test_helpers/payments/{id}/fail
Test payments and events are listed under Developers → Test payments and Events. Every API request is shown on the Request log page.
Going live
Once everything works and your cashbox is approved, swap the sk_test_ key for an sk_live_ key — no code changes needed.