Skip to content

Sandboxes

A sandbox is an isolated test copy of your merchant account, with its own orders, customers, catalog, webhook endpoints, settings, and request logs. Test requests go to the same https://api.withflintpay.com/v1/... routes as live ones. The flint_test_... key you send decides which sandbox handles the request: each test key is bound to one sandbox when it's issued, and that binding never changes. Test-mode responses name the sandbox in the Flint-Sandbox-Id header.

Use these routes to give CI, QA, or a partner demo data of its own, to start a sandbox over with clean data, and to issue test keys for a sandbox. The Sandboxes & test mode guide covers test mode end to end, including a per-run CI setup.

The default sandbox and the sandboxes you create#

Every merchant has one default sandbox, named Default Test, with is_default: true. Flint creates it with the account. It can be reset and stays the default afterward, but it can't be archived, so use it for long-lived development and put disposable work in sandboxes you create.

A sandbox you create with POST /v1/sandboxes starts empty, with no catalog, customers, or webhook endpoints. Its name must be unique among your active sandboxes, or the request returns 409 ALREADY_EXISTS. Send issue_test_key: true with the key's access, and scopes when access is restricted, to get a key bound to the new sandbox in the same response. test_key_name defaults to the sandbox name followed by Test Key. access, scopes, and test_key_name are accepted only with issue_test_key: true. The key's secret_key appears only in that response; see responses with one-time secrets.

Flint sets up test card payments in each new sandbox, which takes a short time. Before the first card payment, call GET /v1/merchant with a key bound to that sandbox and wait for readiness.payments.status to be ready. Testing shows the check.

To rehearse onboarding instead, create the sandbox with initial_onboarding: "not_started". Flint then doesn't verify its test account: requirements stay due, and readiness reports onboarding_not_started with the create_merchant_account_session action until you onboard the sandbox. initial_onboarding defaults to complete, every response echoes it, and a reset returns the sandbox to it; see Create a sandbox.

Who can manage sandboxes#

A live credential can call every route here for any of the merchant's sandboxes. A test credential (a test key, a sandbox CLI login, or a sandbox workload token) can get and reset only the sandbox it's bound to: any other sandbox_id returns 404 RESOURCE_NOT_FOUND, whether or not that sandbox exists, and listing, creating, and archiving return 403 FORBIDDEN with details[0].reason live_mode_required. During API-first setup, the onboarding session token can also call them.

ToThe credential needsTest credentials
List sandboxesdeveloper.sandboxes.read or developer.sandboxes.writeNot allowed
Get a sandboxdeveloper.sandboxes.read or developer.sandboxes.writeIts own sandbox only
Reset a sandboxdeveloper.sandboxes.writeIts own sandbox only
Create or archive a sandboxdeveloper.sandboxes.writeNot allowed
Issue a test key, on either routedeveloper.sandboxes.write and accounts.api_keys.write, plus every scope a restricted key grantsSee issue a key

Both sandbox scopes are available to live and test keys, and full-access keys of either mode hold them; read-only keys hold developer.sandboxes.read.

Granting full or read_only access to a new key takes a full-access live key or a freshly verified user session; see credentials that can mint keys. With an onboarding session token, only a merchant owner or admin can create, reset, or archive sandboxes. Other users get 403 FORBIDDEN with reason merchant_role_insufficient.

Status#

status on sandbox
Final values do not change again
  • active
    Keys bound to it authenticate. You can issue keys for it and reset it, and archive it unless it's the default sandbox.
  • archivedFinal
    Archived. Every key bound to it returns 401 INVALID_CREDENTIAL with reason revoked. You can still read it with GET /v1/sandboxes/{sandbox_id}, but nothing brings it back.

GET /v1/sandboxes leaves archived sandboxes out unless the status filter names archived.

Reset or archive#

Reset (POST /v1/sandboxes/{sandbox_id}/reset) deletes a sandbox's data and keeps the sandbox: its ID, name, keys, and webhook endpoints stay the same. Archive (DELETE /v1/sandboxes/{sandbox_id}) retires the sandbox and frees its name.

ResetArchive
ReturnsThe same sandbox, active, with a new updated_atThe archived sandbox
sandbox_id and nameKeptID kept; name freed for a new sandbox
DataDeletedKept but unreadable, except after a stopped reset, when both sets of data are deleted
Test keys and other credentialsKeep workingRevoked
Webhook endpointsKept, with the same IDs and signing secretsStop delivering
Test card paymentsStill set up when initial_onboarding is complete; set up again through onboarding when it's not_startedNot applicable

