The gateway has a single contract (the same paths, bodies and errors) across all its deployments. What changes between “testing” and “operating” is the key you call with.

Base URL per environment #

EnvironmentBase URLPython / JS / PHP.NETGo
Productionhttps://api.compense.co"production" (default)CompenseEnvironment.Productioncompense.Production
Sandboxhttps://sandbox.dev.compense.co/gw"sandbox"CompenseEnvironment.Sandboxcompense.Sandbox
Devhttps://gateway.dev.compense.co"dev"CompenseEnvironment.Devcompense.Dev
  • Every path starts with /v1/gateway/..., so the base URL never includes /v1. The sandbox URL keeps the /gw prefix of the sandbox console: the full path is https://sandbox.dev.compense.co/gw/v1/gateway/health/.
  • Production is the URL declared in the contract. There’s no public production deployment yet: the final URL is confirmed during onboarding. If it differs, pass it as a custom base URL (base_url, baseUrl, BaseUrl, WithBaseURL), which always takes precedence over the environment.
  • Dev is Compense’s development gateway, useful for end-to-end testing with real webhooks (with a production key issued for dev).

The key decides, not the URL #

Every key is issued with an environment:

KeyWho respondsMoneyWebhookssandbox.* simulators
sandboxThe simulated, deterministic engine: same request, same response.NoneSimulated ("simulated": true)Allowed
prodYour entity’s real engine.RealReal signed HTTP deliveries403

A sandbox key gets simulated responses at any URL you call, and a production key reaches the real engine. That’s why a configuration mistake (pointing at the sandbox URL with a production key) does not protect you: keep keys separate per environment in your secrets manager and in your CI.

flowchart TD
  R[Your request<br/>X-API-Key: cmp_...] --> G{Key<br/>environment}
  G -- sandbox --> S[Simulated engine<br/>deterministic, no money]
  G -- prod --> M[Tenant's real engine]
  S --> E[Same contract:<br/>paths, envelope and errors]
  M --> E

What the sandbox doesn't simulate

Looking up, matching and loading affiliates read and write the tenant’s real records with any key. Review the test data table before designing your automated tests.

Choosing the environment in code #

from compense_gateway import CompenseClient

sandbox = CompenseClient(api_key=SANDBOX_KEY, environment="sandbox")
dev = CompenseClient(api_key=DEV_KEY, environment="dev")
prod = CompenseClient(api_key=PROD_KEY)  # "production" is the default
otro = CompenseClient(api_key=PROD_KEY, base_url="https://gateway.horizonte.example")

From sandbox to production #

  1. Integrate and automate your tests against the sandbox (credits, wallet, loans, simulated webhooks, clocks and simulators).
  2. Test end to end in dev with real webhooks to a public HTTPS URL in your test environment.
  3. Request the production key and the final URL during onboarding; create your production webhook endpoints (the secret is different) and deploy.
  4. Monitor with client.system.health() and alert on 401/403, 429 and 5xx.