Sandbox

Every workspace has a sandbox where you can build and test without moving real money. It runs on simulated chains and serves the same operations, with the same request and response shapes, as live. Code you write against the sandbox runs unchanged in live.

Keys and base URL

Switching to the sandbox only takes a different key. Use a sandbox key, which starts with sk_sbx_, against the same base URL as live:

A sandbox request
curl "https://api.stridge.com/v2/deposits" \
  -H "Authorization: Bearer $STRIDGE_SANDBOX_KEY"

The key alone decides the environment. Create sandbox keys in the dashboard. Unlike a live key, a sandbox key's secret can be revealed again there. See Environments and Authentication.

A sandbox key calls the same operations as a live key, with two differences:

  • Test helpers work only with a sandbox key. See Test helpers.
  • Webhook endpoint configuration (listing, reading, creating, updating and deleting endpoints, and rotating their secrets) is served to live keys only. Calling one with a sandbox key returns 404 operation_not_served, and a sandbox key cannot be created with webhook.read or webhook.write. Manage sandbox endpoints in the dashboard instead. A sandbox key with webhook.deliver can still ping and re-enable them. See Webhooks.

Telling sandbox data apart

Check livemode before you write anything to a live system. Every object a sandbox request returns carries "livemode": false, and live objects carry true. Sandbox webhook events carry livemode: false too.

On an endpoint created before thin events, the event body also carries the sandbox's environment_id and a reset_epoch: the sandbox's reset count when the attempt was sent. An event with a lower reset_epoch than the sandbox's latest describes data that a reset has since deleted.

What is simulated

The sandbox behaves like live, but nothing in it is worth anything:

  • Chains. The sandbox's networks are simulated chains. GET /v2/sandbox/test-helpers/options lists the networks your sandbox simulates and the assets on each. A helper aimed at any other network returns 404 network_not_simulated.
  • Prices. Quotes and USD amounts use real market prices.
  • Money. Nothing on a simulated chain has value, and nothing leaves the sandbox. Deposits arrive only when you simulate them.

Test helpers

Test helpers make things happen that would otherwise need a real chain or days of waiting:

  • a deposit arriving at an address;
  • a payout succeeding, failing or being held;
  • a webhook endpoint failing.

They exist only in the sandbox. Calling one with a live key returns 404 environment_not_sandbox.

A test helper callCall a test helper with a sandbox key and an Idempotency-Key. The sandbox spends one simulation from its hourly budget and simulates the deposit or payout on a simulated chain. It then sends the same webhook events a real flow would, each with livemode: false.
USERYour server
PLATFORMStridge sandbox
ON-CHAINSimulated chain
POST a test helper · sk_sbx_ key · Idempotency-Key
Starts a simulation from the hourly budget
Simulates the deposit or payout
201 Created
The same webhook events as live · livemode: false
Call a test helper with a sandbox key and an Idempotency-Key. The sandbox spends one simulation from its hourly budget and simulates the deposit or payout on a simulated chain. It then sends the same webhook events a real flow would, each with livemode: false.
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

The helpers follow these rules:

Idempotency

400header_invalid

Every helper that simulates a deposit or drives a payout requires an Idempotency-Key. Without one, it returns 400 header_invalid. A retry with the same key returns the first result and uses nothing from the budget. The webhook endpoint helper accepts a key but does not require one. See Idempotency.

Permissions

403permission_denied

Each helper needs a permission on the key:

A call from a key without the permission returns 403 permission_denied.

Budget

429simulation_budget_exhausted

Each sandbox can start 600 simulations per clock hour, shared by every key and person working in it. The options' budget shows what is left. Once it is spent, the helpers return 429 with simulation_budget_exhausted and a Retry-After header until the next hour begins.

Webhooks

A simulation sends the same webhook events a real flow would, such as deposit.confirmed, uda.settlement.completed or payout.failed, to your sandbox webhook endpoints.

For presets such as an underpaid or wrong-network deposit, and for worked examples, see the test helpers guide.

Resets

Reset your sandbox from the dashboard to start over with a clean slate. A reset:

  • deletes everything in the sandbox, including routing policies and treasuries;
  • keeps its API keys, webhook endpoints and signing secrets.

While a reset runs, requests with that sandbox's keys return 409 environment_resetting. A sandbox nobody uses for 30 days is reset automatically. See Sandbox resets.

Sandbox explorer

Transactions, addresses and blocks on the simulated chains exist only in Stridge, so public block explorers cannot find them. Look them up in the sandbox explorer (opens in a new tab) instead. The dashboard opens the explorer signed in to your workspace, and the scanner_url on sandbox deposits links straight to it.

scanner_url is an empty string when no explorer is available for a transaction. Render the link only when the field is non-empty.