Archiving renames the sandbox to its old name followed by (Archived and the last 8 characters of its ID, for example CI (Archived WTCV93GX).

After a reset, re-create the catalog and customers your tests rely on, because the IDs from before the reset return 404. Reset a sandbox lists exactly what a reset keeps and deletes.

Follow a reset#

Send an Idempotency-Key with every reset. If the response is lost, retrying with the same key within 24 hours returns the recorded response without resetting again. After 24 hours, the same key resets the sandbox again. A request with a new key resets the sandbox again, or resumes a reset that stopped after deletion started.

cURL
curl -X POST https://api.withflintpay.com/v1/sandboxes/test_01KWJS7ZW5YAC86HMHWTCV93GX/reset \
  -H "Authorization: Bearer YOUR_TEST_API_KEY" \
  -H "Idempotency-Key: reset-ci-run-4182"
JSON
{
  "data": {
    "sandbox_id": "test_01KWJS7ZW5YAC86HMHWTCV93GX",
    "name": "CI",
    "status": "active",
    "is_default": false,
    "initial_onboarding": "complete",
    "reset_failed_at": null,
    "created_at": "2026-08-12T09:02:11Z",
    "updated_at": "2026-09-04T14:20:33Z"
  },
  "request_id": "req_01KWM6ZHRMW9K5XV66R5X74VRN"
}

While the reset runs, requests made with the sandbox's credentials get 409 OPERATION_IN_PROGRESS with reason sandbox_resetting and a Retry-After header. Retry them after Retry-After.

Each sandbox can be reset once every 10 seconds and 500 times per UTC day, across every credential that can reset it. Past either limit, the request gets 429 RATE_LIMIT_EXCEEDED with Retry-After; a retry with the same Idempotency-Key doesn't count again.

Failed resets retry after 1, 2, 4, 8, 16, 32, and 60 minutes. Flint allows at most eight attempts, counting each when it starts, including interrupted attempts. If none succeeds, Flint stops retrying and sets reset_failed_at on the sandbox:

  • If deletion has not started, the sandbox keeps its previous data and credentials and accepts requests again. You can reset it again or archive it.
  • If deletion has started, requests return 409 ACTION_NOT_ALLOWED with reason sandbox_reset_failed, without Retry-After. Send another POST /v1/sandboxes/{sandbox_id}/reset with a new idempotency key to resume the reset. You can also archive a non-default sandbox with a live credential; both sets of data are then deleted in the background. Credential events wait until you retry or archive.

A successful reset clears reset_failed_at. Otherwise the timestamp records the last reset that stopped. null means no reset has stopped, or a later reset succeeded. The sandbox's status remains active until you archive it.

Errors specific to sandboxes#

  • HTTP 403
    Reason live_mode_required: a test credential listed, created, or archived sandboxes. Reason merchant_role_insufficient: the onboarding session's user isn't a merchant owner or admin.
  • HTTP 409
    An active sandbox already has that name. Choose another name, or archive the existing sandbox first.
  • HTTP 409
    OPERATION_IN_PROGRESSRetry the same request
    The sandbox is being reset. Reason sandbox_resetting: a request made with the sandbox's credentials during the reset. No reason: a second reset or an archive during it. Retry after Retry-After.
  • HTTP 409
    Reason sandbox_reset_failed: the reset stopped after deletion started. Reset it again to retry, or archive a non-default sandbox. Reason archived: the sandbox is archived, so it can't be reset, archived again, or given keys. Reason unsupported_state: the default sandbox can't be archived.
  • HTTP 401
    Reason revoked: the key's sandbox was archived. Issue a key for an active sandbox.

Request validation and scope errors are listed in Sandboxes & test mode.

Sandboxes & test modeHow keys select a sandbox, issuing keys, resets in CI, and the CLI commands.TestingTest cards, declines, 3D Secure, refunds, and disputes in a sandbox.Test clocksRun trials, renewals, and payment retries at a time you control.

The Sandbox object#

An isolated environment for testing an integration.

Returned by GET /v1/sandboxes/{sandbox_id} and carried by the endpoints below.

Attributes

created_atstringRequired

RFC3339 timestamp.

initial_onboardingenumRequired

The onboarding state the sandbox starts in, and returns to when you reset it. `complete` prefills a verified test identity; `not_started` leaves requirements due so you can rehearse onboarding.

  • complete
  • not_started
is_defaultbooleanRequired

Whether this is the merchant's one default sandbox. It can be reset but cannot be archived.

namestringRequired

Sandbox name. Archiving appends (Archived XXXXXXXX) to free the original name for reuse.

reset_failed_atstring or nullRequired

When the last reset stopped after repeated failures. Before data deletion starts, the sandbox keeps its previous data and remains usable. Once deletion starts, requests are blocked until you retry the reset or archive a non-default sandbox. Null when no reset has failed or a later reset succeeded.

sandbox_idstringRequired

Unique identifier for this sandbox, prefixed `test_`.

statusenumRequired

Sandbox availability. Active sandboxes accept test requests. Archived sandboxes are retired, with their API keys revoked; reset preserves an active sandbox and its credentials.

  • active
  • archived
updated_atstringRequired

RFC3339 timestamp.

JSON
{
  "created_at": "2026-03-18T19:45:00Z",
  "initial_onboarding": "complete",
  "is_default": true,
  "name": "Default Test",
  "reset_failed_at": null,
  "sandbox_id": "test_01KEZF7C00EWKVN1WYFT3YJSS5",
  "status": "active",
  "updated_at": "2026-03-18T19:45:00Z"
}

List sandboxes#

GET/v1/sandboxes

Requires scope developer.sandboxes.read or developer.sandboxes.write

Rate limit: read

Returns the merchant's sandboxes. Flint guarantees a default test sandbox for every merchant. Use an onboarding session during setup or a live credential afterward. Test credentials cannot list sandboxes. Default order: is_default descending, then created_at descending, then sandbox_id descending.

Query parameters

page_sizeinteger

Maximum number of results to return, from 1 to 100. Defaults to 20.

page_tokenstring

Opaque, signed next_page_token from the previous response, bound to the list and caller. Omit on the first request. You may change `page_size` between pages. Reuse it with the same endpoint, filters, sort, and request context. Do not parse or construct tokens. An altered, invalid, expired, or mismatched token returns a validation error.

statusarray of enum

Filter by status. Omitted, the list leaves out archived rows; name archived to include them. Values are trimmed and deduplicated in first-seen order; empty or unknown entries are rejected. Values within this filter are ORed; separate filters are ANDed.

  • active
  • archived

Response · 200

The merchant's sandboxes.

dataarray of objectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

next_page_tokenstring

Opaque token to send as `page_token` to retrieve the next page. Omitted when there is no next page.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl https://api.withflintpay.com/v1/sandboxes \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

The merchant's sandboxes.

JSON
{
  "data": [
    {
      "created_at": "2026-03-18T19:45:00Z",
      "initial_onboarding": "complete",
      "is_default": true,
      "name": "Default Test",
      "reset_failed_at": null,
      "sandbox_id": "test_01KEZF7C00EWKVN1WYFT3YJSS5",
      "status": "active",
      "updated_at": "2026-03-18T19:45:00Z"
    },
    {
      "created_at": "2026-03-18T20:00:00Z",
      "initial_onboarding": "not_started",
      "is_default": false,
      "name": "Partner Demo",
      "reset_failed_at": null,
      "sandbox_id": "test_01KEZF7C00BP1BVYGDKDERC0GM",
      "status": "active",
      "updated_at": "2026-03-18T20:00:00Z"
    }
  ],
  "meta": {
    "api_version": "2026-09-07"
  },
  "next_page_token": "example",
  "request_id": "req_01KWM6ZWCMGKVSSFSCZMZWFY21"
}

Create sandbox#

POST/v1/sandboxesIdempotent

Requires scope developer.sandboxes.write

Also requires accounts.api_keys.write when issue_test_key is true.

Rate limit: sensitive_write

Creates a new empty test sandbox for the current merchant. Send `issue_test_key: true` to also receive a test key bound to it; this also requires `accounts.api_keys.write`.

Request body

Send exactly one of these

Send exactly one of these

accessenumRequired

Key access. Full and read_only resolve from the current scope catalog for the key's mode; restricted holds only its listed scopes. Granting full or read_only requires a freshly verified authorized user session, or a full-access API key in the key's mode or a live full-access key granting a test key.

  • full
initial_onboardingenum

The onboarding state the sandbox starts in, and returns to when you reset it. `complete` prefills a verified test identity; `not_started` leaves requirements due so you can rehearse onboarding.

  • complete
  • not_started
issue_test_keyenumRequired

Whether to issue a test API key for the new sandbox. Defaults to `false`. When `true`, the response includes the key and its one-time `secret_key`, and `access`, `scopes`, `test_key_name`, and `test_key_expires_at` apply. When `false`, sending any of them returns 400 NOT_ALLOWED.

  • true
namestringRequired

Name of the new sandbox. Required. Surrounding whitespace is trimmed before length validation. A supplied value cannot be blank; use null where clearing is supported.

test_key_expires_atstring

Future RFC 3339 timestamp when the issued test key expires. Allowed only with issue_test_key true. Omit for a key that doesn't expire.

test_key_namestring

Name for the issued test key, 1 to 100 characters. Allowed only with issue_test_key true. Defaults to the sandbox name followed by `Test Key`.

Response · 201

The created sandbox, optionally with a newly issued test key.

dataobjectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl -X POST https://api.withflintpay.com/v1/sandboxes \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "access": "restricted",
    "issue_test_key": true,
    "name": "QA",
    "scopes": [
      "commerce.orders.read",
      "commerce.orders.write"
    ],
    "test_key_name": "QA integration key"
  }'

