---
title: "Refund a deposit"
method: POST
path: "/v1/deposits/{depositId}/refund"
tags: ["Deposits"]
---

# Refund a deposit

`POST /v1/deposits/{depositId}/refund`

## Request

- Base URL: `https://api.frihet.io`
- URL: `https://api.frihet.io/v1/deposits/{depositId}/refund`
- Auth: API key in header `X-API-Key`

Refund all or part of a deposit's remaining balance to the client.
If `amount` is omitted, the full remaining balance is refunded.
Returns an error if the deposit is already fully refunded or if the
requested amount exceeds the remaining balance.

## Path parameters

- `depositId` string, required

## Request body

- object
  - `amount` number: Amount to refund. Omit to refund the full remaining balance.

## Response `200`

Deposit refunded successfully

- object
  - `success` boolean
  - `depositId` string
  - `refundedAmount` number
  - `remainingBalance` number

## Other responses

- `400`: Bad request - invalid parameters or request body
- `401`: Authentication required or invalid API key
- `404`: Resource not found
- `429`: Rate limit exceeded (100 requests per minute)
- `500`: Internal server error

---

[API](https://skmtc.dev/frihet/apis/frihet-api.md) · [All operations](https://skmtc.dev/frihet/apis/frihet-api/llms.txt) · [OpenAPI document](https://skmtc.dev/frihet/apis/frihet-api/revisions/3dd37f6a72d1?raw)
