---
title: "Revert an invoice payment"
method: POST
path: "/companies/{company}/invoices/{invoice}/payments/{payment}/reversal"
tags: ["Invoices"]
---

# Revert an invoice payment

`POST /companies/{company}/invoices/{invoice}/payments/{payment}/reversal`

## Request

- Base URL: `https://api.factuarea.com/v1`
- URL: `https://api.factuarea.com/v1/companies/{company}/invoices/{invoice}/payments/{payment}/reversal`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

Void a payment with a required `reason`; the payment stays flagged `is_reversed: true` and is never deleted.
- Irreversible: to restate the collection, register a new payment.
- 422 `payment_already_reversed`, `payment_reversal_reason_invalid` or `reversal_reason_reserved` (`issued_in_error`).
- The invoice returns to `overdue` or `sent`.

## Path parameters

- `company` string, uuid, required
- `invoice` string, uuid, required
- `payment` string, uuid, required

## Headers

- `Idempotency-Key` string, required
- `Factuarea-Version` string, date

## Request body

- RevertInvoicePaymentRequest
  - `reason` string, required: Why the payment is being reverted. One of the closed catalog: `direct_debit_return` (returned SEPA direct debit), `card_dispute` (card chargeback or reversal), `misapplied_payment` (booked against the wrong invoice), `bounced_effect` (dishonoured bill) or `recording_error`. `issued_in_error` also belongs to the catalog but is reserved to annulling the invoice (`POST /v1/companies/{company}/invoices/{invoice}/annul` with `revert_collections=true`): sent here it returns 422 `reversal_reason_reserved`. Any other value returns 422 `payment_reversal_reason_invalid`.
  - `note` string, nullable: Optional free-text remark kept with the reversal trail, up to 500 characters. A longer note returns 422 `payment_reversal_invalid`.

## Response `200`

- object
  - `data` InvoicePaymentDetail, required: A single payment recorded against an invoice (partial payment ledger entry). Listed in `payments.detail[]` (materialized only on the show endpoint) and in the standalone sub-resource `GET /v1/companies/{company}/invoices/{invoice}/payments`.
    - `id` string, required: Opaque UUID v7 of the payment.
    - `object` 'payment', required: String identifying the object type. Always `payment`.
    - `invoice_id` string, required: UUID v7 of the invoice this payment belongs to.
    - `amount` string, required: Payment amount.
    - `payment_date` string, date, required: Payment date (YYYY-MM-DD).
    - `payment_method` string, required: Payment method (backing value of the Shared enum `PaymentMethod`, e.g. `bank_transfer`).
    - `payment_method_text` string, required: Human-readable label of the payment method (Spanish).
    - `reference` string, nullable, required: Payment reference/operation number. `null` if not provided.
    - `notes` string, nullable, required: Internal notes for the payment. `null` if not provided.
    - `is_reversed` boolean, required: Whether the payment has been reverted. A reverted payment stays in the ledger but stops counting towards `paid_amount`, `pending_amount` and every treasury aggregate — read this flag, do not infer the state from absence.
    - `reversed_at` string, date-time, nullable, required: When the payment was reverted (ISO 8601), or `null` while it is in force.
    - `reversal_reason` 'direct_debit_return' | 'card_dispute' | 'misapplied_payment' | 'bounced_effect' | 'recording_error' | 'issued_in_error' | 'null', nullable, required: Reason the payment was reverted, from the closed catalog. `issued_in_error` appears only on payments reverted by annulling an invoice issued by mistake with `revert_collections`; it cannot be requested for a single payment. `null` while the payment is in force.
    - `reversal_reason_text` string, nullable, required: Human-readable label of the reversal reason (Spanish), or `null`.
    - `reversal_note` string, nullable, required: Free-text remark recorded with the reversal (up to 500 characters), or `null`.
    - `created_at` string, date-time, nullable, required: When the payment was recorded (ISO 8601), or `null`.
    - `updated_at` string, date-time, nullable, required: When the payment was last updated (ISO 8601), or `null`.

## Other responses

- `400`: `parameter_unknown` with `subcode` `retired_active_profile_header`: the retired `X-Active-Profile` header was sent; the company goes in the path. `parameter_invalid_format` on `Factuarea-Version`: the header is not a `YYYY-MM-DD` date. `unsupported_api_version`: the `Factuarea-Version` date is not a supported version.
- `401`: Missing or invalid API key.
- `403`: The request is authenticated but not allowed: the API key lacks the required scope (`insufficient_scope`), the plan does not include the public API or this feature (`addon_not_active`, `feature_not_available_in_plan`), or the module is not available with a test key (`module_not_available_in_sandbox`).
- `404`: The requested resource does not exist or belongs to another company.
- `409`: The request conflicts with data that already exists or with a request running at the same time. `resource_conflict`: another request was reserving identifiers for the same kind of record at that moment and this one could not complete its reservation. Nothing was written; send the request again after a few seconds.
- `422`: Validation failed, or the invoice cannot undergo the requested state transition (e.g. marking an already-paid invoice as paid, or editing an issued invoice — use a corrective instead). The `error.param` field identifies which input is invalid, if any. Issuing or annulling an invoice can also be rejected with `verifactu_not_eligible`: either a field of the invoice does not fit its billing record, or — only when the company has VeriFactu enabled in NO VERI*FACTU mode — it has no usable signing certificate (`error.subcode: signing_certificate_unavailable`; `error.param` is `certificate`, `representation` or `system_certificate`, depending on what is missing); in both cases the invoice stays exactly as it was.
- `429`: Rate limit exceeded. Retry after the duration in `Retry-After`.
- `500`: Unexpected server error.

---

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