Void an invoice by issuing a credit note

Cancel an invoice in full by issuing a credit note for its whole amount.

invoice_id in the path is the invoice's document_id. Wafeq builds the credit
note from the original invoice, so you send no lines or parties, and gives it a
number of its own. It's a normal credit note, sent and reported to the FTA like
any other: a tax credit note (381) for a tax invoice, or a commercial credit
note (81) for a commercial invoice, or a self-billed credit note (261) for a
self-billed invoice (389). The invoice then shows its number in
credited_by_invoice_number.

For a VAT-registered seller, a new commercial credit note (81) requires every
line, document discount and charge to be out of scope (O). An older 480 with
exempt or zero-rated supplies cannot be voided through a new 81; it is refused
with document_type_mismatch, and the original remains unchanged.

Send Idempotency-Key to retry safely: the same void body and key return the
first response, even after the invoice shows as credited. It is required for
a reporting-only original. Such a void preserves the original buyer and
reporting-only route and returns 202 reporting_only; nothing is delivered
to the buyer. In Sandbox, reporting stays simulated.

Refused with 409 when the invoice is already credited, and with
409 delivery_unsettled while its delivery to the buyer is still in progress.
A credit note can't be voided.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required
Body Params

Optional body for voiding an invoice.

string | null

Why the invoice is voided, in words. Added to the credit note's notes.

string | null

The credit note's reason code, as in POST /credit-notes. Defaults to DL8.61.1.A.

Headers
string | null
^[\x21-\x7e]+$

Makes the send safe to repeat: send the same body with the same key again and you get the first answer back, and nothing is sent twice. Use one key per version of the document; a changed body needs a new key. Required for a document reported to the FTA only, for queued delivery (Prefer: respond-async) and with corrects_document_id, so send one every time. Keys are scoped to the taxpayer and your organization, and never expire.

string | null
string
required

Taxpayer ID (txpay_…). Required with an organization API key (pk_…) for this taxpayer-specific operation, even for one taxpayer. Not a TIN. Optional with a taxpayer access token, which already names its taxpayer.

string | null

Grant ID (tgr_…) to act through, with an organization API key. The request then has exactly that grant's scopes and fails once the grant is revoked. Without it, the key acts through all of the organization's active grants on the taxpayer.

Responses

409

Conflict; detail.code says which. idempotency_key_reused: the key was used before with a different body; use a new key for a changed document. idempotency_in_progress or idempotency_unconfirmed: an earlier send with this key hasn't settled yet; wait, then send the same body with the same key. document_already_submitted: a document with this number was already accepted; follow it instead of sending it again. correction_not_ready: Wafeq is still handling the rejected document's report to the FTA; send the same correction again later, with the same key.

503

A temporary problem, e.g. the buyer couldn't be looked up on Peppol just now (smp_unavailable), the billing status couldn't be confirmed (billing_status_unavailable), or the send couldn't be saved (idempotency_unavailable). Send it again later with the same Idempotency-Key, never a new one, so it can't be sent twice. queued_delivery_unavailable means new queued delivery is unavailable (for example, disabled): submit without Prefer: respond-async, or retry once queued delivery is enabled. A key already reserved for queued delivery keeps that delivery mode; completed keys still replay.

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json