Skip to content

Sandboxes & test mode

A sandbox is where you build and test against Flint without moving money. Test and live traffic use the same API at the same hostname, https://api.withflintpay.com, and the key you send decides where a request runs. A flint_test_... key runs in test mode, in the one sandbox it's bound to. A flint_live_... key runs in live mode, against real money. Nothing else in the request selects the mode or the sandbox.

Every account starts with one sandbox, and a test key from the dashboard already works in it. Create more sandboxes to give CI or QA data of its own, and reset one to start over with clean test data.

Test mode and live mode#

Test modeLive mode
Key prefixflint_test_...flint_live_...
Where it runsThe one sandbox the key is bound toYour live account
MoneyNone moves. Card charges are simulated.Real charges
CardsTest cards onlyReal cards
EmailBuyer emails are sent for real, with [Test] in the subject and a banner saying no money moved. Use your own team address.Sent to your buyers
TextsNot sent. Codes confirm as described in Test codes in a sandbox.Sent to your buyers
Response headersFlint-Mode: test and Flint-Sandbox-Id: test_...Flint-Mode: live

Each sandbox can send buyer email to 100 distinct non-team recipients per UTC day across To and CC addresses. Repeat emails to the same address count once, ignoring letter case. After the limit, email can still go to team addresses and recipients already used that day; use your own team address to test without this limit. A team address is your merchant email, support email, or an active team member's email; matching ignores letter case.

Test and live data never mix. An order created with a test key doesn't exist for a live key or for a key bound to another sandbox. An ID created in a sandbox, such as a prod_... or whep_..., left in production configuration returns 404 RESOURCE_NOT_FOUND in live mode, so re-create your products, plans, and webhook endpoints when you go live.

What a sandbox is#

A sandbox is a self-contained test copy of your merchant account. Each one has its own orders, customers, products, saved payment methods, subscriptions, invoices, test clocks, webhook endpoints, merchant settings, risk and fulfillment settings, idempotency keys, and request logs. Nothing in one sandbox is visible from another. Your team access is shared across every environment.

Every merchant gets one sandbox automatically, named Default Test, with is_default: true. It can't be reset or archived, so treat it as your long-lived development sandbox and put disposable work in sandboxes you create.

Flint sets up test card payments in the default sandbox when the account is created, and in each sandbox you create when you create it. For a short time afterward, readiness.payments.status on GET /v1/merchant can be pending. Before relying on a sandbox for card payments, read it with a key for that sandbox and wait for ready; Testing shows the check.

Each test key is bound to exactly one sandbox when it's created, and that binding never changes. Every test-mode response carries a Flint-Sandbox-Id header naming the sandbox the request ran in, so you can always confirm which sandbox a key reaches.

If you're signed in to these docs, the test key filled into the code samples is bound to your default sandbox. It can create orders and take test payments, but it can't read or reset the sandbox, because it doesn't hold the developer.sandboxes scopes.

Catalog and environment copies skip promotion codes bound to a customer, so recreate the code for that customer in the target environment; promotions and unbound codes copy with their per-customer limit and rules.

Which environment a credential reaches#

Every credential is bound to one environment, live or one sandbox, when it's issued. That environment applies to every request the credential makes, and a request can't switch it: to work in another sandbox, send a credential bound to that sandbox. GET /v1/auth-context returns the mode and, in test mode, sandbox_id of the credential that sent the request.

CredentialEnvironmentTo work somewhere else
Live key (flint_live_...)LiveIssue a test key for the sandbox.
Test key (flint_test_...)The sandbox it was created forUse a key bound to the other sandbox, or a live key for live.
Onboarding session tokenThe merchant's default sandbox, never liveIssue a key for the other sandbox. For live, create a live key or run flint login --live.
CLI OAuth access tokenThe one merchant and environment of its approved contextSelect or approve another context; see CLI OAuth.
Workload identity access token (fwat_...)The identity's environmentCreate an identity in the other environment; see workload identities.
Partner app tokenThe token's mode. Flint-Merchant-Id selects the merchant, and its grant for that mode fixes the sandbox in test mode. Flint-Sandbox-Id, if sent, must name that sandboxMint a token for the other mode, or have the merchant authorize the install there; see partner app installs.

The onboarding session token acts in the default sandbox, and it can also manage the merchant's sandboxes during setup, as Managing sandboxes describes.

