Environments

Every Stridge workspace has a sandbox, and once it goes live, a live environment too. Both use one base URL and one API, so you build against the sandbox and switch to live by changing the key.

The sandbox and live environments compared
PropertySandboxLive
ExistsSandbox
In every workspace
Live
Once the workspace goes live
Secret keySandbox
sk_sbx_…
Live
sk_live_…
Publishable keySandbox
pk_sbx_…
Live
pk_live_…
Base URLhttps://api.stridge.com/v2 for both. The key decides the environment.
ChainsSandbox
Simulated chains
Live
Real chains
MoneySandbox
Deposits, settlements and payouts behave as they do in live but never move real value
Live
Settles on real chains with real funds. A payout that has been broadcast cannot be taken back
livemodeSandbox
false
Live
true
Use it forSandbox
Development, tests and the docs Try it console
Live
Production traffic that moves real money

The key decides

You never pick an environment in the request: the key you send decides it. A sandbox key always acts in your sandbox, and a live key always acts in live. No header, query parameter or path changes that.

Note

Send the key on its own. If you also send X-Stridge-Environment, the request fails with 400 header_invalid (environment header not accepted).

Keep the base URL and swap the key:

curl "https://api.stridge.com/v2/payouts" \
  -H "Authorization: Bearer $STRIDGE_SANDBOX_KEY"

Reading livemode

livemode tells you which environment any payload came from: true for live, false for a sandbox. Every resource and every event carries it. When your code needs to know where a response, a stored payload or a webhook event came from, read livemode rather than inferring it from anything else.

Which payloads carry livemode and environment_id
What you readlivemodeenvironment_id
A resource, such as a deposit, a payout or a webhook endpointlivemode
Carried
environment_id
Carried, beside it
A thin event, as the Events API returns it and as an endpoint created through /v2receives itlivemode
Carried
environment_id
Not carried
Reference data, such as networks and priceslivemode
Not carried
environment_id
Not carried

A resource also carries the environment_id it belongs to. A thin event carries livemode alone. Reference data belongs to no environment and carries neither.

What differs

Code written against the sandbox runs unchanged in live, because request and response shapes are the same in both. What differs is the money, set out in the comparison above, and which operations each environment's keys can call.

Live keys only

Managing webhook endpoints with a key is available to live keys only. That covers listing, reading, creating, updating and deleting endpoints, and rotating their signing secret.

  • Calling one of these with a sandbox key returns 404 operation_not_served (this operation is served to live keys only).
  • A sandbox key cannot be given webhook.read or webhook.write.
  • Set up a sandbox's endpoints in the dashboard instead. A sandbox key can still ping and re-enable them.
OperationPermission
List webhook endpointsGET/webhook-endpointswebhook.readwebhook.read
Create a webhook endpointPOST/webhook-endpointswebhook.writewebhook.write
Get a webhook endpointGET/webhook-endpoints/{endpoint_id}webhook.readwebhook.read
Update a webhook endpointPATCH/webhook-endpoints/{endpoint_id}webhook.writewebhook.write
Delete a webhook endpointDELETE/webhook-endpoints/{endpoint_id}webhook.writewebhook.write
Rotate a webhook endpoint's signing secretPOST/webhook-endpoints/{endpoint_id}/rotate-secretwebhook.writewebhook.write

Sandbox keys only

The test helpers under /v2/sandbox/ let you drive a flow end to end. They simulate deposits, payouts and a failing webhook endpoint, and read back the simulations. Calling one with a live key returns 404 environment_not_sandbox (not a sandbox environment). See Sandbox.

OperationPermission
Read what the test helpers acceptGET/sandbox/test-helpers/optionssimulation.readsimulation.read
Simulate a deposit to a deposit addressPOST/sandbox/test-helpers/uda/depositssandbox.simulatesandbox.simulate
Simulate a deposit to a vaultPOST/sandbox/test-helpers/vault/depositssandbox.simulatesandbox.simulate
Simulate a deposit to an address the environment holdsPOST/sandbox/test-helpers/address/depositssandbox.simulatesandbox.simulate
Simulate a payoutPOST/sandbox/test-helpers/payoutspayout.createpayout.create
Release a held payoutPOST/sandbox/test-helpers/payouts/{payout_id}/releasepayout.createpayout.create
Fail a held payoutPOST/sandbox/test-helpers/payouts/{payout_id}/failpayout.createpayout.create
List the environment's simulationsGET/sandbox/simulationssimulation.readsimulation.read
Read one simulationGET/sandbox/simulations/{simulation_id}simulation.readsimulation.read
Move a sandbox endpoint's failing_since backPOST/sandbox/test-helpers/webhook-endpoints/{endpoint_id}/failing-sincewebhook.deliverwebhook.deliver

Retries and resets

Two more behaviours differ between the environments:

  • Webhook retries. For an endpoint created through /v2, live retries a failed delivery over about 72 hours, and the sandbox over about 2 hours 35 minutes. See Webhooks.
  • Resets. You can reset a sandbox in the dashboard. A reset deletes its data and keeps its keys and webhook endpoints. While it runs, every request for that sandbox returns 409 environment_resetting. Live is never reset.

The Try it console

The Try it console on every operation page starts in Sandbox, so you can experiment without touching real money.

  • Choosing Production asks you to confirm, and asks again after every reload, so you never send a live request by accident.
  • Both modes call api.stridge.com. The key you paste decides where the request acts.
  • The console refuses to send a live key under Sandbox, or a sandbox key under Production.