---
title: "Refund a charge"
method: POST
path: "/v1/api/accounts/{accountId}/charges/{chargeId}/refunds"
tags: ["Refunds"]
---

# Refund a charge

`POST /v1/api/accounts/{accountId}/charges/{chargeId}/refunds`

## Request

- The document declares no server URL.
- Auth: none declared

## Path parameters

- `accountId` integer, required
- `chargeId` string, required

## Request body

- RefundRequest
  - `amount` integer, required: Amount to refund in pence
  - `refund_amount_available` integer, required: Total amount still available before issuing the refund
  - `user_email` string: Email address of the user refunding payment
  - `user_external_id` string: The ID of the user who issued the refund

## Response `200`

OK

- string

## Other responses

- `400`: Bad request - Invalid fields or not sufficient amount available for refund
- `404`: Not found - gateway account or charge not found
- `412`: Precondition failed - Refund amount available does not match
- `500`: Internal server error

## Changes

- **2024-07-30** `40ec33b20adf`: 1 info
  - added the non-success response with the status `412`

[Operation history](https://skmtc.dev/government-digital-service/apis/connector-api/changes/v1/api/accounts/:accountId/charges/:chargeId/refunds/post.md)

---

[API](https://skmtc.dev/government-digital-service/apis/connector-api.md) - [All operations](https://skmtc.dev/government-digital-service/apis/connector-api/llms.txt) - [OpenAPI document](https://skmtc.dev/government-digital-service/apis/connector-api/revisions/7f294e492d3c?raw)
