Skip to main content
Paygentic provides two separate environments to support your development workflow: Sandbox and Live. This allows you to test your integration thoroughly before going to production.

Environment Overview

Sandbox Environment

Test your integration without affecting real data or processing actual payments

Live Environment

Production environment for real customers and actual payment processing

Sandbox Environment

The sandbox environment is a complete, fully-functional replica of the live environment where you can test your integration without any risk.

Accessing Sandbox

Key Features

  • Same Login Credentials: Use the same email and password as your live environment account
  • Isolated Data: All data is completely separated from the live environment
  • Unique IDs: All resource IDs (customers, subscriptions, products, etc.) are unique to sandbox
  • Feature Parity: Sandbox has complete feature parity with the live system
  • Test API Keys: API keys are prefixed with sk_test_ and only work in sandbox
While you use the same login credentials for both environments, all data, API keys, and resource IDs are completely separate between sandbox and live.

When to Use Sandbox

Use the sandbox environment to:
  • Test your integration during development
  • Validate new features before deploying to production
  • Experiment with pricing models and configurations
  • Train team members on the platform
  • Debug issues without affecting real customers
  • Run automated integration tests
Test Data Only: The sandbox environment is exclusively for testing purposes. Never add real user data, personal information, or production customer data to sandbox. Always use synthetic test data only.

Live Environment

The live environment is your production environment where real transactions occur.

Accessing Live

Key Features

  • Production Data: Real customers and actual payment processing
  • Live API Keys: API keys are prefixed with sk_live_ and only work in live
  • Real Payments: All transactions process actual payments

API Keys and Environments

API keys are environment-specific and identified by their prefix:
EnvironmentAPI Key PrefixExample
Sandboxsk_test_sk_test_abc123...
Livesk_live_sk_live_xyz789...

Key Restrictions

  • Sandbox keys (sk_test_) can only be used with https://api.sandbox.paygentic.io
  • Live keys (sk_live_) can only be used with https://api.paygentic.io
  • Using a key with the wrong environment will result in authentication errors
Sandbox API Request
curl -H "Authorization: Bearer sk_test_YOUR_API_KEY" \
  https://api.sandbox.paygentic.io/v0/products
Live API Request
curl -H "Authorization: Bearer sk_live_YOUR_API_KEY" \
  https://api.paygentic.io/v0/products

Best Practices

Development Workflow

  1. Develop in Sandbox: Build and test your integration in sandbox first
  2. Use Environment Variables: Store API keys and base URLs in environment variables
  3. Automated Testing: Run integration tests against sandbox in your CI/CD pipeline
  4. Validate Changes: Test all changes in sandbox before deploying to live
  5. Monitor Both Environments: Set up monitoring for both environments

Security Considerations

  • Never commit API keys to version control
  • Use separate API keys for each environment
  • Rotate keys regularly in both environments
  • Restrict live API keys to production servers only
  • Use sandbox keys for local development and testing

Switching Between Environments

To switch between environments:
  1. Update API Key: Use the appropriate sk_test_ or sk_live_ key
  2. Update Base URL: Point to the correct API endpoint
  3. Verify Environment: Check that you’re working with the intended environment before making changes
Add environment indicators to your application’s admin panel or logs to clearly show which environment you’re working with.

Data Synchronization

Data is not synchronized between sandbox and live environments. Each environment maintains its own independent database.
When moving from sandbox to live:
  • You’ll need to recreate products, plans, and pricing configurations in live
  • Customer data must be created fresh in live
  • Usage events and billing history are separate in each environment
  • API keys and webhooks must be configured separately
Important: Never copy real customer data or personal information from live to sandbox. Sandbox should only contain synthetic test data. Similarly, never use production customer data for testing purposes.

Troubleshooting

Wrong API Key for Environment

Error Response
{
  "error": "Unauthorized",
  "message": "Invalid API key"
}
Solution: Verify you’re using the correct API key prefix (sk_test_ for sandbox, sk_live_ for live) and the matching API base URL.

Data Not Found in New Environment

If you’re switching from sandbox to live and can’t find your data, remember that environments are completely isolated. You need to recreate your configuration in the new environment.

Testing Payments in Sandbox

Sandbox environment uses test payment credentials that simulate real payment flows without processing actual charges. Contact support@paygentic.io for test payment credentials.