Factuarea APIDevelopers
Contract

Corrective invoices now take over the debt they correct

An invoice replaced by a corrective invoice no longer asks to be paid, a credit note lowers what the invoice it credits still owes, and the payments recorded on the original count for its replacement. The invoice carries three new keys, superseded_by, credited_amount and inherited_paid_amount, and paid_amount and pending_amount change value on these chains. A manual payment on a replaced original answers 422, and so does a reminder for it. Thirty-one updated operations, with their MCP tools.

23 November 2026 — Until now, an invoice with corrective invoices went on asking for its whole amount. The original of a corrective invoice by substitution stayed pending even when the customer paid the corrective, and a credit note did not lower what the invoice it credited still owed. From today the API v1, MCP and webhooks follow the whole chain of rectifications. The invoice carries three new keys, and paid_amount and pending_amount change value on these chains. Nothing else in its shape changes.

What a rectification chain is

A rectification chain is an invoice and the corrective invoices that correct it. For collection, each corrective invoice does one of three things:

Corrective invoiceWhat it does to collection
By substitution (correction_type: full with the final lines)It replaces the original and carries the debt. The original is not voided, but it stops asking for payment: it stops becoming overdue and it publishes 0.00 as paid and as pending. An original that was already overdue goes back to issued when the corrective invoice replaces it; until that clean-up runs, its status can still read overdue, although nothing is due on it.
Credit note: by differences, with a negative amountIt is deducted from the live invoice of the chain: the original or, when the credit note was issued after a replacement, the replacement. The credit note itself has nothing to collect.
By differences that raises the amountIt is collected on its own, as before.

A credit note issued before a replacement is not deducted from it, because the replacement already states the amounts as they end up. The payments recorded on the original count for its replacement. We do not move them: they stay listed on the original.

Three new keys

Every invoice carries them: in the API v1, in the MCP tools that return an invoice and in the webhook events that carry one. All three are always present, and status keeps its catalog of values.

KeyValue
superseded_by{ "id", "number" } of the corrective invoice by substitution that replaced this invoice, with its UUID v7 as id. null when the invoice has not been replaced.
credited_amountWhat the credit notes of the chain deduct from what this invoice demands, as a string with two decimals. "0.00" when none applies.
inherited_paid_amountThe payments recorded on the original that count for this corrective invoice by substitution, as a string with two decimals. "0.00" when none applies. It is included in paid_amount.

An invoice without corrective invoices carries null, "0.00" and "0.00", and the rest of its keys keep their value.

The original FAC-2026-00042, replaced by R-2026-002. It publishes 0.00 as paid and as pending, whatever had been recorded on it:

{
  "id": "01931b3e-7c4a-7f2e-9a8b-3c5d6e7f8a42",
  "number": "FAC-2026-00042",
  "status": "issued",
  "total_to_pay": "1210.00",
  "paid_amount": "0.00",
  "pending_amount": "0.00",
  "credited_amount": "0.00",
  "inherited_paid_amount": "0.00",
  "superseded_by": {
    "id": "01931b3e-7c4a-7f2e-9a8b-3c5d6e7f8a61",
    "number": "R-2026-002"
  }
}

The replacement R-2026-002 states the corrected amount, 1,815.00, and FAC-2026-00042 had a payment of 500.00 recorded. The payment counts here:

{
  "id": "01931b3e-7c4a-7f2e-9a8b-3c5d6e7f8a61",
  "number": "R-2026-002",
  "status": "partially_paid",
  "total_to_pay": "1815.00",
  "paid_amount": "500.00",
  "pending_amount": "1315.00",
  "credited_amount": "0.00",
  "inherited_paid_amount": "500.00",
  "superseded_by": null
}

An invoice of 1,815.00 with a credit note of 300.00 and no payments:

{
  "id": "01931b3e-7c4a-7f2e-9a8b-3c5d6e7f8a43",
  "number": "FAC-2026-00043",
  "status": "issued",
  "total_to_pay": "1815.00",
  "paid_amount": "0.00",
  "pending_amount": "1515.00",
  "credited_amount": "300.00",
  "inherited_paid_amount": "0.00",
  "superseded_by": null
}

