Gravv
/Docs
Search docs or ask a question⌘K
DocsAgent
ChangelogTry sandbox
Cards Withdraw from a card

Withdraw from a card

Moves money from an `active`, frozen or `blocked` card back to its linked card account or linked wallet. One call works for every card: some pay out straight away (`status` `completed`, with `tx_hash`), the others by transfer (`status` `pending`, with `transfer_id`). Gravv sends the `cards.transaction.withdraw` webhook when the withdrawal ends. A call that errors or times out may still have moved the money: read the card balance and your webhooks before you retry with a new Idempotency-Key.

POSThttps://api.gravv.xyz/v1/cards/withdrawTry it
Api-Key

Headers

NameDescription
Idempotency-Key:stringRequired
1 to 255 printable ASCII characters. A retry with the same key within 24 hours returns the first response. Use a new key for each new card or withdrawal, and the same key to retry a failed one.

Body parameters

NameDescription
card_id:stringRequired
amount:numberRequired
USD, as a JSON number with at most 2 decimal places, not more than the card's balance

Response

Returns 200 OK. The withdrawal is done (completed) or on its way (pending)

NameDescription
data:object
Show 4 child attributesobject
error:null

Errors

StatusMeaning
200The withdrawal is done (completed) or on its way (pending)
400The card is inactive, the amount is not positive, or the balance is too low
Was this page helpful? Yes No
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl --request POST \
--url 'https://api.gravv.xyz/v1/cards/withdraw' \
--header 'Api-Key: <api-key>' \
--header 'Idempotency-Key: issue-card-jane-1' \
--header 'Content-Type: application/json' \
--data '{
"card_id": "dce0192a-9b3d-440b-9500-33dc9ac8dc20",
"amount": 20
}'
Responseapplication/json
200400OK
{
"data": {
"tx_hash": "0x2e5d0af9189b4b4c23bc64b96295e730609ec91e50e452a5da0a4af4bfe5c192",
"status": "completed",
"route": "card"
},
"error": null
}