When to create another sandbox#

Create a sandbox for each use whose data must not mix with another's. A common split is your default sandbox for local development, one sandbox for CI, and one for QA or partner testing. Each has its own customers, catalog, and webhook endpoints, and resetting one leaves the others untouched.

Two CI pipelines that run at the same time need a sandbox each. A reset deletes the sandbox's data, so one run's reset would delete the customers, orders, and payments the other run is using, and the other run's requests get 409 OPERATION_IN_PROGRESS while the reset runs.

Sandbox names are unique among your active sandboxes. Archiving a sandbox frees its name.

Managing sandboxes#

You can manage sandboxes on the dashboard's Sandboxes page, which the environment menu in the top bar links to as Manage sandboxes, or over the API:

  • GET/v1/sandboxesRequired API key scopes: developer.sandboxes.read or developer.sandboxes.writeReference for GET /v1/sandboxes

    Lists active sandboxes, or archived ones with status=archived.

  • POST/v1/sandboxesRequired API key scope: developer.sandboxes.writeReference for POST /v1/sandboxes

    Creates an empty sandbox, and with issue_test_key: true, a test key bound to it.

  • GET/v1/sandboxes/{sandbox_id}Required API key scopes: developer.sandboxes.read or developer.sandboxes.writeReference for GET /v1/sandboxes/{sandbox_id}

    Returns one sandbox, active or archived.

  • POST/v1/sandboxes/{sandbox_id}/resetRequired API key scope: developer.sandboxes.writeReference for POST /v1/sandboxes/{sandbox_id}/reset

    Deletes a sandbox's data and keeps its ID, keys, and webhook endpoints.

  • DELETE/v1/sandboxes/{sandbox_id}Required API key scope: developer.sandboxes.writeReference for DELETE /v1/sandboxes/{sandbox_id}

    Archives a sandbox you created.

Listing, creating, and archiving sandboxes take a live credential. A test credential (a test key, a sandbox CLI login, or a sandbox workload token) can read and reset only its own sandbox:

RouteLive credentialTest credential
GET /v1/sandboxesAny sandbox of the merchant403 FORBIDDEN, reason live_mode_required
POST /v1/sandboxesCreates a sandbox403 FORBIDDEN, reason live_mode_required
GET /v1/sandboxes/{sandbox_id}Any sandbox of the merchantIts own sandbox. Any other sandbox_id returns 404 RESOURCE_NOT_FOUND, whether or not it exists
POST /v1/sandboxes/{sandbox_id}/resetAny sandbox of the merchantIts own sandbox. Any other sandbox_id returns 404 RESOURCE_NOT_FOUND
DELETE /v1/sandboxes/{sandbox_id}Any sandbox except the default403 FORBIDDEN, reason live_mode_required

Reading needs developer.sandboxes.read or developer.sandboxes.write, and creating, resetting, and archiving need developer.sandboxes.write. Both scopes are available to live and test keys, and full-access keys of either mode hold them. Test keys for an existing sandbox come from POST /v1/api-keys with its sandbox_id.

A request that issues a test key also needs accounts.api_keys.write, and what the new key's access can be depends on the caller:

  • With access restricted, the live key must hold every scope it grants, because a key can delegate only scopes it holds.
  • Granting full or read_only, or accounts.api_keys.write, accounts.workload_identities.write, commerce.gift_cards.secrets.write, or commerce.license_keys.secrets.write, takes a full-access live key or a freshly verified onboarding session token, as described next. A restricted key can't grant those scopes even when it holds them; see credentials that can mint keys.

During API-first setup, the onboarding session token can call the same routes when its user is a merchant owner or admin. Other users get 403 FORBIDDEN with reason merchant_role_insufficient when they create, reset, or archive. The session can grant full, read_only, or scopes outside the low-risk read allowlist within 300 seconds of email verification. After that, those grants return 403 IDENTITY_VERIFICATION_REQUIRED with the verification time in details[0].verified_at. Verify the email again, then retry.

Create a sandbox#

Send a name. To get a test key bound to the new sandbox in the same response, add issue_test_key: true with the key's access, and scopes when access is restricted. The response carries the new key once, with its secret. test_key_name is optional and defaults to the sandbox name followed by Test Key. test_key_expires_at is optional: a future RFC 3339 time when the key stops working, validated like expires_at on POST /v1/api-keys. Without issue_test_key, sending access, scopes, test_key_name, or test_key_expires_at returns 400 INVALID_REQUEST with details[0].code NOT_ALLOWED.

