Going to Production
The token scopes an SDK v2 client needs, testing transactions, webhooks and bulk feeds in sandbox, and moving each page to the production script.
Token scopes
The SDK makes these calls with the token from getAccessToken:
| Call | When | Scope |
|---|---|---|
GET /subaccounts/{subaccountId} | Opening a session, to read the subaccount's enrollmentPolicy | subaccounts:read |
POST /enrollment-methods | Every card number | enrollment-methods:write |
GET /bin-lookup | Every card number | cards:read (optional: the SDK tolerates a 403) |
GET /network-bulk-enrollments/open | Every card number on admin pages with bulk on (new in v2) | network-bulk-enrollments:write or network-bulk-feeds:write |
POST /network-bulk-enrollments | Bulk kickoff | network-bulk-enrollments:write or network-bulk-feeds:write |
POST /network-bulk-confirmations | Ask Astrada to check (new in v2) | network-bulk-enrollments:write or network-bulk-feeds:write |
POST /subaccounts/{subaccountId}/team-link | Invite your team, with enrollment links on (new in v2) | card-subscriptions:write |
Bank links and card enrollment use the same calls and scopes as v1.
The POST /network-bulk-feeds call that follows bulk-reference-entered is not in this table. Your backend makes it with your API client, which needs network-bulk-feeds:write; the SDK token does not carry that scope.
SDK clients created before v2 don't carry network-bulk-enrollments:write. When you move to v2, Astrada adds it to your SDK client, in sandbox first and then in production. Tokens minted after that carry it. Without one of the two scopes above:
- The bulk kickoff and the confirm request answer
403, and the session sendsnetwork_bulk_enrollment.forbiddenornetwork_bulk_confirmation.forbidden. - The check for an open kickoff answers
403too; the SDK then shows the program screen as it would without the check, and sends no error.
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 drive a synthetic ingestion, as in Testing Bulk Enrollment.
Moving to production
Production loads v2 from:
<script
type="text/javascript"
src="https://sdk.astrada.co/unified/v2/unifiedEnrollmentSdk.js"
data-id="unified-enrollment-sdk"
></script>Move one page at a time. For each page:
- Run the page's routes in sandbox with the cards in Try it in sandbox, as the persona the page will use.
- Ask your Astrada contact to add
network-bulk-enrollments:writeto your production SDK client. Tokens minted after that carry it. - Point the script
srcat/unified/v2/and remove the v1 tag from that page. - Set
personaon every page:"cardholder"on employee pages,"admin"on card admin pages.open()refuses a config without it. - Remove
entryandbulkFlow(optional: v2 ignores them and logs a warning), and replace atrueorfalsebulkEnrollmentwith the rails you mean:truealso turns the bank step on for every network. - If you set
minBinDigits, keep it between 8 and 11. - Handle the new events you care about: at least
route-decided, and on admin pagesclosed.next(or thenextononSuccess).- An admin page's endings offer Invite your team unless bulk is
"forced", andnext: "invite-team"says the admin chose it: open your invite page; whenteamLinkcomes too, the admin already has a link to share. - If you switch over every event type, add the new ones and drop
feed-created.
- An admin page's endings offer Invite your team unless bulk is
- Optional: pass
prefillwith the company and admin details you already have, so the kickoff and confirm-request forms open filled in.
To move a page back, point its src at /unified/v1/ again.
Updated about 1 hour ago
