Skip to main content
This quickstart walks you from an empty Sandbox to a card transaction you can see in your dashboard. We’ll:
  1. Confirm the cardholder is KYC-approved.
  2. Fund their internal account.
  3. Issue a virtual card against that account.
  4. Simulate an inbound authorization, then a clearing.
  5. List the resulting CardTransaction.

Prerequisites

  • Sandbox API credentials.
  • A Customer with kycStatus: APPROVED and at least one InternalAccount. If you don’t have one yet, follow the Payouts quickstart up to “Get the Customer’s Internal Account”.

Fund the cardholder’s internal account

Cards decline at auth time if the bound funding source can’t cover the transaction. Top up the cardholder’s internal account first.

Issue the card

The card comes back in status: "PROCESSING" while the issuer provisions it. platformCardId is generated by the server, and any value supplied in the request is ignored. When activation completes, a CARD.STATUS_CHANGE webhook fires with status: "ACTIVE":
To display the full PAN, CVV, and expiry to the cardholder, request a reveal with POST /cards/{id}/reveal and render the returned panEmbedUrl in an iframe. The URL is short-lived, so request it right before rendering. The full card credentials never cross your servers.

Simulate an authorization

Sandbox exposes simulate endpoints that drive the same internal paths the card issuer would call in production. The decisioning outcome is controlled by the last three characters of merchant.descriptor — any non-magic suffix is approved. The descriptor must be 1–25 characters.
The response is 202 Accepted with an issuerTransactionToken. Wait for the resulting transaction webhook, or poll GET /transactions with the card’s cardId and match issuerTransactionToken in the response. Once the transaction is AUTHORIZED, use its Grid id as cardTransactionId in the clearing request below. The issuer token is not a Grid transaction ID. See Sandbox testing for the response and lookup examples.

Simulate the clearing

The merchant adds a tip and clears for more than the original auth ($15.00 on a $12.50 hold). Grid handles the over-auth by issuing a post-hoc pull for the difference.
The clearing response is also 202 Accepted with an issuerTransactionToken. A transaction webhook then carries the updated parent: the transaction moves to SETTLED and settledAmount is 1500. The webhook payload carries the full CardTransaction with clearings rolled up into settledAmount; a merchant refund posts as its own dated CREDIT row. originalTransactionId is present when Grid can match the refund to its purchase and absent otherwise. See Reconciliation for the full event model.
You’ve issued a card, watched it activate, and driven an over-auth transaction through pull and clearing.

USDB funding authorization

A provisioned card awaiting USDB wallet authorization is PENDING_AUTH. Call POST /auth/delegated-keys. A 201 completes authorization. For each 202, sign that response’s challenge and retry. Successful delegation restores ACTIVE. Funding changes or key revocation can return an active card to PENDING_AUTH. Frozen and closed cards keep their status when delegation completes.