Top up a card
Move money onto a card from a wallet-backed account or a USDC wallet on the card's network, and confirm that it arrived.
This recipe moves money onto a card from a wallet-backed account or a USDC wallet on the card's network, and confirms that the money arrived.
Who it is for. Any card issuer that moves money onto a card. For example, a consumer app lets Ada move part of her USD balance to her card.
Status. Available.
Money example
Ada's USD account holds 400 USD. Her card holds 0.
Before you start
| Prerequisite | How to check |
|---|---|
| The card is not frozen or blocked | GET /v1/cards/{card_id} returns status active |
| The source is an account with a wallet, or a wallet holding USDC | GET /v2/accounts/{id} has wallet_address and blockchain_network; GET /v1/wallets/{wallet_id} has network and a USDC balance |
| The source and the card are on the same network | GET /v1/cards?card_id=… returns the card's blockchain_network |
| The source covers the amount and any fee | The account's balance, or the wallet's USDC balance |
A bank-held account, with no wallet, cannot fund cards.
Find out what is required
Use the reads in the table above. Gravv has no separate funding endpoint. To fund a card, send a transfer whose destination is the card.
Steps
1. Send the transfer
From an account:
From a USDC wallet:
amount is a string in dollars, with at most 2 decimals ("150", "12.50").transfer_status pending is normal. paused means your limits held the transfer. See Stay within transfer limits.2. Wait for the transfer to complete
Poll the transaction until status is completed or failed. In sandbox, the transfer takes about 75 seconds to complete.
A completed funding has transaction_type card_funding, receiving_account_id set to the card id, and a tx_hash. Poll rather than wait for webhooks, because Gravv does not guarantee the completion events for a funding.
3. Confirm the balance
What can go wrong
| Response (HTTP 400) | Why | Fix |
|---|---|---|
this card is freeze and cannot be funded / this card is blocked and cannot be funded | The card is frozen or blocked | Unfreeze it. You cannot use a blocked card again |
no card account found for id <card> (customer <id>) | The card id is wrong | Check it with GET /v1/cards?card_id=… |
the destination card has no wallet provisioned yet | The card is not issued yet | Issue the card first |
the source account (ethereum network) and destination (polygon network) must be on the same blockchain network | The source is on another network | Use a source on the card's network |
this account can only send to a bank account or to another account held at the same bank | The source is a bank-held account | Use a wallet-backed account or a USDC wallet |
insufficient balance | The amount plus the fee is above the source balance | Lower the amount or fund the source |
the source account could not be verified for this transfer — please try again shortly | A temporary check failed | Retry once with a new key. If it repeats, contact support |
amount must have at most 2 decimal places | The amount has too many decimals | Use at most 2 decimals |
source_type must be one of: internal_account, internal_crypto_wallet, card | You sent crypto_wallet as a source | Use internal_crypto_wallet |
200 with transfer_status paused | A limit paused the transfer | Respond to the pause as in Stay within transfer limits |
Never retry a 400 with the same key. Use a new one.
Webhooks you will receive
Gravv does not guarantee these events, and they do not arrive in a fixed order.
transfer.status.pending, one or more, with workflow_type card_funding.transfer.status.completed, with amount, tx_hash and destination_id.cards.transaction.funding, with transaction.amount (a JSON number) and transaction.status. Its client_reference can be empty, so match on tx_hash.transfer.status.failed.Testing in sandbox
polygon, so use a source on polygon.completed.transfer.status.pending events, so poll the transaction.