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:

CallWhenScope
GET /subaccounts/{subaccountId}Opening a session, to read the subaccount's enrollmentPolicysubaccounts:read
POST /enrollment-methodsEvery card numberenrollment-methods:write
GET /bin-lookupEvery card numbercards:read (optional: the SDK tolerates a 403)
GET /network-bulk-enrollments/openEvery card number on admin pages with bulk on (new in v2)network-bulk-enrollments:write or network-bulk-feeds:write
POST /network-bulk-enrollmentsBulk kickoffnetwork-bulk-enrollments:write or network-bulk-feeds:write
POST /network-bulk-confirmationsAsk Astrada to check (new in v2)network-bulk-enrollments:write or network-bulk-feeds:write
POST /subaccounts/{subaccountId}/team-linkInvite 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 sends network_bulk_enrollment.forbidden or network_bulk_confirmation.forbidden.
  • The check for an open kickoff answers 403 too; 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 with POST /simulate/transactions. Both need simulation:write, which sandbox clients have by default, and POST /simulate/transactions also needs cards:read. See Sandbox API Reference.
  • Webhooks. Register a webhook on the test subaccount, as in Testing Single Card Enrollment, to receive cardsubscription.created for 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:

  1. Run the page's routes in sandbox with the cards in Try it in sandbox, as the persona the page will use.
  2. Ask your Astrada contact to add network-bulk-enrollments:write to your production SDK client. Tokens minted after that carry it.
  3. Point the script src at /unified/v2/ and remove the v1 tag from that page.
  4. Set persona on every page: "cardholder" on employee pages, "admin" on card admin pages. open() refuses a config without it.
  5. Remove entry and bulkFlow (optional: v2 ignores them and logs a warning), and replace a true or false bulkEnrollment with the rails you mean: true also turns the bank step on for every network.
  6. If you set minBinDigits, keep it between 8 and 11.
  7. Handle the new events you care about: at least route-decided, and on admin pages closed.next (or the next on onSuccess).
    • An admin page's endings offer Invite your team unless bulk is "forced", and next: "invite-team" says the admin chose it: open your invite page; when teamLink comes too, the admin already has a link to share.
    • If you switch over every event type, add the new ones and drop feed-created.
  8. Optional: pass prefill with 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.


Did this page help you?