Cancels a transmitted invoice by issuing the appropriate corrective document for the jurisdiction:
AnulaTicketBAI) signed
and transmitted to the Hacienda.R1 rectificative record.The original invoice status moves to cancellation_requested until
the authority acknowledges, then to cancelled.
For partial corrections, use POST /invoices with
document_type: credit_note and references.original_invoice_id.
This gives you full control over the corrected amounts.
Platform API key sent as Authorization: Bearer ofk_platform_....
Platform integrators also pass OpenFiskal-Organization: org_xxx
to act on behalf of a merchant.
Merchant organization ID. Required for platform integrators acting on behalf of a specific merchant. Omit when using an organization-scoped API key directly.
Unique key to make the request idempotent. If a request with this key
was already processed, the original response is returned without
re-executing the operation. Strongly recommended on all start and
complete actions — these are fiscal events and must not be duplicated.
Human-readable reason for cancellation
"Duplicate invoice issued in error"
Cancellation initiated
The merchant issuing the invoice
ISO 3166-1 alpha-2 or ISO 3166-2 subdivision code for the fiscal jurisdiction. Use subdivision codes for sub-national systems.
"IT"
"ES-PV-VI"
"ES-PV-SS"
"ES-PV-BI"
"ES"
OpenFiskal document type, mapped to jurisdiction-specific codes at submission time. See the E-Invoicing tag description for the full mapping table.
invoice, simplified_invoice, credit_note, debit_note, deferred_invoice, self_invoice Usually derived from the organization's registered details. Pass explicitly to override (e.g. for multi-brand setups).
Buyer details. All fields mandatory for B2B invoicing.
For B2C simplified invoices, tax_id may be omitted.
1"invoice"If false, the invoice is created in draft status and not
submitted to the authority. Call POST /invoices/:id/submit
when ready. Useful for Italy's deferred invoicing window.
Invoice series identifier. Used to maintain separate sequential numbering for different document types or business units. If omitted, OpenFiskal assigns the default series for the jurisdiction and document type.
"A"
Invoice issue date. Defaults to today. For deferred invoices
(Italy TD24), this is the invoice date — the delivery date is
in references.delivery_date.
Payment terms block. Required by FatturaPA even for already-paid
invoices — use method: already_paid in that case.
Italy only. How SDI should route the invoice to the recipient. If omitted, SDI will attempt delivery via the recipient's registered codice destinatario.
Free-text notes (Causale in FatturaPA). Appear on the
human-readable document. Max 200 characters per entry.
Links to related resources
"inv_01HXYZ"
draft: Created but not yet submitted to the authority.submitted: Submitted to the authority, awaiting acknowledgment.transmitted: Authority confirmed receipt. For TicketBAI/Verifactu,
this is the terminal success state. For SDI, delivery to recipient
still pending.delivered: SDI only. Invoice delivered to the recipient's inbox.
Recipient has 15 days to accept or reject.accepted: SDI only. Recipient explicitly accepted the invoice.
Implicit acceptance occurs after 15 days with no rejection.undeliverable: SDI only. SDI could not deliver to the recipient
(invalid codice_destinatario or PEC address). Invoice is fiscally
valid but the vendor must contact the recipient directly.rejected_by_authority: Authority rejected the document due to
format or validation errors. Check fiscal_errors. Must correct
and resubmit as a new invoice.cancellation_requested: Full cancellation initiated, awaiting
authority acknowledgment.cancelled: Invoice fully cancelled. A corrective document has been
issued and accepted.draft, submitted, transmitted, delivered, accepted, undeliverable, rejected_by_authority, cancellation_requested, cancelled Sequential invoice number assigned by OpenFiskal on submission.
Format: <series>/<year>/<sequence> or jurisdiction-specific.
"A/2026/00042"
Order-level totals, derived from line items. All fields are positive
integers in minor currency units. net_payable is the only field
that can be negative (on refunds).
Derivation: subtotal_gross − total_line_discounts = subtotal_after_line_discounts subtotal_after_line_discounts − total_cart_discounts = subtotal_after_all_discounts subtotal_after_all_discounts + rounding_adjustment = total_gross total_gross → total_net + total_tax
Authority-specific output populated after submission.
Treat jurisdiction_data as opaque — store it, do not parse it.