paid_amount and pending_amount follow the chain

On a live invoice the relation is now pending_amount = total_to_pay - credited_amount - paid_amount. The shape of both keys does not change. Their value does, in these cases:

Invoicepaid_amountpending_amount
Original replaced by a corrective invoice0.00, even if payments were recorded on it0.00; before, its whole amount
Corrective invoice that replaces itIts own payments plus the ones inherited from the originalIts amount, minus the credit notes issued after it, minus paid_amount
Invoice with credit notesIts own paymentstotal_to_pay - credited_amount - paid_amount; before, the credit notes were ignored
Credit noteIts own payments0.00; before, a negative amount
Any other invoiceUnchangedUnchanged

These are corrections of values that misled on a chain, so they apply from the day we deploy, with no notice period. When a corrective invoice leaves an overdue invoice with nothing to pay, the invoice goes back to issued, and the daily sweep that marks invoices overdue no longer marks an invoice with nothing to pay.

A payment on a replaced original is refused

POST /v1/companies/{company}/invoices/{invoice}/payments, and its MCP tool register_invoice_payment, answer 422 when the invoice was replaced by a corrective invoice by substitution. The message names the corrective invoice, so register the payment there, using the superseded_by.id you read on the original. No payment is created.

{
  "error": {
    "type": "invalid_request_error",
    "code": "business_rule_violation",
    "subcode": "invoice_superseded_by_corrective",
    "message": "Esta factura está sustituida por la rectificativa R-2026-002. Registra el cobro en la rectificativa.",
    "doc_url": "https://docs.factuarea.com/guides/errors#business_rule_violation",
    "request_id": "req_2b9f60d3e8a1c7054f6e3a8d19"
  }
}
  • The envelope is the canonical one. The 422 for a status that does not take payments, such as a draft, now arrives in the same envelope, with error.code: business_rule_violation and error.subcode: invoice_not_payable. Before, the REST route answered a bare message and the MCP tool failed with an internal error. Both now give the same status, code, subcode and message. Branch on error.subcode.
  • mark-paid refuses it too. POST /v1/companies/{company}/invoices/{invoice}/mark-paid, and mark_invoice_as_paid, answer 422 with error.code: invalid_status_transition and the same message when the invoice was replaced. They also refuse an invoice whose credit notes leave nothing to pay, and mark-paid on an invoice with credit notes registers what remains, not its whole amount.
  • What is still accepted. The payments already recorded on the original stay where they are and count for the corrective invoice. A payment that reaches the original from a payment gateway is accepted and counts in the chain.

Reminders

POST /v1/companies/{company}/invoices/{invoice}/reminder-preview and send-reminder, with their MCP tools preview_invoice_reminder and send_invoice_reminder, answer 422 reminder_not_applicable when no reminder makes sense: the invoice was replaced by a corrective invoice, and the message says to remind from the corrective, or nothing is outstanding after its credit notes. The preview used to render these cases and now rejects them like the send does.

{
  "error": {
    "type": "invalid_request_error",
    "code": "reminder_not_applicable",
    "message": "Esta factura está sustituida por la rectificativa R-2026-002: el recordatorio se envía desde la rectificativa.",
    "doc_url": "https://docs.factuarea.com/guides/errors#reminder_not_applicable",
    "request_id": "req_a4d07e51c9b3f8260e1d5c7a93"
  }
}

The reminder of an invoice with credit notes, its email and its payment button ask for what remains. The public page of a replaced original says that it was replaced and offers no payment.

Lists and totals

These values change without any change of shape, so their operations are not among the updated ones below.

  • Filters by status. status=issued and status=overdue on GET /v1/companies/{company}/invoices, and on search_invoices, no longer return an invoice that its chain leaves with nothing to pay: a replaced original or one credited in full. Both still come back when you list without a status filter.
  • Invoice statistics. revenue_total, pending_amount and overdue_amount of GET /v1/companies/{company}/invoices/stats, and of get_invoice_stats, add what each invoice demands after its chain. A replaced original and a credit note add 0.00, the invoice they credit adds what remains and the replacement adds its own amount, so the operation counts once.
  • Contacts. financial_summary.sales of a contact no longer adds an original and its replacement: invoiced_amount counts the operation once, collected_amount includes what was inherited and receivable_amount is what remains.
  • Account summaries. total_invoiced of GET /v1/accounts/{account}/companies/stats, and of get_companies_stats, follows the same rule.

