Test vs Live Mode
The one rule
The key you use determines the mode. No other flag, header, or environment variable is needed:
sk_sandbox_.../pk_sandbox_...→ test modesk_live_.../pk_live_...→ live mode
What’s different in test mode
| Aspect | Test mode | Live mode |
|---|---|---|
| PSP calls | Mocked — no real processing | Real PSP calls |
| Cards accepted | Test card numbers only | Real cards |
| Data isolation | Separate from live data | Separate from test data |
| Webhooks | Fire with test events | Fire with live events |
| Time | Can be simulated with test clocks | Real time only |
| API responses | Identical shape | Identical shape |
What’s the same
- Same API endpoints
- Same request and response structure
- Same webhook event format and delivery
- Same error codes and response shapes
- Same status transitions
Switching to live
Sandbox and live are two paired accounts, not two modes of one account. Getting a live account and getting it activated is the bulk of the work:
- Create the live account. In the dashboard, go to Settings → Manage Accounts and use Promote to Live on your sandbox account. This creates the paired live account
- Complete onboarding. The new live account’s dashboard shows a Continue onboarding banner. It opens the onboarding application — business details, beneficial owners, supporting documents, and terms acceptance
- Wait for the review decision. The onboarding application shows the current status once submitted, including when the review team needs more from you. Approval activates the account and the banner disappears
- Swap keys. Replace
sk_sandbox_withsk_live_in your server environment andpk_sandbox_withpk_live_in your client-side code, using the keys from the live account under Developer → API keys - Register your production webhook endpoint. Ask support to add it against the live account — sandbox subscriptions do not carry over
Keeping environments separate
- Store sandbox keys in
.env.developmentand live keys in.env.production - Never mix test and live keys in the same application instance
- Use separate webhook endpoints for test and live events — each account has its own subscriptions, registered by support
- Test data is never visible in live mode and vice versa