# Reverse a recorded payment

`POST /lokta-lms/api/v1/invoices/{invoiceId}/payments/{paymentId}/reversal`

Reverses a payment recorded against a partner invoice, with a reason.

**`reason` is required.** Append-only: the original payment is never edited or deleted; a contra row carries the negative amount, the reason and its own actor, so `sum(amount_paid)` stays the one figure every rule reads. The contra is dated today, not back-dated into a period already reported.

An invoice that was `paid` returns to `approved` when the reversal leaves it short. A reversal cannot itself be reversed (`409 sourcing/payment_not_reversible`) and a payment is reversed once (`409 sourcing/payment_already_reversed`). Record a fresh payment to re-settle.

## Parameters
- `invoiceId` (path, string, required)
- `paymentId` (path, string, required)
- `Idempotency-Key` (header, string): Per-intent key

## Request body (application/json)
- `reason` (string, required): Why the payment is being reversed.

## Responses
- `default`: default response

## Example request (cURL)
```bash
curl -X POST \
  'https://default.lokta.tech/lokta-lms/api/v1/invoices/{invoiceId}/payments/{paymentId}/reversal' \
  -u '{username}:{password}' \
  -H 'Tenant-Identifier: default' \
  -H 'Content-Type: application/json' \
  -d '{
  "reason": "string"
}'
```

Interactive: https://developer.lokta.ai/reference#operation/reversePayment
