Environments

Keep sandbox and live traffic fully isolated with environment-bound API keys.

Revenue Guard separates every organization’s data into two environments: sandbox and live. Payers, rules, orders, webhooks, and logs are all scoped to one environment, so test traffic never mixes with production data.

How the environment is chosen

The environment is decided by the credential, not by a request parameter.

  • API callers — the API key is authoritative. A sandbox key reads and writes sandbox data; a live key reads and writes live data. There is no environment header, and there is no way for a key to reach the other environment.
  • Dashboard users — a live/sandbox switcher at the top of the app sets the active environment for your session. Every page (Orders, Payers, Rules, API Keys, Webhooks, Logs) reflects the environment you have selected.

Do not send a separate environment header on API requests. The API key determines sandbox versus live routing on its own.

Key prefixes

Every API key is bound to a single environment when it is created, and its prefix tells you which one:

Key prefixEnvironmentReads / writes
rg_test_SandboxSandbox data only
rg_live_LiveLive data only

Confirming which environment processed a request

Responses that create or update environment-owned resources include two fields you can assert on:

  • environmentsandbox or live.
  • livemodetrue only when the request used a live key.

For example, an order submitted with a sandbox key returns:

1{
2 "environment": "sandbox",
3 "livemode": false
4}
1

Build against sandbox

Develop and test your integration with a rg_test_ key. Seed sandbox payers, submit test orders, and verify your webhook receiver against sandbox deliveries.

2

Verify end to end

Confirm payer lookup, order submission, validation handling, and webhook processing all behave as expected in sandbox.

3

Promote to live

Create a rg_live_ key, swap the credential in your production configuration, and repeat a smoke test. No code changes are required — only the key changes.

Environment switcher
The live/sandbox environment switcher in the dashboard

Need help with a Revenue Guard integration? Contact your CrelioHealth implementation or account team with the endpoint, timestamp, and request trace details.