curl --request POST \
--url https://api.melso.ai/v1/companies/{company_id}/invoices/{invoice_id}/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"acknowledge_duplicate_risk": false
}
'import requests
url = "https://api.melso.ai/v1/companies/{company_id}/invoices/{invoice_id}/send"
payload = { "acknowledge_duplicate_risk": False }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({acknowledge_duplicate_risk: false})
};
fetch('https://api.melso.ai/v1/companies/{company_id}/invoices/{invoice_id}/send', 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",
"issue_date": "2023-12-25",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"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_amount": "121.00",
"total": "121.00",
"currency": "EUR",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"series": "<string>",
"number": 123,
"due_date": "2023-12-25",
"customer_name": "<string>",
"customer_tax_id": "<string>",
"irpf_rate": "<string>",
"tax_label": "IVA",
"notes": "<string>",
"fiscal_network": "verifactu",
"verifactu_status": "pending",
"pdf_ready": true,
"payment_link": "<string>",
"payment_link_status": "pending",
"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"
}{
"error": "invalid token",
"code": "unauthorized",
"request_id": "req_01JAB3K9X2"
}{
"error": "invoice not found",
"code": "not_found",
"request_id": "req_01JAB3K9X2"
}{
"error": "The tax return changed or is not ready for approval",
"code": "version_conflict",
"request_id": "req_01JAB3K9X2"
}Send an invoice
Emails the registered invoice’s PDF to the customer’s address, when the automatic delivery at issue did not go out.
curl --request POST \
--url https://api.melso.ai/v1/companies/{company_id}/invoices/{invoice_id}/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"acknowledge_duplicate_risk": false
}
'import requests
url = "https://api.melso.ai/v1/companies/{company_id}/invoices/{invoice_id}/send"
payload = { "acknowledge_duplicate_risk": False }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({acknowledge_duplicate_risk: false})
};
fetch('https://api.melso.ai/v1/companies/{company_id}/invoices/{invoice_id}/send', 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",
"issue_date": "2023-12-25",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"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_amount": "121.00",
"total": "121.00",
"currency": "EUR",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"series": "<string>",
"number": 123,
"due_date": "2023-12-25",
"customer_name": "<string>",
"customer_tax_id": "<string>",
"irpf_rate": "<string>",
"tax_label": "IVA",
"notes": "<string>",
"fiscal_network": "verifactu",
"verifactu_status": "pending",
"pdf_ready": true,
"payment_link": "<string>",
"payment_link_status": "pending",
"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"
}{
"error": "invalid token",
"code": "unauthorized",
"request_id": "req_01JAB3K9X2"
}{
"error": "invoice not found",
"code": "not_found",
"request_id": "req_01JAB3K9X2"
}{
"error": "The tax return changed or is not ready for approval",
"code": "version_conflict",
"request_id": "req_01JAB3K9X2"
}Authorizations
Your partner secret key, mk_live_… for real companies or mk_test_…
for test companies. Keep it on your servers. See
Authentication.
Path Parameters
The company's ID. Every company-scoped call works in exactly this company.
Body
Required as true when email_delivery_status is unknown, because the earlier attempt may have reached the customer.
Response
The invoice with its delivery state.
A fingerprint of the invoice's fiscal content. Issuing requires the exact version the person reviewed.
standard, proforma, corrective draft until a person issues it. issued once numbered; sent once emailed; paid once marked paid.
draft, issued, sent, paid Show child attributes
Show child attributes
An amount in euros as a decimal string with two decimals, such as "121.00".
^-?[0-9]+\.[0-9]{2}$"121.00"
An amount in euros as a decimal string with two decimals, such as "121.00".
^-?[0-9]+\.[0-9]{2}$"121.00"
An amount in euros as a decimal string with two decimals, such as "121.00".
^-?[0-9]+\.[0-9]{2}$"121.00"
An amount in euros as a decimal string with two decimals, such as "121.00".
^-?[0-9]+\.[0-9]{2}$"121.00"
"EUR"Set at issue. The issue year, such as 2026; R-2026 for a corrective.
Set at issue, the next in the series.
The customer's name when the invoice was drafted.
A decimal number as a string, such as "21" or "0.5".
^-?[0-9]{1,10}(\.[0-9]{1,6})?$IVA, IGIC Where the invoice is registered, from the company's tax territory.
verifactu, ticketbai The registration state with VERI*FACTU or TicketBAI.
pending, registered, error pending, creating, active, inactive, error, unknown pending, sending, sent, error, unknown