---
title: "Update a Refund"
method: PATCH
path: "/refunds/{id}"
tags: ["Refunds"]
---

# Update a Refund

`PATCH /refunds/{id}`

## Request

- Base URL: `https://api.justifi.ai/v1`
- URL: `https://api.justifi.ai/v1/refunds/{id}`
- Auth: none declared. Required headers: `Idempotency-Key`, `Authorization`
- TypeScript: <https://skmtc.dev/justifi/apis/justifi-api-documentation/docs/refunds/:id/patch.ts> (a function with typed inputs; its response is checked against the schema)

Update the refund metadata.

## Path parameters

- `id` string, uuid, required

## Headers

- `Idempotency-Key` string, uuid, required
- `Authorization` string, required

## Request body

- object
  - `metadata` object: any useful information you'd like to store alongside this refund; when you update metadata, any previous metadata will be overwritten

## Response `200`

Refund update was successful

- object
  - `id` string, uuid: the object id, also found in the data object
  - `type` string: the object type, or array of objects
  - `data` object: the attributes for the object
    - `id` string: refund unique id
    - `payment_id` string, uuid: the payment for which this refund is being issued
    - `amount` number: the amount of this refund in cents
    - `description` string: an optional note about this refund
    - `reason` 'duplicate' | 'fraudulent' | 'customer_request': the reason this refund is being issued
    - `status` 'pending' | 'succeeded' | 'failed': the status of this refund
    - `metadata` object: any useful information you'd like to store alongside this refund
    - `returned_fees` ReturnedFeeResponse[]: Array of returned fee objects showing the fees returned to the merchant with this refund. Present when fees were specified in the refund request. See [Enhanced Fee Management](https://docs.justifi.tech/api-spec#section/Enhanced-Fee-Management) for full documentation.
      - `id` string, required: Unique identifier for this returned fee
      - `payment_fee_id` string, required: Unique identifier for the original payment fee that was partially or fully returned
      - `type` 'processing_fee' | 'platform_fee', required: The type of fee that was returned: - `processing_fee`: Processing fee returned to merchant - `platform_fee`: Platform fee returned to merchant
      - `returned_amount` integer, required: Amount returned to the merchant in cents
      - `original_amount` integer, required: Original fee amount in cents from the payment
      - `currency` string, required: Currency of the fee amounts
      - `remaining_amount` integer, required: Amount still available for refund on the original payment fee in cents
    - `created_at` string, date-time
    - `updated_at` string, date-time
  - `page_info` unknown

---

[API](https://skmtc.dev/justifi/apis/justifi-api-documentation.md) - [All operations](https://skmtc.dev/justifi/apis/justifi-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/justifi/apis/justifi-api-documentation/revisions/dd9f3fed7e46?raw)
