Cancel a confirmed sales order (confirmed → canceled)
Retires a confirmed order the customer called off. It leaves the
backlog. Available from confirmed only; a repeat call answers 422.
Required scope: manage:sales_orders.
Authentication
JWT issued via POST /api/v1/auth/sign_in. Used by mobile and SPA clients. Revoked tokens are rejected.
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 ID: the workspace’s numeric id or its public_id
(ws_01h455vb4pex5vsknk084sn02q, the form the web app’s URLs show).
The bare UUID form of the public_id is accepted but deprecated.
Sales order ID. Either the numeric id or the public_id (so_…).
Headers
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).
Response
OK. The order with status: canceled.
Stable public identifier of a sales order. Assigned by the server; never writable.
Sales order lifecycle state: draft while it is being entered
or extracted; confirmed once accepted (this is where the
number is minted); fulfilled once every ordered line has been
invoiced — a system transition driven by the fulfilment query,
which also moves it back to confirmed if the invoiced total
drops; rejected when the order was refused; reopened after
a locked order was unlocked for editing; canceled when it was
explicitly retired.
ISO-4217 currency code.
Always null: a sales order is not payable, so no settlement is derived for it (the field is reserved for the shared document shape).
Always null here — non-payable document type.
Always null here — non-payable document type.
Sales order number (formatted via number_series). Null until the order is confirmed.
The document’s VAT regime, which decides how each line is taxed. domestic: a domestic supply, every line at its own tax_rate. domestic_reverse_charge: domestic reverse charge (SK § 69 ods. 12, CZ § 92a): the lines whose vat_treatment names a reverse-charge category (or manual) are at 0 % and the customer owes their VAT; the other lines keep their rate. eu_services: services to a VAT-registered customer in another EU member state, every line reverse-charged at 0 %. eu_goods: goods to a customer in another EU member state, every line at its own tax_rate. export: a supply outside the EU, every line at its own tax_rate. non_eu_services: services to a customer outside the EU, every line at 0 %, VAT not charged. null: no regime was chosen (a document created before the field, or by the web form); a reverse charge shown on such a document applies to every line.
The regime the lines follow, read-only: vat_regime when it is set, otherwise legacy_reverse_charge (a document from before regimes existed whose reverse charge applies to every line) or legacy (such a document without reverse charge, every line at its own tax_rate).
The reverse-charge text the document prints: its own text, else the default for its vat_regime and pdf_language (the statutory reverse-charge mention followed by a short explanation), which follows a change of pdf_language until the document is locked. null when the document has neither.
The country where the supply is taxed, when it was stated on the document: an ISO 3166-1 alpha-2 code in lower case (e.g. cz). It decides whether the supply counts toward the workspace’s VAT registration turnover. null when nothing was stated.
Tax scheme (UNCL 5153), e.g. “VAT”.
How the VAT is computed. Read-only, never accepted on create or update. net_per_rate on every document but two: per VAT rate, the VAT is added on top of the summed line nets (EN 16931). gross_per_rate only on a tax document on a received payment (tax_document) and its advance credit note: per VAT rate, the VAT is carved out of the received gross, so the document states exactly the payment (730.00 at 23 % is 593.50 + 136.50); each line’s gross_unit_price is then its source and unit_price the base that follows from it.
Buyer reference (EN 16931 BT-10): the code the customer wants on the invoice. Defaults from the customer contact when the customer is chosen on a draft.
Project the document is filed under (project_id on write).
Number series the document is (or will be) numbered from (number_series_id on write; see listNumberSeries).
Whether the payable total is rounded to cash granularity (see totals.rounding).
Delivery/carrier mode
Always null here — non-payable document type.
Always null here — non-payable document type.
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 — on this type that is the normal case, since a customer’s order usually arrives as a PDF. 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. The enum is kept as the union across resources rather than narrowed, so a legacy row cannot fail validation.
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.
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.
When the customer wants the goods; null when the order asks for no date.
Where the goods go when not to the customer’s address; null otherwise. The order’s own address.
The order received over Peppol this sales order was made from
(direction: received), with our Order Response to the buyer in
responses (kind: order_response, code AP or RE, its
status and note) once the order was confirmed or rejected.
Null for a sales order made otherwise.
