Skip to navigation

Update a credit note

View as Markdown

Partial update. The type field is intentionally NOT updatable. Updating an issued credit note is allowed but rare — the document has already been accounted for as a VAT correction.

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_idlong or stringRequired

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.

idlong or stringRequired

Credit note ID. Either the numeric id or the public_id (cn_…).

Request

This endpoint expects an object.
numberstringOptional
number_series_idlongOptional
issue_datedateOptional
delivery_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). On update, a currency changed back to the base currency without an exchange_rate in the same request drops the stored rate.

order_numberstringOptional
buyer_referencestring or nullOptional<=100 characters

Buyer reference (EN 16931 BT-10). Blank or null clears it. On create with invoice_id and that invoice’s customer, an omitted or blank value takes the invoice’s buyer_reference when it has one. Otherwise, when a request sets or changes the customer of a draft without a non-blank value, it becomes that contact’s buyer_reference (null when the contact has none).

delivery_methodstringOptional

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

show_payment_qrbooleanOptional

Per-document override for the payment QR code. Stored for any document type, but only invoices and proformas resolve it — a credit note never renders a payment QR.

payment_qr_formatenum or nullOptional

Per-document payment QR format. Stored for any document type, but only invoices and proformas resolve it — a credit note never renders a payment QR.

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.

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_…).

invoice_idlong or stringOptional

Optional. Source invoice ID. When provided, a corrects link is established from the new credit note back to this invoice — queryable later as credit_note.invoice.

included_in_turnoverenumOptional
Allowed values:
vat_regimeenum or nullOptional

The document’s VAT regime (see the response field for each value). Replaces the removed reverse_charge: a request that sends reverse_charge is a 422. domestic_reverse_charge needs at least one line with a reverse-charge vat_treatment and is refused (422, field_errors.vat_regime) when the supplier or the customer is not a VAT payer in the workspace’s country; eu_services needs a customer in another EU member state and non_eu_services one outside the EU. Blank or null clears it on an update and switches the reverse charge off: every line takes its own tax_rate and the totals are recomputed (a document whose vat_regime is already null keeps what it has).

reverse_charge_textstring or nullOptional

The document’s own reverse-charge text. null means the default for the document’s vat_regime and pdf_language: omitted on create, a document with a reverse-charge vat_regime stores null and prints the default; omitted on update, the stored value is kept; null sent explicitly goes back to the default. A text equal to the default is stored as null, so the document follows a change of pdf_language until it is locked; the lock fixes the text it prints. An own text must contain the statutory reverse-charge mention (e.g. ‘prenesenie daňovej povinnosti’, ‘Reverse charge’) before the document can be issued.

place_of_supply_countrystring or nullOptional

The country where the supply is taxed, as an ISO 3166-1 alpha-2 code (any case; stored and returned in lower case, e.g. cz). State it when it is not where the customer is, e.g. construction work on a building in another country. A code ISO 3166 does not know is a 422. A document whose customer is in the workspace’s own country and that has no reverse charge keeps none: the place is cleared. null or "" clears it; omit to leave it unchanged.

reverse_charge_attestationslist of enums or nullOptional

What the member confirms on a domestic_reverse_charge document: payer_register (the customer is in the Czech VAT payer register, asked of a Czech workspace), recipient_condition (the customer meets the condition a line’s vat_treatment names, e.g. acts as a VAT payer) and written_agreement (a written agreement covers a Czech § 92a supply below its limit). The list replaces the stored one; blank entries are dropped, and [] or null clears it. Any other value is a 422. A document with any other vat_regime keeps none. Omit to leave it unchanged.

Allowed values:
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.

pdf_localestringOptional

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

hide_pricesbooleanOptional
line_itemslist of objectsOptional

Response

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

Stable public identifier of a credit-note-family record. Assigned by the server; never writable.

typeenum
Allowed values:
statusenum

Credit note lifecycle state: draft, issued, sent, reopened, or canceled. reopened is where reopenCreditNote lands a previously locked document; it is editable again and must be re-issued. Any settlement information is reported separately by payment_status.

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

Credit note number (formatted via number_series, e.g. ‘DOB2026-0001’). Null for drafts.

issue_datedate or nullOptional
delivery_datedate or nullOptional
exchange_ratestring or nullOptionalformat: "decimal"
included_in_turnoverboolean or nullOptional
vat_regimeenum or nullOptional

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.

effective_vat_regimeenumOptionalRead-only

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).

reverse_charge_textstring or nullOptional

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.

place_of_supply_countrystring or nullOptionalformat: "^[a-z]{2}$"

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.

reverse_charge_attestationslist of enumsOptional

What the member attested on a domestic_reverse_charge document: payer_register (the customer is in the Czech VAT payer register), recipient_condition (the customer meets the condition a line’s vat_treatment names) and written_agreement (a written agreement covers a Czech § 92a supply below its limit). Empty on any other regime.

Allowed values:
tax_schemestringOptional

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

vat_calculation_modeenumOptionalRead-only

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.

Allowed values:
due_datedate or nullOptional
due_daysinteger or nullOptional
order_numberstring or nullOptional
buyer_referencestring or nullOptional<=100 characters

Buyer reference (EN 16931 BT-10): the code the customer wants on the document. A credit note created against an invoice for that invoice’s customer carries the invoice’s reference; otherwise it defaults from the customer contact when the customer is chosen on a draft.

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
project_idlong or nullOptional

Project the document is filed under (project_id on write).

number_series_idlong or nullOptional

Number series the document is (or will be) numbered from (number_series_id on write; see listNumberSeries).

mandatory_textstring or nullOptional
Legally required text printed on the PDF.
hide_pricesboolean or nullOptional
Whether the PDF hides prices. Null when never set.
round_totalbooleanOptional

Whether the payable total is rounded to cash granularity (see totals.rounding).

related_documentslist of objectsOptional

Documents linked to this one in the document flow, as the web sidebar lists them. A slim summary; fetch each from its own endpoint.

invoice_idlong or nullOptional

Invoice this credit note corrects (invoice_id on write).

delivery_methodstring or nullOptional

Delivery/carrier mode

email_sent_atdatetime or nullOptional
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.

edocumentobject or nullOptional

How this credit note travelled as an e-document: its latest transmission and the customer’s answers. Null until one exists, so a credit note sent by e-mail, on paper or never sent reads null. It agrees with the list filter ?edocument=. The send check is edocument_preflight. Polled — there is no webhook.

edocument_preflightobject or nullOptional

The full send check: whether this credit note can be sent as an e-invoice now and, if not, the reasons. Only on GET /workspaces/{workspace_id}/credit_notes/{id} and the answers of the re-date (POST …/einvoice_issue_date) and the invoice link (POST …/einvoice_invoice_link), sent yet or not; absent from lists and every other response. Null where the workspace does not send e-invoices, and when the check could not be computed (an error on our side, which we are told about; read the credit note again later).

Errors

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