Get sandbox#

GET/v1/sandboxes/{sandbox_id}

Requires scope developer.sandboxes.read or developer.sandboxes.write

Rate limit: read

Returns a single sandbox by ID. A test credential (API key, CLI login, or workload token) can read only the sandbox it is bound to; any other `sandbox_id` gets 404 `RESOURCE_NOT_FOUND`.

Path parameters

sandbox_idstringRequired

Flint sandbox ID. Must be a valid ID with prefix test_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Response · 200

The requested sandbox.

dataobjectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl https://api.withflintpay.com/v1/sandboxes/test_01KEZF7C00JC77HTMTB2XHNPE0 \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

The requested sandbox.

JSON
{
  "data": {
    "created_at": "2026-03-18T19:45:00Z",
    "initial_onboarding": "complete",
    "is_default": true,
    "name": "Default Test",
    "reset_failed_at": null,
    "sandbox_id": "test_01KEZF7C00EWKVN1WYFT3YJSS5",
    "status": "active",
    "updated_at": "2026-03-18T19:45:00Z"
  },
  "meta": {
    "api_version": "2026-09-07"
  },
  "request_id": "req_01KWM685SAGEG4N1S8P6JFXW05"
}

Archive sandbox#

DELETE/v1/sandboxes/{sandbox_id}Idempotent

