Skip to navigation

Send invoice by email

View as Markdown

Enqueues an email delivery of the invoice (with PDF attached) to the customer’s email address. Returns immediately with the updated invoice (email_sent_at populated) — the actual delivery happens asynchronously via a background job.

Defaults: all request-body fields are optional. When omitted:

  • to → the linked Party’s email (customer)
  • subject → localized “Invoice <number>” template
  • message → localized template body referencing the invoice
  • locale → invoice’s pdf_language, falling back to the workspace’s locale

SDK consumers can call with an empty body to “just send it with defaults” — the typical happy path for automated billing integrations.

Returns 422 if validation fails after defaults are merged (e.g. the customer has no email AND no to override was provided, or the override is malformed).

Required scope: manage:invoices — sending invoices is a billing-impacting workflow action, so write-scoped tokens cannot trigger it.

Authentication

AuthorizationBearer

JWT issued via POST /api/v1/auth/sign_in. Used by mobile and SPA clients. Revoked tokens are rejected.

OR
AuthorizationBearer

Lucanto API key. Two prefixes:

  • lct_pat_<random><checksum> — personal access token (owner: User)
  • lct_live_<random><checksum> — workspace token, live data

Issue keys at /settings/api_keys (personal) or /:workspace_id/settings/api_keys (workspace). Plaintext token is shown once and never again.

Path parameters

workspace_idlongRequired>=1
Workspace ID. The numeric ID shown in your URLs.
idlong or stringRequired

Invoice ID. Either the numeric id or the public_id (doc_…).

Headers

Idempotency-KeystringOptional<=255 characters

Client-supplied unique key (recommended: UUID v4) for safe retries. Within 24 hours, repeating the same key with the same request (method, path, query, body) replays the original response instead of re-executing the action — once the action has run, a 5xx included; a request stopped before it ran is not stored. Reusing a key with a different request returns 422 idempotency_key_conflict (IETF draft §2.7).

Request

This endpoint expects an object.
invoice_emailobjectOptional

Response

OK. The invoice with email_sent_at updated to the time the delivery was enqueued.

idlong
public_idstringRead-onlyformat: "^[a-z]+_[0-7][0-9a-hjkmnp-tv-z]{25}$"

Stable public identifier of this record. Never changes once assigned. Its prefix names the entity: doc_ document (invoice, proforma, credit note, quote, sales order), exp_ expense, cnt_ contact, prj_ project, ba_ bank account or cash register, txn_ transaction, lon_ loan, bst_ bank statement. Accepted in place of the numeric id in this resource’s path parameters and in request fields that reference it (customer_id, bank_account_id, …).

typeenum

Document type discriminator. Always invoice on this endpoint — other types are exposed via their own endpoints (quotes, proformas, credit_notes).

Allowed values:
statusenum

Invoice lifecycle state: draft, issued, sent, reopened, or canceled. reopened is where reopenInvoice lands a previously locked invoice; it is editable again and must be re-issued. Settlement is reported separately by payment_status; POST /:id/mark_paid does not change this lifecycle field.

Allowed values:
currencystring

ISO-4217 currency code.

created_atdatetime
updated_atdatetime
payment_statusenum or nullOptional

Derived settlement degree (money is the source of truth). Null for non-payable document types, drafts, canceled documents, and rows created before the payment_status backfill ran.

Allowed values:
overdueboolean or nullOptional
Whether a positive balance remains after the due date.
paid_lateboolean or nullOptional
Whether full settlement landed after the due date.
status_transitionsobjectOptional
numberstring or nullOptional

Invoice number (formatted via number_series, e.g. ‘FAK2026-0001’). Null for drafts.

issue_datedate or nullOptional
delivery_datedate or nullOptional
due_datedate or nullOptional
due_daysinteger or nullOptional
Default payment terms in days.
exchange_ratestring or nullOptionalformat: "decimal"
included_in_turnoverboolean or nullOptional
Whether this invoice counts toward the VAT registration threshold turnover calculation.
reverse_chargeboolean or nullOptional

Whether VAT reverse-charge applies (cross-border B2B).

reverse_charge_textstring or nullOptional
tax_schemestringOptional

Tax scheme (UNCL 5153), e.g. “VAT”.

order_numberstring or nullOptional
discount_descriptionstring or nullOptional
discount_percentagestring or nullOptionalformat: "decimal"
discount_amountstring or nullOptionalformat: "decimal"
opening_textstring or nullOptional
closing_textstring or nullOptional
footer_notestring or nullOptional
internal_notestring or nullOptional

Internal-only note. Not rendered on PDF or sent to recipient.

pdf_languagestring or nullOptional
pdf_localestring or nullOptional
delivery_methodstring or nullOptional

Delivery/carrier mode

email_sent_atdatetime or nullOptional
reminder_countinteger or nullOptional
Number of payment reminders sent to the client.
last_reminded_atdatetime or nullOptional
When the last payment reminder was sent.
amount_paidstring or nullOptionalformat: "decimal"

Amount settled so far (payments + advance deductions).

amount_duestring or nullOptionalformat: "decimal"

Outstanding amount (tax_inclusive − amount_paid).

paymentobjectOptional
import_sourceenum or nullOptional

Origin of the document. null when it was created in Lucanto, in which case totals are Lucanto’s EN 16931 calculation. A non-null value means the document was imported from that system and initially carries the source system’s own figures, preserved verbatim; those may differ by cents from Lucanto’s calculation because systems round VAT at different levels (line vs. category). insight means AI extraction from an uploaded file, not an import from another vendor. This records provenance only, not which calculation is currently in effect — editing line items or document discounts recomputes totals in Lucanto while leaving import_source set. In practice a document only ever carries kros_developer, isdoc, superfaktura or null. kros appears only on rows imported before the writer was renamed, and insight is written by the expense path only. The enum is kept as the union across resources rather than narrowed, so a legacy row cannot fail validation.

Allowed values:
totalsobjectOptional
settingsobjectOptional
line_itemslist of objectsOptional
customerobject or nullOptional

The party identity as it appears on a document. On an ISSUED document this is the identity the document was issued with — a snapshot pinned at issue, which does NOT change when the legal entity is later renamed, re-registered, or moved. A draft follows the entity’s current identity. id is the legal entity’s id and is stable across identity changes, so a stored reference keeps resolving. This matches the PDF and the ISDOC export of the same document. vat_period is not part of this projection — a counterparty’s filing period is not knowable.

supplierobject or nullOptional

The party identity as it appears on a document. On an ISSUED document this is the identity the document was issued with — a snapshot pinned at issue, which does NOT change when the legal entity is later renamed, re-registered, or moved. A draft follows the entity’s current identity. id is the legal entity’s id and is stable across identity changes, so a stored reference keeps resolving. This matches the PDF and the ISDOC export of the same document. vat_period is not part of this projection — a counterparty’s filing period is not knowable.

Errors

401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
422
Unprocessable Entity Error
429
Too Many Requests Error