initial_onboarding sets the onboarding state the sandbox starts in, and returns to when you reset it. The sandbox echoes it in every response.

  • complete, the default: Flint verifies the sandbox's test account with test identity data, so it can take test card payments without anyone onboarding.
  • not_started: Flint prefills nothing, and requirements stay due. Use it to rehearse onboarding, such as building an embedded onboarding UI. Readiness reports onboarding_not_started with the create_merchant_account_session action until you run the onboarding loop with a key for the sandbox and enter the sandbox verification values.
cURL
curl -X POST https://api.withflintpay.com/v1/sandboxes \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_LIVE_API_KEY" \
  -H "Idempotency-Key: create-ci-sandbox" \
  -d '{
    "name": "CI",
    "issue_test_key": true,
    "test_key_name": "ci-runner",
    "access": "restricted",
    "scopes": ["commerce.orders.read", "commerce.orders.write", "merchants.profile.read"]
  }'
JSON
{
  "data": {
    "sandbox": {
      "sandbox_id": "test_01KWJS7ZW5YAC86HMHWTCV93GX",
      "name": "CI",
      "status": "active",
      "is_default": false,
      "initial_onboarding": "complete",
    "reset_failed_at": null,
      "created_at": "2026-08-30T09:15:07Z",
      "updated_at": "2026-08-30T09:15:07Z"
    },
    "api_key": {
      "api_key_id": "key_01KWJS8006FVHT8CRWDKBWA1T9",
      "name": "ci-runner",
      "key_prefix": "flint_test_2686d60a",
      "sandbox_id": "test_01KWJS7ZW5YAC86HMHWTCV93GX",
      "access": "restricted",
      "scopes": ["commerce.orders.read", "commerce.orders.write", "merchants.profile.read"],
      "status": "active",
      "version": 1,
      "created_at": "2026-08-30T09:15:07Z"
    },
    "secret_key": "flint_test_2686d60a..."
  },
  "request_id": "req_01KWM6AKTD5FEMEYXE1VFP5843"
}

data.sandbox.sandbox_id is the ID the reset, archive, and API keys routes take. data.api_key and data.secret_key are present exactly when issue_test_key is true; otherwise data holds only sandbox.

Warning: Save secret_key now

secret_key is the new test key, and only this response shows it. A replay with the same Idempotency-Key returns it only under the rules for responses with one-time secrets. If you lose it, issue another key for the sandbox.

A new sandbox starts empty, with no catalog, customers, or webhook endpoints. Confirm the key reaches it with GET /v1/auth-context, which API keys, CLI logins, workload identities, partner apps, and onboarding sessions can call:

cURL
curl -i https://api.withflintpay.com/v1/auth-context \
  -H "Authorization: Bearer YOUR_NEW_TEST_KEY"
HTTP
HTTP/1.1 200 OK
Flint-Mode: test
Flint-Sandbox-Id: test_01KWJS7ZW5YAC86HMHWTCV93GX

Then, before the first card payment, read GET /v1/merchant with the new key until readiness.payments.status is ready. That read needs merchants.profile.read, which is why the example key holds it.

Issue a key for an existing sandbox#

A sandbox can have many test keys, for example one per developer or one per CI run. Create them with POST /v1/api-keys and the sandbox's sandbox_id, from a live credential or a Dashboard session. Send access restricted with scopes for a key whose scopes never change, or, from a full-access live key or a freshly verified session, full or read_only for a key that holds every test-mode scope of that access level, including scopes Flint adds later. name is required and expires_at is optional, as for any key.

cURL
curl -X POST https://api.withflintpay.com/v1/api-keys \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_LIVE_API_KEY" \
  -H "Idempotency-Key: local-dev-key-maria" \
  -d '{
    "name": "local-dev-maria",
    "access": "full",
    "sandbox_id": "test_01KWJS7ZW5YAC86HMHWTCV93GX"
  }'
