Gravv
/Docs
Search docs or ask a question⌘K
DocsAgent
ChangelogTry sandbox
Recipes Card issuing Change a card's daily limit

Change a card's daily limit

Raise or lower how much a card can spend per day. Send the card's current status with the new limit.

4 min read

Use this recipe to raise or lower how much a card can spend per day. You send the card's current status with the new limit.

Who it is for. A consumer app that lets Ada raise her limit for a trip, or an expense platform that caps a driver's daily spend.

Status. Available.

Money example

Ada's card has a 300 USD daily limit and 900 USD on it.

1.
Ada travels and must pay a 750 USD hotel bill. You raise the limit to 1,000 USD a day.
2.
Ada pays 750 USD. The card now holds 150 USD.
3.
After the trip, you set the limit back to 300 USD a day.
Warning

PATCH /v1/cards/{card_id}/update sets the status and the limit in one body. An update without limit saves the limit as 0. In live, the card then declines every payment. In sandbox, 0 means no limit, so the card loses its cap. Always send the current status and the intended limit.

Before you start

•
The card is not blocked.
•
If your API key is scoped, it holds card:freeze or card:terminate.

Find out what is required

cURLNodePython
curl --request GET \
--url https://api.gravv.xyz/v1/cards/a14ec356-f33d-4384-ba68-4d9bfa19765b \
--header 'Api-Key: <API_KEY>'

Read status, which you send back unchanged. Read spending_controls.daily_transaction_limit, which is the current limit in whole dollars.

Steps

1. Raise the limit

This route takes no Idempotency-Key.

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": 1000
}
'

The response is the whole card, with spending_controls.daily_transaction_limit 1000.

•
limit is a whole number of dollars per day, sent as an integer such as 1000.
•
In live, the limit counts over a rolling 24 hours. In sandbox, it applies to each payment and to the day.

2. Set it back

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
}
'

What can go wrong

ResponseWhyFix
Every payment declines after a status change (live)You sent the update without limitSend {"status": "<current>", "limit": <intended>} now
The card spends without a cap (sandbox)You sent the update without limit, and 0 means no limit in sandboxSend {"status": "<current>", "limit": <intended>} now
400 status is requiredYou sent only limit, or left out Content-Type: application/jsonSend both fields with the header
400 json: cannot unmarshal number 1000.5 into Go struct field Body.limit of type intThe limit is a decimal or a stringSend a whole number
400 unexpected EOFThe JSON is malformedSend valid JSON
400 card is blocked and cannot be updatedThe card is blockedIssue a new card
400 invalid status selectedThe status is not active, freeze or blockedUse one of those three
400 failed to update card statusThe card program refused the updateRetry, then read the card back
400 card status changed concurrently, please retryTwo updates ran at the same timeRetry

Webhooks you will receive

Gravv sends no webhook for a limit-only change.

Testing in sandbox

Run the steps on a sandbox card and read the limit back with GET /v1/cards/{card_id}. You cannot make a card spend through the API in sandbox today, so you cannot produce a limit decline.

Reference

Was this page helpful? Yes No