Skip to content

Chapter 2 · API integration

API keys and test mode

Create and roll sk_test and sk_live keys, and test your integration in the sandbox with test cards.

2 min read

On this page
  1. Test vs. live
  2. Create a key
  3. Roll and revoke
  4. Sandbox and test cards
  5. Going live

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

  1. Open Developers and select your cashbox.
  2. 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.
  3. On the API keys page, optionally enter a name and click Create key.
  4. 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 becomes failed (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.

Was this article helpful?

Didn’t find an answer?

Send a request — a specialist will check your account and reply.