Environments
Capera provides separate environments so you can build and test safely before handling real money.
Available environments
| Environment | Base URL | Purpose |
|---|---|---|
| Production | https://api.withcapera.com/b2b | Live transactions with real money |
| Staging | https://staging-api.withcapera.com/b2b | Integration testing — no real money |
Always build against staging first. The staging environment behaves identically to production — same endpoints, same request/response shapes, same webhook events — but no real funds are moved.
API keys per environment
Each environment uses a different API key. Keys are scoped to the environment they were generated in and will not work cross-environment.
| Key prefix | Environment |
|---|---|
sk_test_ | Staging |
sk_live_ | Production |
Generate your keys from Settings → API Keys in the Capera dashboard.
# Staging
export CAPERA_API_KEY="sk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# Production
export CAPERA_API_KEY="sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"Never commit API keys to version control. Store them in environment variables or a secrets manager.
Switching environments
The only change required when moving from staging to production is:
- Swap the API key (
sk_test_→sk_live_) - Update the base URL to
https://api.withcapera.com/b2b - Register a new webhook subscription with
"environment": "production"
Everything else — request structure, response format, endpoint paths — stays the same.
Webhook environments
Webhook subscriptions are environment-scoped. A subscription registered with "environment": "sandbox" only receives events triggered by staging API keys, and a "production" subscription only receives events from live keys. Register separate subscriptions for each environment.
{
"url": "https://your-server.com/webhooks/staging",
"events": ["transfer.success", "deposit.success"],
"environment": "sandbox"
}{
"url": "https://your-server.com/webhooks/production",
"events": ["transfer.success", "deposit.success"],
"environment": "production"
}Checking your environment
Use the version endpoint to confirm which environment you are talking to:
curl https://staging-api.withcapera.com/b2b/version{
"version": "v1.0.0",
"apiVersion": "v1",
"environment": "staging",
"features": ["customers", "virtual-accounts", "transfers", "deposits", "rate-limiting", "request-tracing"]
}Updated 4 months ago