---
title: "Refund a sale"
method: POST
path: "/v1/sales/{id}/refund"
tags: ["Sales"]
---

# Refund a sale

`POST /v1/sales/{id}/refund`

## Request

- Base URL: `https://api.affiliaterail.com`
- URL: `https://api.affiliaterail.com/v1/sales/{id}/refund`
- Auth: HTTP bearer

Voids the sale's unpaid commissions; an already-paid commission becomes a clawback against the partner's next balance. Replay-safe: refunding twice is a no-op.

**Scope:** `commissions:write` (or `write`)

## Path parameters

- `id` string, required: Prefixed id (`sale_…`)

## Request body

- object
  - `refunded_at` string, date-time
  - `reason` string

## Response `200`

What the refund did

- RefundResult
  - `object` 'refund', required
  - `sale_id` string, required: Prefixed id (`sale_…`)
  - `voided_commissions` integer, required
  - `clawback_minor` integer, required: Integer minor units (cents, pence). Never a float, never a string.
  - `currency` string, required: ISO-4217
  - `refunded_at` string, date-time, required: ISO-8601, UTC

## Other responses

- `400`: Invalid request
- `401`: Missing or unknown API key
- `403`: Key lacks the required scope
- `404`: No such object in your organization
- `422`: The request was understood and refused
- `429`: Rate limited: see Retry-After

---

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