JSON
{
  "data": {
    "api_key_id": "key_01KWJS80E4G3CYMKRA955524FF",
    "name": "local-dev-maria",
    "key_prefix": "flint_test_ca7f32e8",
    "secret_key": "flint_test_ca7f32e8...",
    "sandbox_id": "test_01KWJS7ZW5YAC86HMHWTCV93GX",
    "access": "full",
    "scopes": ["accounts.api_keys.read", "accounts.api_keys.write", "commerce.orders.read", "commerce.orders.write", "merchants.profile.read"],
    "status": "active",
    "version": 1,
    "created_at": "2026-08-30T09:20:41Z"
  },
  "request_id": "req_01KWM6RFA74M15JRQMQ33B80M6"
}

scopes lists what the key holds today, shortened here. A full-access test key never holds the live-only scopes, such as developer.partner_apps.write, and holds developer.sandboxes.write, which reaches only its own sandbox. Asking for a live-only scope on a restricted test key returns 400 INVALID_REQUEST with details[0].code NOT_ALLOWED and param scopes.

secret_key is shown only in this response, as with sandbox creation. sandbox_id must be the sandbox's public ID; an unknown ID returns 404 RESOURCE_NOT_FOUND and an archived sandbox 409. A test key that holds accounts.api_keys.write can create keys only in its own sandbox: it may omit sandbox_id or send its own, and any other sandbox returns 404. An onboarding session must send sandbox_id, and can name any of the merchant's active sandboxes. Any key is revoked with POST /v1/api-keys/{api_key_id}/revoke; see Manage keys over the API.

List and look up sandboxes#

GET /v1/sandboxes returns active sandboxes, the default sandbox first and then the newest. Archived sandboxes are left out unless you ask for them with status=archived, or status=active,archived for both. Page with page_size, up to 100, and the next_page_token from the previous response, sent back as page_token with the same status filter.

cURL
curl "https://api.withflintpay.com/v1/sandboxes" \
  -H "Authorization: Bearer YOUR_LIVE_API_KEY"
JSON
{
  "data": [
    {
      "sandbox_id": "test_01KNB061AGD0CYYF16M5QAQE3N",
      "name": "Default Test",
      "status": "active",
      "is_default": true,
      "initial_onboarding": "complete",
    "reset_failed_at": null,
      "created_at": "2026-05-12T16:02:41Z",
      "updated_at": "2026-05-12T16:02:41Z"
    },
    {
      "sandbox_id": "test_01KWJS7ZW5YAC86HMHWTCV93GX",
      "name": "CI",
      "status": "active",
      "is_default": false,
      "initial_onboarding": "complete",
    "reset_failed_at": null,
      "created_at": "2026-08-30T09:15:07Z",
      "updated_at": "2026-08-30T09:15:07Z"
    }
  ],
  "request_id": "req_01KWM6X5TT92MDR6WJFK1G6593"
}

GET /v1/sandboxes/{sandbox_id} returns one sandbox, including an archived one. A sandbox has two statuses:

status on sandbox
Final values do not change again
  • active
    Its keys authenticate, and you can issue keys for it, reset it, or archive it.
  • archivedFinal
    Archived. Its keys return 401 INVALID_CREDENTIAL with reason revoked, and its data can't be read. There is no unarchive. Sandboxes that resets archived before November 2026 also have this status.

Reset a sandbox#

A reset deletes the sandbox's data and keeps its identity and connections.

A reset keeps the sandbox_id, name, is_default, and initial_onboarding; every credential bound to the sandbox, including API keys, workload identities, CLI logins, and connected app installs; its webhook endpoints, with the same IDs, URLs, events, API versions, and signing secrets; its test payment account and payment readiness; its payment method, checkout, and custom domains; and its processing fee assignments.

It deletes everything else, including the catalog, customers, orders, payments, invoices, subscriptions, test clocks, settings, locations, risk lists, request logs, events, deliveries, and idempotency keys.

When initial_onboarding is not_started, the sandbox also returns to not_started: it loses its test payment account and its onboarding starts over, even if you finished onboarding before the reset. Check readiness.payments before the first payment, as you would for a new sandbox.

Reset with a live key, or with a test key bound to the sandbox that holds developer.sandboxes.write:

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-2026-09-04"
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"
}

