Skip to main content
The SandboxService class (accessed via client.sandbox) is developer tooling for the sandbox (test) environment: reset test data in one call, fast-forward time so time-dependent behavior fires immediately, and replay a webhook without recreating the underlying record. Each removes a manual setup step from a test run, so the run can start from a known state.
Every Sandbox method requires a secret test key (tybrite_sk_test_*). Publishable keys and live keys are rejected with 403. These operations only ever touch your sandbox data — your live data and store configuration are never affected.

Methods

resetSandbox

Wipe all of your store’s sandbox test data immediately — orders, customers, carts, wishlists, returns, store credits, reviews, messages, analytics events, webhook events, and more — instead of waiting for the automatic 30-day cleanup. Returns 204 No Content.
deleteSandboxData (mapped to DELETE /v1/sandbox/data) is an exact alias if you prefer a DELETE:

advanceSandboxTime

Fast-forward your sandbox by a number of days so time-dependent behavior happens now. It back-dates your sandbox abandoned carts, stock reservations, and analytics events, then runs the expiry/rollup jobs — so abandoned-cart windows elapse, reserved stock is released, and analytics roll forward, without waiting. The response reports what was shifted and what was intentionally left alone.
Subscription trials/renewals are real account state and are not time-shifted; promotions and gift cards aren’t shifted either — to test their expiry, create one in sandbox with a near-future date. The not_shifted object explains each.

replaySandboxWebhook

Re-send a previously-recorded sandbox webhook event to all your matching, enabled webhook endpoints — so you can re-test your handler without recreating the order/customer/etc. Identify the event by event_id, or by type to replay the most recent sandbox event of that type. The original event is unchanged.

Response Codes