curl --request PATCH \
--url https://api.melso.ai/v1/companies/{company_id}/invoices/{invoice_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"issue_date": "2023-12-25",
"lines": [
{
"description": "<string>",
"quantity": "<string>",
"unit_price": "<string>"
}
],
"type": "standard",
"due_date": "2023-12-25",
"irpf_rate": "0",
"notes": "<string>",
"activity_id": "<string>"
}
'import requests
url = "https://api.melso.ai/v1/companies/{company_id}/invoices/{invoice_id}"
payload = {
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"issue_date": "2023-12-25",
"lines": [
{
"description": "<string>",
"quantity": "<string>",
"unit_price": "<string>"
}
],
"type": "standard",
"due_date": "2023-12-25",
"irpf_rate": "0",
"notes": "<string>",
"activity_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
issue_date: '2023-12-25',
lines: [{description: '<string>', quantity: '<string>', unit_price: '<string>'}],
type: 'standard',
due_date: '2023-12-25',
irpf_rate: '0',
notes: '<string>',
activity_id: '<string>'
})
};
fetch('https://api.melso.ai/v1/companies/{company_id}/invoices/{invoice_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": "<string>",
"type": "standard",
"status": "draft",
"series": "<string>",
"number": 123,
"issue_date": "2023-12-25",
"due_date": "2023-12-25",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_name": "<string>",
"customer_tax_id": "<string>",
"lines": [
{
"description": "<string>",
"quantity": "<string>",
"unit_price": "<string>",
"vat_rate": "<string>",
"product_kind": "goods",
"amount": "121.00"
}
],
"subtotal": "121.00",
"vat_amount": "121.00",
"irpf_rate": "<string>",
"irpf_amount": "121.00",
"total": "121.00",
"currency": "EUR",
"notes": "<string>",
"verifactu_status": "pending",
"fiscal_network": "verifactu",
"tax_label": "IVA",
"pdf_ready": true,
"payment_link": "<string>",
"payment_link_status": "pending",
"payment_link_error": "<string>",
"email_delivery_status": "pending",
"email_delivery_error": "<string>",
"sent_at": "2023-11-07T05:31:56Z",
"paid_at": "2023-11-07T05:31:56Z",
"corrects_invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"activity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outstanding": "121.00",
"collections": [
{
"date": "2023-12-25",
"amount": "<string>",
"movement_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}Replace an invoice draft
Replaces a draft with the body you send.
curl --request PATCH \
--url https://api.melso.ai/v1/companies/{company_id}/invoices/{invoice_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"issue_date": "2023-12-25",
"lines": [
{
"description": "<string>",
"quantity": "<string>",
"unit_price": "<string>"
}
],
"type": "standard",
"due_date": "2023-12-25",
"irpf_rate": "0",
"notes": "<string>",
"activity_id": "<string>"
}
'import requests
url = "https://api.melso.ai/v1/companies/{company_id}/invoices/{invoice_id}"
payload = {
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"issue_date": "2023-12-25",
"lines": [
{
"description": "<string>",
"quantity": "<string>",
"unit_price": "<string>"
}
],
"type": "standard",
"due_date": "2023-12-25",
"irpf_rate": "0",
"notes": "<string>",
"activity_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
issue_date: '2023-12-25',
lines: [{description: '<string>', quantity: '<string>', unit_price: '<string>'}],
type: 'standard',
due_date: '2023-12-25',
irpf_rate: '0',
notes: '<string>',
activity_id: '<string>'
})
};
fetch('https://api.melso.ai/v1/companies/{company_id}/invoices/{invoice_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": "<string>",
"type": "standard",
"status": "draft",
"series": "<string>",
"number": 123,
"issue_date": "2023-12-25",
"due_date": "2023-12-25",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_name": "<string>",
"customer_tax_id": "<string>",
"lines": [
{
"description": "<string>",
"quantity": "<string>",
"unit_price": "<string>",
"vat_rate": "<string>",
"product_kind": "goods",
"amount": "121.00"
}
],
"subtotal": "121.00",
"vat_amount": "121.00",
"irpf_rate": "<string>",
"irpf_amount": "121.00",
"total": "121.00",
"currency": "EUR",
"notes": "<string>",
"verifactu_status": "pending",
"fiscal_network": "verifactu",
"tax_label": "IVA",
"pdf_ready": true,
"payment_link": "<string>",
"payment_link_status": "pending",
"payment_link_error": "<string>",
"email_delivery_status": "pending",
"email_delivery_error": "<string>",
"sent_at": "2023-11-07T05:31:56Z",
"paid_at": "2023-11-07T05:31:56Z",
"corrects_invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"activity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outstanding": "121.00",
"collections": [
{
"date": "2023-12-25",
"amount": "<string>",
"movement_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}version. An issued invoice answers 409: correct it instead.Authorizations
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
Body
A proforma is never issued. corrective is only for replacing a
corrective draft; create one with
Draft a corrective invoice.
standard, proforma, corrective Response
The replaced draft, with its new version.
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.
pending, registered, error, none