The Dashboard, the contact page, the agenda and the overdue notices of the app follow the same rule.

Each invoice of a chain emits its own invoice.paid, once, when it becomes paid. Two cases of a chain emit it without a payment being registered on that invoice:

  • A replacement that inherits payments. When a corrective invoice by substitution is issued and the payments inherited from its original cover it, it emits its own invoice.paid at that moment. If the original had already emitted its own when it was paid, that one is not repeated: the replacement's comes in addition to it.
  • A credit note that completes a collection. When a credit note leaves an invoice covered by what was already collected, for example 700.00 collected on an invoice of 1,000.00 and a credit note of 300.00, that invoice emits invoice.paid at that moment, with no new payment.

What does not change

  • The original is not voided. Nothing new is declared to the AEAT or registered in VERI*FACTU.
  • Tax models and sales figures. The Modelo 303, the 347, the 130 and the sales of the Dashboard already used the amount of each corrective invoice and do not change.
  • status. It keeps its catalog of values.
  • Corrective invoices that raise the amount. They are collected on their own.

What to check in your integration

  • Where you register payments. If you register payments on an invoice that may have been replaced, read superseded_by first and register on superseded_by.id, or handle the invoice_superseded_by_corrective subcode.
  • Totals you compute yourself. Do not add an original and its replacement. To know what is owed, use pending_amount. To know what a live invoice demands, use total_to_pay - credited_amount.
  • Values you stored. If you saved paid_amount or pending_amount of invoices with corrective invoices, read them again.
  • Cached originals. We send no event of its own for the original when a corrective invoice replaces it. invoice.rectified refers to it, so read the original again when it arrives.
  • Handlers of invoice.paid. The event can arrive for a replacement that inherits payments and for an invoice that a credit note completes, with no payment registered on it. When the original and its replacement both emit it, do not add their paid_amount to know what was collected: the payments of the original count for the replacement.
  • Error handling. For a payment, branch on error.subcode: invoice_superseded_by_corrective and invoice_not_payable. For a reminder, on reminder_not_applicable.
  • SDKs. They pin their own generated catalogs. Check the version you have installed before relying on the typed keys; the JSON always carries them.

Where the invoice carries the keys

  • REST and MCP. The operations in the table below that return an invoice, with their MCP tools: list, read, find by number or external id, create, update, duplicate, issue, send, mark as sent, clear the delivery mark, schedule, reschedule, unschedule, annul, void, mark as paid, assign the real number, correct, list the corrective invoices, substitute a simplified invoice, and convert a quote, a proforma or a delivery note.
  • Events and deliveries. The list and the detail of the events, and the deliveries of a webhook endpoint, show the invoice that each event carries.
  • Webhooks. The 25 invoice.* events, the three facturae.face_* events, order.invoiced and order.refunded.

Operations in this release

