Activating Test Mode
To switch to the test environment, click the Test Mode toggle on the top navbar of your dashboard.
Using Test Mode in Code
When building your integration, you’ll need to configure your code to use Test Mode. Here’s how to do it across different SDKs:- Next.js
- TypeScript SDK
- Better Auth
- REST API
Use the For production, use an environment variable:
testMode parameter when creating checkouts:API Endpoints
Creem uses separate API endpoints for test and production environments:| Environment | Base URL |
|---|---|
| Production | https://api.creem.io |
| Test Mode | https://test-api.creem.io |
API Keys
Test and production environments use different API keys. You can find both keys in the Developers section. Make sure to toggle Test Mode in the navigation bar.Testing Payments
Use these test card numbers to simulate different payment scenarios:All test card numbers work with any future expiration date, any CVV, and any billing information.
| Card Number | Behavior |
|---|---|
4242 4242 4242 4242 | Successful payment |
4000 0000 0000 0002 | Card declined |
4000 0000 0000 9995 | Insufficient funds |
4000 0000 0000 0127 | Incorrect CVC |
4000 0000 0000 0069 | Expired card |
Webhook Testing
When in Test Mode, webhook events are sent to your test webhook URL. This allows you to:- Test your webhook endpoint locally using tools like ngrok
- Verify webhook signature validation
- Ensure your event handlers work correctly
Learn More About Webhooks
Set up webhooks to receive real-time payment notifications.
Switching to Production
When you’re ready to go live:1
Complete Testing
Verify all payment flows work correctly in Test Mode
2
Update API Keys
Replace test API keys with production API keys in your environment variables
3
Update API Endpoint
Ensure your code uses
https://api.creem.io or disable testMode flag4
Configure Production Webhooks
Register your production webhook URL in the live dashboard
5
Create Production Products
Switch to production mode in the dashboard and create your live products
6
Monitor First Transactions
Watch your first few production transactions carefully to ensure everything works as expected