Skip to content

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 mode
  • sk_live_... / pk_live_... → live mode

What’s different in test mode

AspectTest modeLive mode
PSP callsMocked — no real processingReal PSP calls
Cards acceptedTest card numbers onlyReal cards
Data isolationSeparate from live dataSeparate from test data
WebhooksFire with test eventsFire with live events
API responsesIdentical shapeIdentical 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

  1. Replace sk_sandbox_ with sk_live_ in your server environment
  2. Replace pk_sandbox_ with pk_live_ in your client-side code
  3. Confirm your account has passed compliance review (Settings → Compliance)
  4. Update webhook endpoints to your production server URLs

Keeping environments separate

  • Store sandbox keys in .env.development and 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