> ## Documentation Index
> Fetch the complete documentation index at: https://docs.centsless.org/llms.txt
> Use this file to discover all available pages before exploring further.

# POST /transaction/refund — Process a refund

> Process a full or partial cash refund. The engine checks that the refund rounding delta correctly reverses the original transaction. Normalization failures are flagged, not blocking.

The refund endpoint handles both full and partial refunds for completed transactions. When you submit a refund, the engine performs a rounding normalization check: it verifies that the refund's rounding delta correctly mirrors the direction of the original transaction's rounding. This prevents scenarios where a customer is refunded a rounded amount that doesn't correspond to what they originally paid. The refund is committed to the audit hash chain as a separate record linked to the original transaction ID.

## Endpoint

```
POST https://api.centsless.org/api/v1/transaction/refund
```

## Authentication

<ParamField header="x-api-key" type="string" required>
  Your merchant or partner API key.
</ParamField>

## Request body

<ParamField body="original_transaction_id" type="string" required>
  The ID of the transaction being refunded.
</ParamField>

<ParamField body="refund_amount" type="integer" required>
  Refund amount in cents. For a full refund, pass the original `cash_total_cents`. For a partial refund, pass the partial amount.
</ParamField>

<ParamField body="void_reason" type="string" required>
  Reason code for the refund. One of: `defective_product`, `customer_dissatisfied`, `wrong_item`, `price_adjustment`.
</ParamField>

<ParamField body="voided_by" type="string" required>
  The employee ID of the person processing the refund.
</ParamField>

## Example

```bash theme={null}
curl -X POST https://api.centsless.org/api/v1/transaction/refund \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "original_transaction_id": "TXN-2026-04-14-A82C2EAA",
    "refund_amount": 725,
    "void_reason": "defective_product",
    "voided_by": "EMP-001"
  }'
```

<Note>
  If the normalization check detects that the refund rounding delta does not correctly reverse the original transaction's direction, the failure is flagged in the response and logged to the audit trail — but the refund is not blocked. Review flagged refunds in the void analytics and compliance reports.
</Note>