The response is the same sandbox, with status active and a new updated_at. A reset takes a few seconds, and the request returns once it finishes:

  • Requests during a reset. A request that starts while the reset runs, with any credential bound to the sandbox or naming it in sandbox_id (such as minting a key for it), gets 409 OPERATION_IN_PROGRESS with details[0].reason sandbox_resetting and a Retry-After header. Send the same request again after Retry-After; it then runs against the reset sandbox. The SDKs and the CLI retry it for you.
  • Requests already running. A request that started before the reset finishes against the old data, and its result doesn't survive the reset. Its response can reach you after the reset returns.
  • Webhooks. Deliveries and scheduled retries of events from before the reset stop with suppression_reason sandbox_reset, except for one attempt that may already be sending. Event streams end with a disconnect frame with reason sandbox_reset; reconnect to stream the reset sandbox's events. A reset sends no event of its own.
  • Idempotency. A retry with the same Idempotency-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. Idempotency keys that the sandbox's credentials sent before the reset don't replay their old responses.
  • Concurrent resets. A second reset, or an archive, while a reset runs gets 409 OPERATION_IN_PROGRESS with Retry-After.
  • Reset limit. Each sandbox can be reset once every 10 seconds and 500 times per UTC day. The limit is shared by every credential that can reset the sandbox. Past it, the request gets 429 RATE_LIMIT_EXCEEDED with Retry-After. A retry with the same Idempotency-Key doesn't count again.

After a reset, re-create the products, plans, customers, test clocks, and anything else your tests depend on. IDs from before the reset return 404 RESOURCE_NOT_FOUND, and checkout links and payment links from before the reset stop working.

The default sandbox resets like any other and stays the default. Its keys, including the key filled into these docs, keep working, and so do onboarding sessions and the Dashboard.

Give CI a clean sandbox for each run#

Reset one dedicated sandbox at the start of each run, rather than creating and archiving a sandbox per run. A reset keeps the sandbox's ID, keys, webhook endpoints, and test payment account, while a new sandbox needs its payments set up first. CI needs one secret: a test key bound to the sandbox that holds developer.sandboxes.write and the scopes your tests need. No live key is involved.

  1. Set up the sandbox once#

    Create a sandbox named CI with POST /v1/sandboxes and a live credential. Issue a test key for it with POST /v1/api-keys and its sandbox_id, holding developer.sandboxes.write, merchants.profile.read for the readiness check, and the scopes your tests need, and register any webhook endpoint the tests receive on. Store the key's secret_key as a CI secret. It stays valid across resets, and GET /v1/auth-context returns its sandbox_id.

  2. Reset it at the start of each run#

    POST /v1/sandboxes/{sandbox_id}/reset with the test key and an Idempotency-Key that includes the run ID, so a retried step returns the recorded response instead of resetting again. Requests sent while the reset runs get 409 OPERATION_IN_PROGRESS; the SDKs retry them.

  3. Prepare the data#

    With the test key, create the catalog the tests use, and wait for readiness.payments.status to be ready on GET /v1/merchant before the first card payment.

With the Node SDK, the reset step uses the same test key the tests use:

TypeScript
import { Client } from "@flintpay/node";

const flint = new Client({
  baseUrl: "https://api.withflintpay.com",
  apiKey: process.env.FLINT_API_KEY!,
});
const runId = process.env.CI_RUN_ID!;

// The key's own sandbox. The ID stays the same across resets.
const context = await flint.authContext.get();

await flint.sandboxes.reset(context.sandbox_id!, {}, {
  idempotencyKey: `ci-reset-${runId}`,
});

// The tests keep using FLINT_API_KEY against the clean sandbox.

If a retried reset step uses a new idempotency key, it resets the sandbox again, which is harmless at the start of a run.

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.

Archive a sandbox#

