Test a card in sandbox
Issue, fund, freeze, withdraw from and change the limit of a sandbox card, and test the purchase and decline screens that sandbox cannot produce today.
Use this recipe to issue, fund, freeze and change the limit of a sandbox card, to withdraw from it, and to test the purchase and decline screens that sandbox cannot produce today.
Who it is for. An expense-card app that wants to show employees their card, its balance and its status changes before going live.
Status. Available for issuing, funding, reading and updating a virtual card. Withdrawals work in sandbox. Not yet available in sandbox for purchases, declines and physical cards.
Money example
polygon. When the transfer is completed, the card's balance reads 100.{"status": "freeze", "limit": 100}. While the card is frozen, balance reads 0, and Gravv sends cards.status.update.cards.transaction.payment payload to your own endpoint.Before you start
Find out what is required
| Step | In sandbox |
|---|---|
| Card application | Approved at once |
| First card | Issued during feature activation, with a daily limit equal to estimated_monthly_limit |
| Funding | A transfer to the card from a source on polygon. The balance follows the card's wallet |
A daily limit of 0 | Means no limit in sandbox. In live, it declines every payment |
| Purchases and declines | Not yet available |
| Withdrawal | Available, to the card's linked card account or linked wallet. See Withdraw from card |
| Physical cards | Issuance fails with card creation failed! |
Steps
1. Issue the card
Follow Issue a virtual card after a hosted check, with your sandbox key and your verified cardholder.
2. Fund it
Follow Top up a card. In sandbox, a funding transfer sends only transfer.status.pending events. Poll the transaction until it is completed, then read the balance.
3. Freeze it and change its limit
Always send status and limit together.
Unfreeze with {"status": "active", "limit": 100}. Gravv sends cards.status.update for each real status change.
4. Test the purchase and decline screens without a purchase
You cannot produce card purchases in sandbox today. To test your handler:
What can go wrong
| Response | Why | Fix |
|---|---|---|
400 card creation failed! | You requested a physical card in sandbox | Test virtual cards |
The daily limit reads 0 after an update | You sent the update without limit | Send status and limit together |
The card's balance does not move after a funding transfer | The transfer is not completed yet | Poll the transaction |
400 card does not exist | The id is a live card id, or belongs to another business's card | Use a sandbox card id from GET /v1/cards |
Webhooks you will receive
You receive cards.status.update for each real status change. You do not need cards.application.update in sandbox, because sandbox approves the application at once. You receive no purchase events, because sandbox cannot produce purchases.
Testing in sandbox
This page is the sandbox guide for cards. Sandbox also cannot produce refunds, reversals, settlement or foreign-currency purchases.