POST
/
transactions
/
{transaction_id}
/
refunds
/
all
curl --request POST \
  --url https://api.{gr4vy_id}.gr4vy.app/transactions/{transaction_id}/refunds/all \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "reason": "Refund due to user request"
}'
{
  "items": [
    {
      "type": "refund",
      "id": "8724fd24-5489-4a5d-90fd-0604df7d3b83",
      "transaction_id": "fe26475d-ec3e-4884-9553-f7356683f7f9",
      "payment_service_refund_id": "refund_xYqd43gySMtori",
      "status": "processing",
      "currency": "USD",
      "amount": 1299,
      "reason": "Refund due to user request",
      "created_at": "2013-07-16T19:23:00.000+00:00",
      "updated_at": "2013-07-16T19:23:00.000+00:00",
      "target_type": "payment-method",
      "target_id": "c23ea83f-1b1c-4584-a0e8-78ef8c041949",
      "external_identifier": "refund-789123",
      "reconciliation_id": "7jZXl4gBUNl0CnaLEnfXbt",
      "transaction_external_identifier": "transaction-789123",
      "transaction_reconciliation_id": "7jZXl4gBUNl0CnaLEnfXbt"
    }
  ],
  "limit": 1,
  "next_cursor": "ZXhhbXBsZTE",
  "previous_cursor": null
}

This endpoint requires the transactions.write scope.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

transaction_id
string
required

The ID for the transaction to get the information for.

Body

application/json

A request to fully refund a transaction.

reason
string | null

The reason to refund for. This can be used to attach a written reason to the refund request.

Maximum length: 100
external_identifier
string | null

An external identifier that can be used to match the refund against your own records.

Required string length: 1 - 300

Response

201
application/json
Returns the created refunds. Not all refunds may have succeeded.

A list of refunds.

items
object[]

A list of refunds.

A refund record.

A refund is always associated with a single transaction, while a transaction can potentially have several refunds.

limit
integer
default:
20

The limit applied to request. This represents the number of items that are at maximum returned by this request.

Required range: 1 <= x <= 100
next_cursor
string | null

The cursor that represents the next page of results. Use the cursor query parameter to fetch this page of items.

Required string length: 1 - 1000
previous_cursor
string | null

The cursor that represents the next page of results. Use the cursor query parameter to fetch this page of items.

Required string length: 1 - 1000