OperationoperationIdMCP toolWhat changes
GET /v1/companies/{company}/invoicespublic-api.v1.invoices.listsearch_invoicesEach invoice carries the three keys, and its paid_amount and pending_amount follow the chain. status=issued and status=overdue no longer return an invoice that its chain leaves with nothing to pay.
POST /v1/companies/{company}/invoicespublic-api.v1.invoices.createcreate_invoiceThe invoice carries the three keys.
GET /v1/companies/{company}/invoices/{invoice}public-api.v1.invoices.showget_invoiceThe invoice carries the three keys, and its paid_amount and pending_amount follow the chain. The contract adds the examples of an original replaced by a corrective invoice and of an invoice with a credit note.
PATCH /v1/companies/{company}/invoices/{invoice}public-api.v1.invoices.updateupdate_invoiceThe invoice carries the three keys.
POST /v1/companies/{company}/invoices/find-by-numberpublic-api.v1.invoices.find_by_numberfind_invoice_by_numberThe invoice carries the three keys, and its paid_amount and pending_amount follow the chain.
POST /v1/companies/{company}/invoices/find-by-external-idpublic-api.v1.invoices.find_by_external_idfind_invoice_by_external_idThe invoice carries the three keys, and its paid_amount and pending_amount follow the chain.
POST /v1/companies/{company}/invoices/{invoice}/duplicatepublic-api.v1.invoices.duplicateduplicate_invoiceThe invoice carries the three keys.
POST /v1/companies/{company}/invoices/{invoice}/issuepublic-api.v1.invoices.issueissue_invoiceThe invoice carries the three keys.
POST /v1/companies/{company}/invoices/{invoice}/sendpublic-api.v1.invoices.sendsend_invoiceThe invoice carries the three keys.
POST /v1/companies/{company}/invoices/{invoice}/mark-sentpublic-api.v1.invoices.mark_sentmark_invoice_as_sentThe invoice carries the three keys.
POST /v1/companies/{company}/invoices/{invoice}/unsendpublic-api.v1.invoices.unsendmark_invoice_unsentThe invoice carries the three keys.
POST /v1/companies/{company}/invoices/{invoice}/mark-paidpublic-api.v1.invoices.mark_paidmark_invoice_as_paidThe invoice carries the three keys, and its paid_amount and pending_amount follow the chain. On a replaced original it answers 422 invalid_status_transition, and it registers what remains of an invoice with credit notes.
POST /v1/companies/{company}/invoices/{invoice}/schedulepublic-api.v1.invoices.scheduleschedule_invoiceThe invoice carries the three keys.
PATCH /v1/companies/{company}/invoices/{invoice}/reschedulepublic-api.v1.invoices.reschedulereschedule_invoiceThe invoice carries the three keys.
POST /v1/companies/{company}/invoices/{invoice}/unschedulepublic-api.v1.invoices.unscheduleunschedule_invoiceThe invoice carries the three keys.
POST /v1/companies/{company}/invoices/{invoice}/annulpublic-api.v1.invoices.annulannul_invoiceThe invoice carries the three keys.
POST /v1/companies/{company}/invoices/{invoice}/voidpublic-api.v1.invoices.voidvoid_invoiceThe invoice carries the three keys.
POST /v1/companies/{company}/invoices/{invoice}/assign-real-numberpublic-api.v1.invoices.assign_real_numberassign_invoice_real_numberThe invoice carries the three keys.
POST /v1/companies/{company}/invoices/{invoice}/correctivepublic-api.v1.invoices.correctivecreate_corrective_invoiceThe corrective invoice carries the three keys.
GET /v1/companies/{company}/invoices/{invoice}/correctivespublic-api.v1.invoices.correctivesget_invoice_correctivesEach corrective invoice carries the three keys, and its paid_amount and pending_amount follow the chain.
POST /v1/companies/{company}/invoices/substitute-simplifiedpublic-api.v1.invoices.substitute_simplifiedsubstitute_simplified_invoiceThe invoice carries the three keys.
POST /v1/companies/{company}/invoices/{invoice}/paymentspublic-api.v1.invoices.payments_createregister_invoice_paymentOn an original replaced by a corrective invoice it answers 422 business_rule_violation with the subcode invoice_superseded_by_corrective. The 422 for a status that does not take payments uses the same envelope, with invoice_not_payable.
POST /v1/companies/{company}/invoices/{invoice}/reminder-previewpublic-api.v1.invoices.reminder_previewpreview_invoice_reminderIt answers 422 reminder_not_applicable when the invoice was replaced by a corrective invoice or nothing is outstanding after its credit notes.
POST /v1/companies/{company}/invoices/{invoice}/send-reminderpublic-api.v1.invoices.send_remindersend_invoice_reminderIt answers 422 reminder_not_applicable when the invoice was replaced by a corrective invoice or nothing is outstanding after its credit notes. The contract now declares this answer, with its example.
POST /v1/companies/{company}/quotes/{quote}/convertpublic-api.v1.quotes.convertconvert_quoteThe invoice it creates carries the three keys.
POST /v1/companies/{company}/proformas/{proforma}/convertpublic-api.v1.proformas.convertconvert_proformaThe invoice it creates carries the three keys.
POST /v1/companies/{company}/delivery-notes/{delivery_note}/convertpublic-api.v1.delivery_notes.convertconvert_delivery_noteThe invoice it creates carries the three keys.
GET /v1/companies/{company}/eventspublic-api.v1.events.listlist_eventsThe invoice that an event carries has the three keys.
GET /v1/companies/{company}/events/{event}public-api.v1.events.showget_eventThe invoice that the event carries has the three keys.
GET /v1/companies/{company}/webhook-endpoints/{webhook_endpoint}/deliveriespublic-api.v1.webhook_endpoints.deliveries.listlist_webhook_deliveriesThe invoice that the event of a delivery carries has the three keys.
GET /v1/companies/{company}/webhook-endpoints/{webhook_endpoint}/deliveries/{delivery}public-api.v1.webhook_endpoints.deliveries.showget_webhook_deliveryThe invoice that the event of the delivery carries has the three keys.

