Gravv
/Docs
Search docs or ask a question⌘K
DocsAgent
ChangelogTry sandbox
Recipes Card issuing Freeze or block a lost card

Freeze or block a lost card

Freeze a card while it is missing, unfreeze it when the cardholder finds it, or block a stolen card for good and issue a replacement on the same balance.

5 min read

Use this recipe to freeze a card while it is missing and unfreeze it when the cardholder finds it. If the card is stolen, block it for good and issue a replacement that spends the same balance.

Who it is for. Any issuer whose cardholder taps "freeze card" or reports the card stolen.

Status. Available.

Money example

Ada's card holds 131.25 USD with a 300 USD daily limit.

1.
Ada cannot find her phone, so you freeze the card. balance shows 0, and group_balance still shows 131.25.
2.
Ada finds her phone, so you unfreeze the card. balance is 131.25 again.
3.
Later the card is stolen. You issue a new card, which spends the same 131.25 USD, and then block the stolen one.

Before you start

Read the card. GET /v1/cards/{card_id} returns the current status and spending_controls.daily_transaction_limit. Every update must send that limit back.

The table lists the status changes the API allows.

FromAllowed moves
activefreeze, blocked
freezeactive, blocked
inactiveactive, blocked
blockedNone. blocked is final

If your API key is scoped, it needs card:freeze or card:terminate.

Find out what is required

A freeze is reversible, and a block is permanent. Issue the replacement before you block the stolen card: in sandbox, blocking the last card on a balance sends that balance back to the card account, so a replacement created afterwards starts at 0. In live, the money stays on a blocked card, so if you will not replace it, withdraw the money first. See What happens to the balance and Close a card and get the money back.

Steps

1. Freeze

cURLNodePython
curl --request PATCH \
--url https://api.gravv.xyz/v1/cards/a14ec356-f33d-4384-ba68-4d9bfa19765b/update \
--header 'Api-Key: <API_KEY>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "freeze",
"limit": 300
}
'

2. Unfreeze

cURLNodePython
curl --request PATCH \
--url https://api.gravv.xyz/v1/cards/a14ec356-f33d-4384-ba68-4d9bfa19765b/update \
--header 'Api-Key: <API_KEY>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "active",
"limit": 300
}
'

3. Block a stolen card

cURLNodePython
curl --request PATCH \
--url https://api.gravv.xyz/v1/cards/a14ec356-f33d-4384-ba68-4d9bfa19765b/update \
--header 'Api-Key: <API_KEY>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "blocked",
"limit": 300
}
'

4. Issue a replacement

Send a new Idempotency-Key and no funding, so the new card joins the same balance.

cURLNodePython
curl --request POST \
--url https://api.gravv.xyz/v1/cards \
--header 'Api-Key: <API_KEY>' \
--header 'Idempotency-Key: 5c653268-8d8a-44e9-a6d7-a03a52a2b518' \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": "5b0f6c1e-2a8f-4c39-9d0e-0c7e3b9a1f42",
"card_type": "virtual",
"card_limit": 300,
"name_on_card": "Ada Obi"
}
'
Response
{
"data": {
"message": "Card creation request is processing",
"status": true,
"id": "f4c3b2a1-0e9d-4c8b-a7f6-e5d4c3b2a190",
"fee_charged": false
},
"error": null
}

The new card has a new id, number and PIN.

5. Check the balance

cURLNodePython
curl --request GET \
--url https://api.gravv.xyz/v1/cards/f4c3b2a1-0e9d-4c8b-a7f6-e5d4c3b2a190/balance \
--header 'Api-Key: <API_KEY>'

balance is 131.25. shared reads true, because the blocked card still counts in the group.

What can go wrong

ResponseWhyFix
400 card is blocked and cannot be updatedThe card is already blockedIssue a new card
400 internal server error on a freezeThe status change is not allowed, such as inactive to freezeUse an allowed change. Read the card back, and contact support if it looks wrong
400 an Idempotency-Key is required to issue an additional cardYou sent the replacement request without a keySend a new key
400 Idempotency-Key was already used for a different requestYou reused a key with another bodyUse a new key
403 forbidden, required_any card:freeze, card:terminateThe scoped key has no card permissionsGrant card:freeze or card:terminate
The limit is lost after a freezeYou sent the update without limitSet it again

Webhooks you will receive

You receive cards.status.update for every real change, with event_data.card.status (freeze, active, blocked), card.last4 and card.id. Gravv sends no webhook for a call that keeps the same status.

cards.status.update
{
"event_category": "cards",
"event_type": "cards.status.update",
"event_group_id": "a14ec356-f33d-4384-ba68-4d9bfa19765b",
"event_data": {
"card": {
"customer_id": "5b0f6c1e-2a8f-4c39-9d0e-0c7e3b9a1f42",
"id": "a14ec356-f33d-4384-ba68-4d9bfa19765b",
"last4": "9351",
"name_on_card": "Ada Obi",
"network": "visa",
"status": "freeze"
}
}
}

Testing in sandbox

Every status change works in sandbox. Gravv sends one cards.status.update for each real change, 20 to 60 seconds later. A frozen card shows balance 0 and the full group_balance.

Reference

Was this page helpful? Yes No