Test and live mode
Every account has two modes, test and live, and both work at the same time. You build and try things in test mode, your players use live mode, and neither can see or change the other.
The key decides the mode
There is one API address for both modes. Each request goes to test mode or live mode depending on the key it carries:
| Environment | Address | Key |
|---|---|---|
test | https://api.predixum.net | pmk_test_* |
live | https://api.predixum.net | pmk_live_* |
Say you run a staging copy of your site next to your production site. Staging holds a pmk_test_ key and production holds a pmk_live_ key. Both call the same address with the same code. A bet placed on staging lands in test mode and settles there. A bet placed in production lands in live mode. You never switch a setting or change a URL to move between them; you only choose which key a server holds.
A test key cannot reach live data and a live key cannot reach test data. Asking for something that belongs to the other mode returns 404 not_found, the same answer as for something that does not exist.
Keys that start with pmk_sandbox_ were issued before test mode existed. They are test keys and keep working, on the same address. New test keys start with pmk_test_.
What each mode has of its own
Each mode keeps its own:
- API keys
- users and their balances
- positions, orders and transactions
- settlements, the GGR on your dashboard, reconciliation and reports
- webhook address and webhook signing secret
- realtime connections, because the token comes from a key of that mode
- widget sessions, because your server mints them with a key of that mode
Test mode trades the same markets as live mode, and test positions settle when the real market resolves. A test position moves only the prices of your own test mode, never a live price. Rate limits count separately in each mode.
What the two modes share
Some things belong to your account, not to a mode. You set them once and both modes use them:
- the account name and currency
- branding, the logo and the widget look
- the media library, the images that your branding and market cards use
- the markets you offer: you enable them once for the account, and a test key cannot add a market of its own
- the markets you propose to us, and their review
- allowed widget origins, so list the origins of both your test site and your production site
- terminology
- feature settings
- your team and their roles
- support tickets
- commercial terms and billing
Billing covers live mode only. Test mode is never billed. Test trading still counts for the currency lock: once your account has positions in either mode, its currency is fixed.
Webhooks in each mode
Every webhook body carries livemode: true for a live event, false for a test event. Test events go only to your test address, signed with your test secret. Live events go only to your live address, signed with your live secret.
Verify each delivery with the secret of the mode that endpoint serves, then check livemode before you act on the body. The Webhook guide has the code.
The tenant portal
The top bar of the tenant portal has a Test mode switch. It changes what the data screens show: the dashboard, users, positions, transactions, reports and reconciliation. Until live access is approved, the portal opens in test mode.
Settings > API & Webhooks works differently. It always shows Test and Live side by side, whatever the switch says. Each side has its own keys, webhook address and signing secret, so you can set up both without switching back and forth. Account settings such as your team, branding and support look the same in both modes.
Going live
A new account starts with the status pending. You can issue test keys straight away and build your whole integration in test mode.
Live keys come after we approve live access. Before that, asking for a live key returns 409 live_access_not_approved. To approve, we need two things from live mode: a webhook address and a webhook signing secret. Set both in Settings > API & Webhooks, on the Live side. The Go-live checklist lists what you must show in test mode first.
When we approve, your account status becomes live and your first live key is issued. Nothing happens to test mode: your test keys keep working and your test data stays.
Delete all test data
To start test mode again from an empty account, choose Delete all test data in the tenant portal while it is in test mode. The owner or an admin of your account can do this.
Afterwards test mode is empty: no users, balances, positions, orders, transactions or reports. Your test keys, your test webhook address and secret and your account settings carry over, so your test integration keeps working against the empty account. Live mode is never touched.
Nothing is erased from our records. We keep the old test data, but no screen and no key reaches it any more. You cannot bring it back into view, so treat the deletion as final.