Archive a sandbox you no longer need. Its status becomes archived, every key bound to it returns 401 INVALID_CREDENTIAL with details[0].reason revoked, and its name is freed for a new sandbox. Flint renames the archived sandbox to its old name followed by (Archived and the last eight characters of its ID.

cURL
curl -X DELETE https://api.withflintpay.com/v1/sandboxes/test_01KWJS7ZW5YAC86HMHWTCV93GX \
  -H "Authorization: Bearer YOUR_LIVE_API_KEY" \
  -H "Idempotency-Key: archive-qa-sandbox"
JSON
{
  "data": {
    "sandbox_id": "test_01KWJS7ZW5YAC86HMHWTCV93GX",
    "name": "CI (Archived WTCV93GX)",
    "status": "archived",
    "is_default": false,
    "initial_onboarding": "complete",
    "reset_failed_at": null,
    "created_at": "2026-08-30T09:15:07Z",
    "updated_at": "2026-09-04T15:02:18Z"
  },
  "request_id": "req_01KWM6DADJQCCSXYM48KKWKZJM"
}

There is no unarchive. To keep working under the same name, create a new sandbox. Archiving an already archived sandbox returns 409 ACTION_NOT_ALLOWED with reason archived, and archiving the default sandbox returns 409 ACTION_NOT_ALLOWED with reason unsupported_state.

The sandbox-bound key requirement#

Every test key must be bound to a sandbox. A test key with no sandbox binding can't authenticate any request, and Flint returns 401 instead of guessing which sandbox you meant:

JSON
{
  "error": {
    "type": "authentication_error",
    "code": "INVALID_CREDENTIAL",
    "message": "Test mode API keys must be sandbox-bound before they can authenticate public API requests.",
    "request_id": "req_01KWM6NQTTNZHEZRM8YQJXCEBV",
    "details": [
      {
        "code": "INVALID_CREDENTIAL",
        "message": "Test mode API keys must be sandbox-bound before they can authenticate public API requests.",
        "reason": "mode_mismatch"
      }
    ]
  }
}

The error's remediation.next_actions names the fix, issue_developer_sandbox_test_key. Replace the key with one bound to a sandbox: create it on the dashboard's API keys page with that sandbox selected in the environment menu, or issue one with a live key.

Errors#

  • HTTP 400
    A malformed sandbox_id, with param sandbox_id. Or a request that issues a test key left out access or sent restricted without scopes (details[0].code REQUIRED), sent scopes with full or read_only (NOT_ALLOWED), sent key fields without issue_test_key (NOT_ALLOWED), or asked for a live-only scope (NOT_ALLOWED on scopes). Fix the field param names
  • HTTP 401
    details[0].reason is mode_mismatch for a test key with no sandbox binding, and revoked for a key whose sandbox was archived. Use a key bound to an active sandbox
  • HTTP 403
    live_mode_required: a test credential listed, created, or archived sandboxes; use a live key. merchant_role_insufficient: the onboarding session's user isn't a merchant owner or admin. full_access_required: only a full-access live key or a freshly verified onboarding session can grant full, read_only, or the step-up scope named by param
  • HTTP 403
    Reason scope_not_granted: the key lacks developer.sandboxes.write, or accounts.api_keys.write when issuing a key. Reason scope_not_held: it tried to grant a scope it doesn't hold. details[0].missing_scopes names them
  • HTTP 403
    The onboarding session needs fresh email verification to grant this access. details[0].verified_at reports the last verification. Verify again, then retry.
  • HTTP 404
    No sandbox with that ID in your merchant account, or, for a test credential, a sandbox other than its own, with param sandbox_id. Check the ID against GET /v1/sandboxes, or use the sandbox_id from GET /v1/auth-context
  • HTTP 409
    An active sandbox already has that name. details[0].current_resource names it. Pick another name, or archive or reuse the existing sandbox
  • HTTP 409
    OPERATION_IN_PROGRESSRetry the same request
    The sandbox is being reset. With details[0].reason sandbox_resetting, a request made with the sandbox's credentials arrived during the reset; without a reason, a second reset or an archive arrived during it. Send the same request again 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. Use a sandbox you created

From the CLI#

The CLI reads the mode from the credential. Listing, creating, and archiving take a live credential, and a live API key needs --live on each command. A test credential resets its own sandbox without --live:

Shell
flint sandboxes list --live
flint sandboxes create --name qa-scenarios --live
flint sandboxes create --name ci --access restricted --issue-test-key true --scopes developer.sandboxes.write --scopes merchants.profile.read --live
# In CI, with FLINT_API_KEY set to the sandbox's test key:
flint sandboxes reset test_01KWJS7ZW5YAC86HMHWTCV93GX --confirm

To issue a key while creating a sandbox, pass --issue-test-key true and choose --access explicitly. In the Node SDK, the same routes are on sandboxes: list, get, create, reset, and delete. Test keys for an existing sandbox come from apiKeys.create with sandbox_id.

Next steps#

TestingTest cards, declines, 3D Secure, refunds, disputes, and subscription renewals in your sandbox.Sandboxes API referenceEvery sandbox route, field, and response shape.AuthenticationKeys, access levels, scopes, and the Authorization header.Going liveSwap in a live key and re-create your configuration in live mode.

Was this helpful?