> ## 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/void — Void a transaction

> Cancel a transaction with a void reason and employee attribution. Creates a reversal record with negative amounts while maintaining hash chain integrity.

Voiding a transaction cancels it and creates a reversal record in the audit chain. The reversal carries negative amounts that mirror the original transaction, and the rounding delta from the original is correctly reversed — so your rounding exposure accounting stays accurate. The engine enforces time-limit, amount-threshold, and void-reason policies, and every void is analyzed for abuse patterns in the compliance reporting.

## Endpoint

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

## 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 to void (e.g., `TXN-2026-04-14-A82C2EAA`).
</ParamField>

<ParamField body="void_reason" type="string" required>
  Reason code for the void. One of: `customer_changed_mind`, `pricing_error`, `duplicate_transaction`, `employee_error`, `fraud_suspected`.
</ParamField>

<ParamField body="voided_by" type="string" required>
  The employee ID of the person authorizing the void (e.g., `EMP-001`).
</ParamField>

## Example

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

<Note>
  The rounding delta from the original transaction is reversed correctly in the void record — your net rounding exposure is always consistent. Hash chain integrity is maintained: the void record is appended to the chain with its own hash that links back to the original transaction.
</Note>
