Skip to content

Correcting or cancelling an issued invoice ​

An issued invoice is never edited in place. Four paths are available, each with a different fiscal trail.

You want to…ActionResult
Void the entire invoiceCancelThe original becomes canceled and a cancellation record is submitted.
Correct the content of a delivered invoiceRectifyA new R1–R5 corrective invoice linked to the original.
Replace one or more simplified F2 invoicesReplaceA new F3 replaces the F2 invoices.
Resubmit a record rejected because of submission dataFixSame number, submitted again with Subsanacion=S.

Rectification is not correction of a rejected record

If the AEAT rejected the record because incorrect data was submitted, see Correcting rejected records. If the record is valid but the delivered invoice has a wrong amount or concept, issue a corrective invoice.

Cancellation ​

Cancellation is only for an invoice issued by mistake that should never have existed. It does not replace a corrective invoice.

bash
curl -X POST https://api.test.bilteo.com/api/v1/invoices/{id}/actions/cancel \
  -H "Authorization: Bearer bk_live_xxx"

Requires invoices:cancel and an accepted latest Veri*Factu record. It creates a chained cancellation record and moves the invoice to canceled.

Corrective invoices R1-R5 ​

POST /invoices/{id}/actions/rectify creates a draft corrective invoice linked to the issued invoice. You then review and issue it.

bash
curl -X POST https://api.test.bilteo.com/api/v1/invoices/{id}/actions/rectify \
  -H "Authorization: Bearer bk_live_xxx" -H "Content-Type: application/json" \
  -d '{ "rectificative_type": "S", "rectification_cause": "law_error" }'

rectificative_type controls how the correction is expressed:

  • S (replacement): corrected total amounts; replaces the original.
  • I (differences): only the delta, negative when appropriate.

rectification_cause determines the R type:

OriginCauseResult
F1law_error or art80_126R1
F1art80_3R2
F1art80_4R3
F1otherR4
F2simplifiedR5

An F2 only accepts simplified; an F3 cannot be corrected directly; and a corrective invoice cannot itself be corrected. serie_id is optional when the original series is compatible; otherwise provide a rectified series.

Replacement invoices F2 to F3 ​

When a customer requests a full invoice for a sale documented as F2:

bash
curl -X POST https://api.test.bilteo.com/api/v1/invoices/{f2_id}/actions/replace \
  -H "Authorization: Bearer bk_live_xxx" -H "Content-Type: application/json" \
  -d '{ "partner_id": "…" }'

Bilteo creates a draft F3, links it to the F2, and groups bases by tax combination. It inherits currency and economic activity; serie_id is optional. Requires invoices:replace_simplified.

With ?issue=true, the F3 is issued in the same request and invoices:issue is also required. The operation is atomic.

Replacing several F2 invoices ​

EndpointEffect
GET /invoices/{f3}/replacesLists the replaced F2 invoices.
POST /invoices/{f3}/replacesAdds an F2 and recalculates lines.
DELETE /invoices/{f3}/replaces/{relation_id}Removes an F2 and recalculates.

Each replaced F2 moves to replaced.

See also ​

Bilteo · Documentation