Updated endpoints31

EndpointDescription
GET/v1/companies/{company}/invoicesList all invoices
POST/v1/companies/{company}/invoicesCreate an invoice
GET/v1/companies/{company}/invoices/{invoice}Retrieve an invoice
PATCH/v1/companies/{company}/invoices/{invoice}Update an invoice
POST/v1/companies/{company}/invoices/find-by-numberFind an invoice by number
POST/v1/companies/{company}/invoices/find-by-external-idFind an invoice by external ID
POST/v1/companies/{company}/invoices/{invoice}/duplicateDuplicate an invoice
POST/v1/companies/{company}/invoices/{invoice}/issueIssue an invoice
POST/v1/companies/{company}/invoices/{invoice}/sendSend invoice by email
POST/v1/companies/{company}/invoices/{invoice}/mark-sentMark an invoice as sent
POST/v1/companies/{company}/invoices/{invoice}/unsendUnsend an invoice
POST/v1/companies/{company}/invoices/{invoice}/mark-paidMark invoice as paid
POST/v1/companies/{company}/invoices/{invoice}/scheduleSchedule an invoice
PATCH/v1/companies/{company}/invoices/{invoice}/rescheduleReschedule an invoice
POST/v1/companies/{company}/invoices/{invoice}/unscheduleUnschedule an invoice
POST/v1/companies/{company}/invoices/{invoice}/annulAnnul an invoice
POST/v1/companies/{company}/invoices/{invoice}/voidVoid an invoice
POST/v1/companies/{company}/invoices/{invoice}/assign-real-numberAssign a real invoice number
POST/v1/companies/{company}/invoices/{invoice}/correctiveGenerate corrective invoice
GET/v1/companies/{company}/invoices/{invoice}/correctivesList corrective invoices
POST/v1/companies/{company}/invoices/substitute-simplifiedSubstitute simplified invoices with full invoice
POST/v1/companies/{company}/invoices/{invoice}/paymentsRegister a payment
POST/v1/companies/{company}/invoices/{invoice}/reminder-previewPreview a payment reminder email
POST/v1/companies/{company}/invoices/{invoice}/send-reminderSend a payment reminder
POST/v1/companies/{company}/quotes/{quote}/convertConvert quote to invoice
POST/v1/companies/{company}/proformas/{proforma}/convertConvert proforma to invoice
POST/v1/companies/{company}/delivery-notes/{delivery_note}/convertConvert delivery note to invoice
GET/v1/companies/{company}/eventsList all events
GET/v1/companies/{company}/events/{event}Retrieve an event
GET/v1/companies/{company}/webhook-endpoints/{webhook_endpoint}/deliveriesList webhook deliveries
GET/v1/companies/{company}/webhook-endpoints/{webhook_endpoint}/deliveries/{delivery}Retrieve webhook delivery

On this page

Need a hand?Contact support