Refunds a card collection to the payer's card. Only card collections (`card`, `apple_pay` and `google_pay`) can be refunded, and only once their `transaction_status` is `completed`. Each collection takes one refund. Leave out `amount_cents` to refund the whole payment, or send less for a partial refund. A partial refund still uses up the one refund.
POSThttps://api.gravv.xyz/v1/collections/{id}/refundTry it
Api-Key
Refunds a card collection to the payer's card. Only card collections (card, apple_pay and google_pay) can be refunded, and only once their transaction_status is completed. Each collection takes one refund. Leave out amount_cents to refund the whole payment, or send less for a partial refund. A partial refund still uses up the one refund.
A pending refund finishes later. Gravv then sends collection.status.refunded, or collection.status.failed with onramp_statusrefund_failed. Gravv also sends collection.status.refund_pending or collection.status.refunded as soon as you call this endpoint.
Path parameters
NameDescription
id:stringRequired
The collection's transaction_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.
Body parameters
NameDescription
amount_cents:integer
The amount to refund, in US cents. Leave it out to refund the whole payment. Send less than the payment for a partial refund.
reason:string
Why you are refunding the payment
Response
Returns 200 OK. The refund started
NameDescription
data:object
Show 4 child attributesobject
success:boolean
transaction_id:string
The collection's transaction_id
refund_id:string
The refund's ID. Use it to retry the refund if it fails.
status:string
succeeded means the money is on its way back to the card and the collection is refunded. pending means the refund is in progress and the collection is refund_pending.
Possible values: pending, succeeded
error:null
Errors
Status
Meaning
200
The refund started
400
The refund was refused. A collection that is not completed, or that already has a refund, returns cannot perform 'refund_collection' in state '<status>': …. When the refund is declined, the collection moves to refund_failed and Gravv sends collection.status.failed. Retry it with the refund_id from List refunds. If List refunds shows no refund, contact Gravv support.