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

# Reverse a receipt

> Record that reported money was not real. The receipt stays readable, marked reversed, and every figure derives again without it.

A reversal records that the money behind a Receipt was not real — a chargeback, a returned transfer, an operator's mistake. It is a further fact, not a deletion: the Receipt stays readable, and everything it had settled stands owed again, a closure it had caused included. [Payments](/lending/payments) carries the worked reversal; money that was real and must go back to the borrower is not a reversal's case.

## Path parameters

<ParamField path="tenant_id" type="string" required>
  The Tenancy acting.
</ParamField>

<ParamField path="reference" type="string" required>
  The Receipt to reverse, by your own reference.
</ParamField>

## Body

All four fields are required; an absent body is refused `422`.

<ParamField body="reference" type="string" required>
  Your name for the reversal, in the one act namespace of the Tenancy.
</ParamField>

<ParamField body="actor" type="string" required>
  Whoever reversed it, your own reference.
</ParamField>

<ParamField body="basis" type="string" required>
  Why, in your words.
</ParamField>

<ParamField body="reason" type="string" required>
  One of `chargeback`, `returned_transfer`, `operator_error` — the one closed vocabulary any act carries.
</ParamField>

## Response

`201` with the Receipt as it now reads: `reversed` true, `reversed_at`, and the `reversal` block carrying this body. The allocation section reads empty — nothing stands settled by a reversed Receipt. Retry `200`; a differing body under the recorded `reference`, `409` `reference_reused`.

## Refusals

| Condition | Status and code |
| - | - |
| The Receipt is already reversed | <Badge color="red">409</Badge> `already_reversed` |
| No such Receipt | <Badge color="orange">404</Badge> `no_receipt` |
| A missing field, a reason outside the three | <Badge color="orange">422</Badge> — refused by name |

<RequestExample>
  ```bash Reverse theme={null}
  BODY='{
    "reference": "reversal-0001",
    "actor": "ops-0007",
    "basis": "the SPEI transfer was returned by the sending bank",
    "reason": "returned_transfer"
  }'

  curl -X POST "https://api.capcells.com/v1/tenants/$TENANT_ID/receipts/receipt-0001/reversal" \
    -H "Authorization: $(capcells_sign "$CAPCELLS_API_KEY" POST "/v1/tenants/$TENANT_ID/receipts/receipt-0001/reversal" "$BODY")" \
    -H "Content-Type: application/json" \
    -d "$BODY"
  ```
</RequestExample>

<ResponseExample>
  ```json 201, the Receipt as it now reads theme={null}
  {
    "receipt": {
      "reference": "receipt-0001",
      "client_id": "c-0001",
      "amount": { "minor_units": 90066, "currency": "MXN" },
      "value_date": "2026-04-06",
      "reversed": true,
      "reversed_at": "2026-08-31T11:29:29.307176Z",
      "reversal": {
        "reference": "reversal-0001",
        "actor": "ops-0007",
        "basis": "the SPEI transfer was returned by the sending bank",
        "reason": "returned_transfer"
      }
    },
    "settled": { "minor_units": 0, "currency": "MXN" },
    "loans": [],
    …
  }
  ```

  ```json 409 Reversed twice theme={null}
  {
    "error": "loan: receipt is already reversed: receipt-0001",
    "code": "already_reversed"
  }
  ```
</ResponseExample>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.