Environments

Capera provides separate environments so you can build and test safely before handling real money.

Available environments

EnvironmentBase URLPurpose
Productionhttps://api.withcapera.com/b2bLive transactions with real money
Staginghttps://staging-api.withcapera.com/b2bIntegration 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 prefixEnvironment
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:

  1. Swap the API key (sk_test_ → sk_live_)
  2. Update the base URL to https://api.withcapera.com/b2b
  3. 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"]
}

Did this page help you?