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 |
| 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
- Replace
sk_sandbox_withsk_live_in your server environment - Replace
pk_sandbox_withpk_live_in your client-side code - Confirm your account has passed compliance review (Settings → Compliance)
- Update webhook endpoints to your production server URLs
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 — configure each in the dashboard
- Test data is never visible in live mode and vice versa