Generate corrective invoice
Issue a corrective invoice (rectificativa, RD 1619/2012 art. 15) that amends a previously issued invoice.
-
Returns
201with the new invoice:is_corrective: true,correctivepointing at the original, and a number derived from the original's in the same series (F-2026-0042-REC1,-REC2… for successive correctives). -
Flow: the original must already be issued (
sentorpaid) → the corrective is born already issued, never as a draft → when VeriFactu is enabled its alta is transmitted to AEAT asynchronously, so a201does not mean AEAT has accepted it yet. -
The original is never modified: it keeps its number, its status and its own VeriFactu record.
-
A corrective is an additional document, not an edit.
-
Full vs partial.
correction_type: fullis a substitution (VeriFactu natureS): thelinesyou send are the final correct amounts, and omittinglinesentirely turns it into a full cancellation, where every original line is copied back negated and prefixed[ANULACION]. -
correction_type: partialis a correction by differences (natureI):linesis required and each one is a delta — typically negative — prefixed[AJUSTE]. -
In a partial correction a line only moves stock if it declares its own
product_id; in a substitution the product is inherited from the original line at the same index. -
AEAT R code. By default it is derived from
correction_reason:error_fundado→ R1,concurso→ R2,incobrable→ R3, everything else → R4; a corrective of a simplified (F2) invoice is always born R5 regardless of the reason. -
correction_codeoverrides that derivation, but is validated against the legal matrix — original F2 → onlyR5; original F1/F3 → onlyR1–R4. -
Any other combination returns 422 with the legal
allowed_values. -
Limits:
draft,overdue,cancelledandannulledoriginals return 422 (anoverdueinvoice must be paid or voided first); a corrective can never itself be corrected — issue a new corrective of the original instead. -
List every corrective of an invoice with
GET /v1/invoices/{id}/correctives.
In: header
Path Parameters
Headers
Client-generated opaque key (up to 255 characters; UUID v7 recommended) that makes retries safe: the first response is cached and replayed for repeats without re-executing the mutation. Reusing a key with a different body returns 409 idempotency_key_reused. See the Idempotency guide. Required on this operation: repeating it delivers an effect that cannot be taken back (an email sent, a file generated, a third-party call, a charge), so a request without this header is rejected with 422 idempotency_key_required before any business logic runs.
1 <= length <= 255Pin the API version (YYYY-MM-DD, Stripe-style date versioning) for this request; omit to use the key's pinned version, or the latest if none. Unsupported version → 400 unsupported_api_version; malformed → 400 parameter_invalid_format. The effective version is echoed in the Factuarea-Version response header. See the Versioning guide.
dateOperate on behalf of a child company (gestoría master key): pass its public id (UUID v7) and the request runs against that child's data without changing the key's scope, tier or environment (omit to use the key's own company). Invalid UUID → 400 parameter_invalid_uuid; unknown or non-owned id → 404 profile_not_found. See the Acting on behalf guide.
uuidRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json