Testing
Try every SDK v2 route in sandbox with test cards on an admin page and an employee page, then test transactions, webhooks and bulk feeds past enrollment.
For: developers
The Quick Start tries one subaccount policy on an admin page. This page tries every route: three policies, on an admin page and an employee page.
Try every route in sandbox
Sandbox is the same SDK against the sandbox API, so getAccessToken must return a token minted with your sandbox credentials (self sign-up at astrada.co/sandbox).
-
Check your SDK client's bulk scope. The bulk kickoff and the confirm request need
network-bulk-enrollments:writeornetwork-bulk-feeds:writeon the token your backend passes to the SDK. A self sign-up sandbox client already holdsnetwork-bulk-feeds:write. A sandbox client Astrada made for you may hold neither; without either, those calls answer403(see Token scopes), so ask your Astrada contact to add one. Tokens minted after that carry it. -
Prepare a test subaccount as in Quick Start step 2: create it with Visa and Mastercard in its
configurations, thenPATCHitsverificationPolicyandenrollmentPolicy. That call lets frictionless test cards verify without a challenge (MEDIUM, explained in Verification Risk Tiers), and sets policy A from the table below. The subaccount'senrollmentPolicywins field by field over whatopen()passes (see Which value wins), so set all threeenrollmentPolicyfields. Allow up to 60 seconds before you open a bank link (see Bank linking in sandbox). -
Open a session on your test page from the sandbox host, as in Open a session. Set
personato"admin"for the admin rows below and"cardholder"for the employee rows. To try a session without writing a page, use the SDK playground: its presets setpersonaand the three enrollment options, and show theopen()call they produce. -
Drive each route with a test card. On an admin page, type the number on the card number screen and press Continue (it needs 8 digits). On an employee page, type it on the card form: the SDK routes the card once 8 digits are typed.
The tests use three subaccount policies; switch between them with the same
PATCH, changing onlyenrollmentPolicy:Policy enrollmentPolicyA card true, bank"amex-only", bulk"suggested"B card true, bank"off", bulk"suggested"C card true, bank"off", bulk"off"Type this (policy, page) What you see routeinroute-decidedAny number starting 34or37(B, admin)The program screen for an American Express program. Connect all company cards opens the kickoff form, which ends on "Request sent" or "Next: write to your bank" and sends bulk-enrollment-requested.amex-kickoff5555 5511, then Continue (A, admin)The program screen with Connect all company cards and This doesn't look right. The kickoff ends on "Request sent" or "Next: write to your bank", with Connect this card now. proven-single5555 5522, then Continue (A, admin)The callout "You may be able to connect all your cards at once", with Ask Astrada to check and Connect this card now. Sending the request fires bulk-confirmation-requested.high-singleAny number starting 34or37(A, admin or employee)The Amex bank screen (on an employee page, once the card form has the first 8 digits), then the Plaid window (First Platypus Bank in sandbox). Sign in with user_good/pass_goodand pick the credit card account. You getbank-linked, thencard-enrolledwithenrollmentType: "bank-feed".amex-bank4242 4242 4242 4242, expiry12/34, CVC123(A, admin or employee)On an admin page, the card form with the first digits filled in; on an employee page, the card form you are typing in stays open. The card verifies without a challenge and sends card-enrolled.card-only(admin),cardholder-card(employee)5555 5525 0000 1001, any future expiry, CVC123(A, admin)The card form, a 3DS challenge, then success and card-enrolled.card-onlyAny number starting 34or37(C, admin)"This card can't be connected here". amex-not-eligibleAny number starting 34or37(B or C, employee)Once the card form has the first 8 digits, "Your company connects this card", and company-connection-needed.cardholder-company-connectsAbout the kickoff rows: the kickoff ends on "Request sent" when Astrada contacts the bank, or on "Next: write to your bank" when the admin contacts it. Once your account has a kickoff open for the program,
5555 5511opens "Already under way" instead.5555 5511and5555 5522exist only to show these screens in sandbox. They are not full test cards, so a card started from them can't finish the card form: sandbox enrolls only the published test cards. In sandbox, kickoffs and confirm requests never reach a bank or a card network. -
Run it again. Each test card enrolls once per subaccount: enrolling it again reports the existing card with
alreadyEnrolled: true. For a fresh run, delete the subaccount and create another.
Testing beyond the SDK
The SDK stops at enrollment. To test what your platform does next, carry on in sandbox:
- Transactions. Run a predefined transaction lifecycle against an enrolled card with
POST /simulate/transaction/scenario, or publish one message at a time withPOST /simulate/transactions. Both needsimulation:write, which sandbox clients have by default, andPOST /simulate/transactionsalso needscards:read. See Sandbox API Reference. - Webhooks. Register a webhook on the test subaccount, as in Testing Single Card Enrollment, to receive
cardsubscription.createdfor each card the SDK enrolls and the transaction events that follow. - Bulk feeds. To watch a feed deliver cards and transactions, create one with your API client and simulate a delivery of its cards, as in Testing Bulk Enrollment.
Updated about 9 hours ago
