Sandbox Environment

The separate sandbox environment: sign up for credentials, get a token, run API reference calls from your browser, what works, and deleting test data.

For: developers

Introduction

The Astrada sandbox is a separate environment for integration testing: its own hosts, its own credentials, and test data everywhere. Nothing you do here reaches a card network, a bank, or production data. Cards enroll from published test cards and test card pools, bank links complete against the providers' test banks, and transactions come from simulation endpoints.

SurfaceURL
APIhttps://api.sandbox.astrada.co
Token endpointhttps://api.sandbox.astrada.co/auth/realms/{accountId}/protocol/openid-connect/token
SDK v2https://sdk.sandbox.astrada.co/unified/v2/unifiedEnrollmentSdk.js

A new integration starts on SDK v2: SDK v2: Quick Start runs it in sandbox. Pages already on the legacy Card Enrollment SDK or SDK v1 load https://sdk.sandbox.astrada.co/v1/cardEnrollmentSdk.js or https://sdk.sandbox.astrada.co/unified/v1/unifiedEnrollmentSdk.js.

Sign up

Sign up at astrada.co/sandbox with your work email. We email you a single-use link that expires in 24 hours. Opening it creates your sandbox and shows your accountId, a subaccount, and a client id and secret. The secret is shown once; you can rotate it later from the same sign-up page.

  • One company has one sandbox, matched by the domain of your work email. Colleagues who sign up with the same domain join it, each with their own client.
  • Personal and disposable email addresses are not accepted.
  • Sandbox credentials are separate from your production credentials and only work against the sandbox hosts.

A new sandbox holds one subaccount, named after your company, set up for Visa, Mastercard and American Express cards. Your client holds every sandbox scope, including banking:read, banking:write, banking:admin and simulation:write, so you do not need to ask for scopes to test anything on these pages.

📘

Sandbox environment vs sandbox mode

This page covers the standalone sandbox environment, which is where to start integration testing. In it, test banks work with no setting to change, and test cards give the outcomes in their table once the subaccount has a risk tier (Testing Single Card Enrollment, step 1); without one, the decline, CVC and stolen-card test cards connect like a good card. Sandbox mode is something else: a per-subaccount flag on the production API, described in Sandbox mode on production.

Get a token

Authentication works exactly like production: an OAuth2 client-credentials grant for your account, on the sandbox host (your accountId is part of the token URL). The backend SDKs get the token for you once you choose the sandbox environment.

curl -X POST "https://api.sandbox.astrada.co/auth/realms/{accountId}/protocol/openid-connect/token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials" \
  -d "client_id=YOUR_CLIENT_ID" \
  -d "client_secret=YOUR_CLIENT_SECRET"

Response (200 OK):

{
  "access_token": "eyJhbGciOi...",
  "expires_in": 300,
  "token_type": "Bearer"
}

The token carries your client's scopes. The read and write scopes match production; the simulation endpoints also require simulation:write, which sandbox clients have by default.

Run calls from the API reference

Try It on every API Reference page sends the call to the sandbox, straight from your browser.

  1. Get a token as shown above. It lasts five minutes.
  2. On the reference page, paste it into Bearer under Credentials.
  3. Fill in the parameters and press Try It. The response appears under the request.

Try It only calls the sandbox, so nothing you try there touches a real card or bank account. To have an AI assistant make sandbox calls for you, see Use the Docs with AI Assistants.

What works

The API reference applies here unchanged, served from the sandbox base URL: subaccounts, cards, card subscriptions, single card enrollment (3DS verification, SDK or API), enrollment methods, BIN lookup, transactions, transaction messages, webhooks, network bulk feeds, and bank linking. Card enrollment accepts published test cards only.

In this section

  • Test Cards & Sandbox Testing lists the published test cards with the outcome each produces. Its last section covers sandbox mode, the per-subaccount flag on the production API.
  • Testing Single Card Enrollment walks card enrollment: enroll a test card with SDK v2, watch it verify and activate, then simulate a transaction.
  • Testing Bank Linking walks bank linking end to end: create a link with the API or the SDK, complete it against a test bank, read the created resources, then watch bank postings settle a pending card authorization early and arrive as bank-only transactions on the unified feed.
  • Testing Bulk Enrollment walks bulk enrollment: create a network bulk feed, send a simulated delivery, and watch cards and transactions appear.
  • Sandbox API Reference is the endpoint reference for the simulation endpoints, with Bulk Test Card Pools underneath it.

Cleaning up test data

Every resource you create in the sandbox can be torn down over the API, so a test run leaves nothing behind. The subaccount, card subscription and network bulk feed deletes exist only in sandbox, and retrying one that failed is safe: completed steps are no-ops on replay. The two bank deletes also exist in production, where they are irreversible, so check the host before you run them; they need the banking:admin scope. All five return 204 No Content on success, and 404 once the resource is gone.

  • Delete a whole subaccount: DELETE /subaccounts/{subaccountId} removes the subaccount and everything under it: its bank links (with their accounts, transactions, and matches), every card subscription (with its card, cardholder, stored token, and transactions), network bulk feed, and webhook. One call tears the whole subaccount down, so it is the fastest reset for a test run.
  • Delete one card subscription: DELETE /card-subscriptions/{subscriptionId} removes the subscription and the data it owns; when it is the last subscription on its card, the card, cardholder, stored token, and transactions go with it.
  • Delete one network bulk feed: DELETE /network-bulk-feeds/{networkBulkFeedId} removes the feed and the cards and transactions it created.
  • Remove a whole bank connection: DELETE /bank-links/{bankLinkId} ends the connection at the provider and deletes its bank accounts and their transactions.
  • Remove a single bank account: DELETE /bank-accounts/{bankAccountId} drops one bank account and its transactions while leaving the rest of the connection intact.
📘

Bank cleanup uses your token

The subaccount delete clears bank data by calling the banking service with your bearer token. If your token is not allowed to call banking, that step is skipped and the rest of the teardown still runs. Remove any bank links yourself in that case.

curl -X DELETE "https://api.sandbox.astrada.co/subaccounts/{subaccountId}" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Next steps


Did this page help you?