Skip to navigation

Update a proforma

View as Markdown

Partial update. The type field is intentionally NOT updatable. Updating a proforma that has already been converted to an invoice is allowed but rare — the downstream invoice is independent of the source proforma after conversion.

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

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

Request

This endpoint expects an object.
numberstringOptional
number_series_idlongOptional
issue_datedateOptional
delivery_datedateOptional
due_datedateOptional
due_daysintegerOptional

Payment term in days. May be negative — the web form derives it as due_date − issue_date, and neither the model nor the controller constrains the sign.

currencystringOptional
exchange_ratestringOptional

Decimal rate as document-currency per 1 base-currency. Optional — when creating a foreign-currency document without it, the ECB reference rate for the issue date is filled automatically (supported currencies only; otherwise it stays unset, i.e. 1.0).

payment_methodstringOptional
variable_symbolstringOptional
constant_symbolstringOptional
specific_symbolstringOptional
order_numberstringOptional
delivery_methodstringOptional

Delivery/carrier mode. Permitted by Params::DocumentParams for every document type.

show_payment_qrbooleanOptional

Per-document override for the payment QR code. Omit to inherit the workspace default.

payment_qr_formatenum or nullOptional

Per-document payment QR format. auto picks the format the customer’s banking app reads (PAY by square for Slovakia, QR Platba for Czechia, EPC QR for other EEA countries). Omit to inherit the workspace default; send null to go back to it.

Allowed values:
project_idlong or stringOptional

Project this document belongs to (from the projects API). Must be in this workspace.

round_totalbooleanOptional

Round the payable total to cash granularity (BT-114); the rounding delta is reported in totals.rounding.

quote_idlong or stringOptional
Quote this document was created from. Must be in this workspace.
sales_order_idlong or stringOptional

Sales order this proforma was issued for (from GET /sales_orders). Must be in this workspace.

customer_idlong or stringOptional

Contact ID of the customer (from the contacts endpoints). Resolved to the contact’s legal entity, workspace-scoped. Required.

bank_account_idlong or stringOptional

The bank account’s or cash register’s numeric id or its public_id (ba_…).

included_in_turnoverenumOptional
Allowed values:
reverse_chargebooleanOptional
reverse_charge_textstringOptional
discount_descriptionstringOptional
discount_percentagestringOptional
discount_amountstringOptional
opening_textstringOptional
closing_textstringOptional
footer_notestringOptional
recipient_notestringOptional
internal_notestringOptional
pdf_languageenumOptional

Language of the rendered PDF and customer e-mail. cz is a deprecated alias of cs: still accepted on input, never returned.

pdf_localestringOptional

Regional format for dates and amounts, a supported language-region tag such as “en-GB”.

auto_on_paymentenum or nullOptional

What happens when a payment lands on the proforma. Omitted: the workspace’s on_payment_preset applies (document settings, section proforma). An explicit null means nothing.

Allowed values:
line_itemslist of objectsOptional

Response

OK
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
Allowed values:
statusenum

Proforma lifecycle state. Settlement degree is reported separately by payment_status; settled is the explicit lifecycle state after downstream settlement handling. reopened is where reopenProforma lands a previously locked proforma; it is editable again and must be re-issued.

currencystring
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
issue_datedate or nullOptional
delivery_datedate or nullOptional
due_datedate or nullOptional
due_daysinteger or nullOptional
exchange_ratestring or nullOptionalformat: "decimal"
order_numberstring or nullOptional
included_in_turnoverboolean or nullOptional
reverse_chargeboolean or nullOptional
reverse_charge_textstring or nullOptional
tax_schemestringOptional

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

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
pdf_languagestring or nullOptional
pdf_localestring or nullOptional
delivery_methodstring or nullOptional

Delivery/carrier mode

email_sent_atdatetime or nullOptional
auto_on_paymentstring or nullOptional

What happens when a payment lands on this proforma: regular_invoice_paid (delivered at payment: one paid invoice for a payment that covers it, a tax document for a part-payment), tax_document (a tax document for every payment), nothing, or the legacy regular_invoice. NULL on older proformas, read as nothing. When converting via /convert_to_invoice, this value is overridden to regular_invoice regardless of the stored setting.

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
422
Unprocessable Entity Error
429
Too Many Requests Error