Skip to main content
POST
Void an invoice
Melso sends the VERI*FACTU cancellation and keeps your reason. A wrong amount needs a corrective invoice instead. Melso answers 409 for an invoice that is paid, collected, already corrected, in a filed quarter, not issued through Melso’s VERI*FACTU sender, or still waiting for the AEAT.

Authorizations

Authorization
string
header
required

A company API key, mk_live_…, that the company's owner creates in the Melso app under Settings, Connect your AI, API keys. It works in that one company with the owner's authority. Test keys (mk_test_…) are not issued. Keep the key on your servers. See Authentication.

Path Parameters

company_id
string<uuid>
required

The company's ID. Every company-scoped call works in exactly this company.

invoice_id
string<uuid>
required

Body

application/json
expected_version
string
required

The version of the invoice you read.

Required string length: 64
reason
string
required

Why the operation never happened, in a sentence. Blank or longer than 500 bytes answers 400 invoice_void_reason.

Minimum string length: 1

Response

The invoice, with status void.

id
string<uuid>
required
version
string
required

A fingerprint of the invoice's fiscal content. Issuing and voiding take the exact version you read.

type
enum<string>
required
Available options:
standard,
proforma,
corrective
status
enum<string>
required

draft until it is issued; issued once numbered; sent once emailed to the customer; paid once marked paid; void once voided.

Available options:
draft,
issued,
sent,
paid,
void
series
string | null
required

Set at issue. The issue year, such as 2026, unless the company set its own series; R- before it for a corrective invoice.

number
integer | null
required

Set at issue, the next in the series.

issue_date
string<date>
required
due_date
string<date> | null
required
customer_id
string<uuid>
required
customer_name
string
required

The customer's name when the invoice was drafted.

customer_tax_id
string
required

The customer's tax ID when the invoice was drafted.

lines
object[]
required
subtotal
string
required

An amount in euros as a decimal string with two decimals, such as "121.00".

Pattern: ^-?[0-9]+\.[0-9]{2}$
Example:

"121.00"

vat_amount
string
required

An amount in euros as a decimal string with two decimals, such as "121.00".

Pattern: ^-?[0-9]+\.[0-9]{2}$
Example:

"121.00"

irpf_rate
string
required

A decimal number as a string, such as "21" or "0.5".

Pattern: ^-?[0-9]{1,10}(\.[0-9]{1,6})?$
irpf_amount
string
required

An amount in euros as a decimal string with two decimals, such as "121.00".

Pattern: ^-?[0-9]+\.[0-9]{2}$
Example:

"121.00"

total
string
required

What the invoice charges, IRPF withheld already taken off.

Pattern: ^-?[0-9]+\.[0-9]{2}$
Example:

"121.00"

currency
string
required
Allowed value: "EUR"
notes
string
required
verifactu_status
enum<string>
required

The AEAT's answer to the invoice's VERIFACTU record: pending until it answers (and on a draft), registered once it accepted it, error if it refused it, the invoice keeping its number. none for an invoice issued without VERIFACTU, as the Melso app issues before the owner authorizes a certificate.

Available options:
pending,
registered,
error,
none
fiscal_network
enum<string>
required

verifactu for an invoice issued through VERI*FACTU, or a draft that would go there. Empty for an invoice issued without it.

Available options:
verifactu,
tax_label
enum<string>
required

IGIC for a company in the Canary Islands.

Available options:
IVA,
IGIC
pdf_ready
boolean
required

The legal PDF is stored. Download it with Download the invoice PDF.

The invoice's payment link, when the owner has connected a Stripe account.

inactive once Melso switched the link off, as when the invoice is paid or voided.

Available options:
pending,
creating,
active,
inactive,
error,
unknown
email_delivery_status
enum<string>
required

The email of the issued invoice to the customer. error when it could not go out, such as a customer without an email. unknown when the answer was lost and the email may have reached the customer.

Available options:
pending,
sending,
sent,
error,
unknown
email_delivery_error
string | null
required
sent_at
string<date-time> | null
required
paid_at
string<date-time> | null
required

When it was first marked paid.

corrects_invoice_id
string<uuid> | null
required

On a corrective invoice, the invoice it corrects.

activity_id
string<uuid> | null
required
outstanding
string
required

What an issued or sent invoice still owes after the bank movements reconciled with it. 0.00 for any other status.

Pattern: ^-?[0-9]+\.[0-9]{2}$
Example:

"121.00"

collections
object[]
required

The bank movements reconciled with the invoice. Empty except on Get an invoice and Mark an invoice as paid.

created_at
string<date-time>
required
updated_at
string<date-time>
required