Skip to main content
POST
Create an invoice draft
Live capability. Melso runs this in production today. Partner keys reach it once your partner account is enabled. See Availability.
A draft has no series or number and is not registered anywhere until a person issues it. Use Create an invoice approval link to get the page where the owner issues it.

Authorizations

Authorization
string
header
required

Your partner secret key, mk_live_… for real companies or mk_test_… for test companies. Keep it on your servers. See Authentication.

Headers

Idempotency-Key
string

A unique key, such as a UUID, that makes a retried create safe. Reusing a key with a different body is refused.

Maximum string length: 255

Path Parameters

company_id
string<uuid>
required

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

Body

application/json
customer_id
string<uuid>
required
issue_date
string<date>
required
lines
object[]
required
Required array length: 1 - 200 elements
type
enum<string>
default:standard
Available options:
standard,
proforma
due_date
string<date>

On or after issue_date.

irpf_rate
enum<string>
default:0

IRPF withholding for an autónomo professional invoicing a business. A company always uses 0.

Available options:
0,
7,
15
notes
string
Maximum string length: 4000

Response

The draft, with status draft and its calculated totals.

id
string<uuid>
required
version
string
required

A fingerprint of the invoice's fiscal content. Issuing requires the exact version the person reviewed.

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

draft until a person issues it. issued once numbered; sent once emailed; paid once marked paid.

Available options:
draft,
issued,
sent,
paid
issue_date
string<date>
required
customer_id
string<uuid>
required
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_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

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

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

"121.00"

currency
string
required
Allowed value: "EUR"
created_at
string<date-time>
required
updated_at
string<date-time>
required
series
string | null

Set at issue. The issue year, such as 2026; R-2026 for a corrective.

number
integer | null

Set at issue, the next in the series.

due_date
string<date> | null
customer_name
string

The customer's name when the invoice was drafted.

customer_tax_id
string
irpf_rate
string

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

Pattern: ^-?[0-9]{1,10}(\.[0-9]{1,6})?$
tax_label
enum<string>
Available options:
IVA,
IGIC
notes
string
fiscal_network
enum<string>

Where the invoice is registered, from the company's tax territory.

Available options:
verifactu,
ticketbai
verifactu_status
enum<string>

The registration state with VERI*FACTU or TicketBAI.

Available options:
pending,
registered,
error
pdf_ready
boolean
Available options:
pending,
creating,
active,
inactive,
error,
unknown
email_delivery_status
enum<string>
Available options:
pending,
sending,
sent,
error,
unknown
email_delivery_error
string | null
sent_at
string<date-time> | null
paid_at
string<date-time> | null
corrects_invoice_id
string<uuid> | null