Requires scope developer.sandboxes.write

Rate limit: sensitive_write

Archives a non-default sandbox and frees its original name for reuse. A sandbox whose reset stopped after deletion started can be archived; its previous and new data are then deleted in the background.

Path parameters

sandbox_idstringRequired

Flint sandbox ID. Must be a valid ID with prefix test_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Response · 200

The archived sandbox.

Same response as Get sandbox.

curl -X DELETE https://api.withflintpay.com/v1/sandboxes/test_01KEZF7C00JC77HTMTB2XHNPE0 \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

Reset sandbox#

POST/v1/sandboxes/{sandbox_id}/resetIdempotent

Requires scope developer.sandboxes.write

Rate limit: sensitive_write

Deletes a sandbox's data and keeps its identity and connections. The default sandbox can be reset too. A test credential (API key, CLI login, or workload token) with `developer.sandboxes.write` can reset only the sandbox it is bound to; any other `sandbox_id` gets 404 `RESOURCE_NOT_FOUND`, and the credential keeps working after the reset. The sandbox keeps its `sandbox_id`, name, and `is_default`; every credential bound to it, including API keys, workload identities, CLI logins, and connected app installs; its webhook endpoints with their secrets and API versions; its test payment account and readiness; its payment method, checkout, and custom domains; and its processing fee assignments. Everything else is deleted: catalog, customers, orders, payments, invoices, subscriptions, test clocks, settings, locations, risk lists, request logs, events, deliveries, and idempotency keys. Returns the same sandbox with `status` `active` and a new `updated_at`. Requests that start while the reset runs get 409 `OPERATION_IN_PROGRESS` with reason `sandbox_resetting`; retry them after Retry-After. A second reset while one is running gets 409 `OPERATION_IN_PROGRESS`. Failed resets retry with delays of 1, 2, 4, 8, 16, 32, and 60 minutes, with at most eight attempts. Each attempt counts when it starts, including interrupted attempts. `reset_failed_at` records when a reset stops. If deletion has not started, the sandbox keeps its previous data and accepts requests again. If deletion has started, requests get 409 `ACTION_NOT_ALLOWED` with reason `sandbox_reset_failed`, without Retry-After. Reset it again to resume, or archive a non-default sandbox. A successful reset clears `reset_failed_at`. Requests already running when the reset started finish against the old data, and their results don't survive the reset. A retry with the same Idempotency-Key returns the recorded response; a new key resets again. Each sandbox allows one reset every 10 seconds and 500 resets per UTC day, shared by every credential that can reset it; past either limit the request gets 429 `RATE_LIMIT_EXCEEDED` with Retry-After, and a same-key retry doesn't count again. See the [sandboxes guide](/docs/guides/sandboxes#reset-a-sandbox).

Path parameters

sandbox_idstringRequired

Flint sandbox ID. Must be a valid ID with prefix test_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Response · 200

The reset sandbox.

Same response as Get sandbox.

curl -X POST https://api.withflintpay.com/v1/sandboxes/test_01KEZF7C00JC77HTMTB2XHNPE0/reset \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

Was this helpful?