Gravv
/Docs
Search docs or ask a question⌘K
DocsAgent
ChangelogTry sandbox
Collections Retry a refund

Retry a refund

Sends a failed refund again. It works only while the collection's `onramp_status` is `refund_failed`, and `refund_id` must be one of the collection's refunds from List refunds. The response and webhooks are the same as for Refund a collection.

POSThttps://api.gravv.xyz/v1/collections/{id}/refunds/{refund_id}/retryTry it
Api-Key

Path parameters

NameDescription
id:stringRequired
The collection's transaction_id
refund_id:stringRequired
The failed refund's refund_id

Headers

NameDescription
Idempotency-Key:stringRequired
Required for POST requests. Reuse it only to retry the same request. Gravv stores a 400 with the key for 24 hours, so use a new key after you fix a rejected body.

Response

Returns 200 OK. The refund was sent again

NameDescription
data:object
Show 4 child attributesobject
error:null

Errors

StatusMeaning
200The refund was sent again
400The retry was refused. A refund_id that is not on this collection returns refund not found for this transaction: resource not found. A collection that is not refund_failed returns cannot perform 'retry_refund' in state '<status>': ….
Was this page helpful? Yes No
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl --request POST \
--url 'https://api.gravv.xyz/v1/collections/07b655cc-3dbd-4f6c-a16c-4657946d2e08/refunds/8c1e4b2a-7f3d-4a6e-b9c0-2d5f8e1a7b34/retry' \
--header 'Api-Key: <api-key>' \
--header 'Idempotency-Key: order_789_attempt_1'
Responseapplication/json
200400OK
{
"data": {
"success": true,
"transaction_id": "07b655cc-3dbd-4f6c-a16c-4657946d2e08",
"refund_id": "8c1e4b2a-7f3d-4a6e-b9c0-2d5f8e1a7b34",
"status": "pending"
},
"error": null
}