API · v1 · stable
CODEMETA OSDeveloper Center
FR
Ouvrir la console
Entité · invoices

Invoice Schema

ID du schéma
invoice
Collection
invoices
Autorisations
  • Lireinvoice_view
  • Créerinvoice_create
  • Modifierinvoice_edit
  • Supprimerinvoice_delete
Relations

Champs

Invoice Schema

invoices4 autorisations

Schema for validating Rechnung (invoice) entities

documentLanguagestringfacultatif

Language the document (PDF) is rendered in. Decided when the document is created (explicit → customer language → tenant default → de) and never re-derived. Missing = de.

deenesfrnlnull
nullable
partyIduuidobligatoire

Customer party UUID

invoiceNumberstringfacultatif

Auto-generated sequence number (e.g. RE-2026-00001)

max. 1000 caractèreslecture seulenullable
invoiceDatedatefacultatif

Invoice date

nullable
dueDatedatefacultatif

Payment due date

nullable
statusstringobligatoire

Invoice lifecycle status. POSTED = verbucht / revisionssicher festgeschrieben (lockedAt set). SENT = an Kunden versandt. Beide sind immutable.

DRAFTPOSTEDSENTPAIDPARTIALLY_PAIDOVERDUECANCELLEDCREDITED
Par défaut : "DRAFT"
salesInvoiceTypestringfacultatif

Type of sales invoice (mirrors weclapp salesInvoiceOrigin). ADVANCE_PAYMENT=Anzahlung, PART_PAYMENT=Teilrechnung, FINAL=Schlussrechnung, RECURRING=wiederkehrend

STANDARDADVANCE_PAYMENTPART_PAYMENTPREPAYMENTFINALRECURRINGRETAIL
Par défaut : "STANDARD"
bookingDatedatefacultatif

Buchungsdatum für DATEV (may differ from invoiceDate). Set on POSTED, drives the booking period.

nullable
lockedAtdatetimefacultatif

When the invoice was locked (POSTED). After this the invoice is immutable except for status changes (PAID/OVERDUE/CANCELLED) and dunning fields.

lecture seulenullable
lockedByuuidfacultatif

User UUID who posted (locked) the invoice

lecture seulenullable
contentHashstringfacultatif

SHA-256 hash of canonical invoice content at lock time (GoBD revisionssicher). Verified on every read after POSTED.

max. 128 caractèreslecture seulenullable
recordAddressSnapshotobjectfacultatif

Frozen invoice (recipient) address snapshot taken at POSTED. GoBD requires the address as printed on the original document.

lecture seulenullable
namestringfacultatif
max. 300 caractèresnullable
addressLine1stringfacultatif
max. 300 caractèresnullable
addressLine2stringfacultatif
max. 300 caractèresnullable
postalCodestringfacultatif
max. 20 caractèresnullable
citystringfacultatif
max. 200 caractèresnullable
statestringfacultatif
max. 200 caractèresnullable
countryCodestringfacultatif
max. 2 caractèresnullable
vatRegistrationNumberstringfacultatif
max. 50 caractèresnullable
deliveryAddressSnapshotobjectfacultatif

Frozen delivery address snapshot (if different from invoice address)

lecture seulenullable
namestringfacultatif
max. 300 caractèresnullable
addressLine1stringfacultatif
max. 300 caractèresnullable
addressLine2stringfacultatif
max. 300 caractèresnullable
postalCodestringfacultatif
max. 20 caractèresnullable
citystringfacultatif
max. 200 caractèresnullable
statestringfacultatif
max. 200 caractèresnullable
countryCodestringfacultatif
max. 2 caractèresnullable
exchangeRatestringfacultatif

Exchange rate to EUR at invoice date. Only set when currency != EUR. Used for DATEV export.

Motifnullable
sourcestringfacultatif

How the invoice was created

MANUALPERFORMANCE_RECORDSALES_ORDERCONTRACTWECLAPPCREDIT_NOTEWHOLESALE_LICENSING
Par défaut : "MANUAL"
customerTenantIdstringfacultatif

Customer tenant this invoice was generated for (only set when source=WHOLESALE_LICENSING).

MotifPar défaut : nullnullable
invoiceTypestringfacultatif
INVOICECREDIT_NOTE
Par défaut : "INVOICE"
creditedInvoiceIdstringfacultatif

Original invoice ID (for credit notes)

MotifPar défaut : nullnullable
contractIdstringfacultatif

Source contract (if generated from recurring billing)

MotifPar défaut : nullnullable
dunningLevelintegerfacultatif
0 – 3Par défaut : 0
lastDunningAtdatetimefacultatif
Par défaut : nullnullable
dunningBlockedUntildatefacultatif

Dunning suspended until this date

Par défaut : nullnullable
projectIduuidfacultatif

Project this invoice bills (propagated from a per-project performance record). Null/absent for collective, per-ticket and legacy invoices.

lecture seulenullable
performanceRecordIduuidfacultatif

Source performance record UUID (if generated from Leistungsnachweis)

nullable
billingAddressIdstringfacultatif

Separately billed customer site (party.addresses[]._id) this invoice is addressed to — copied from the performance record. Null/absent = the customer default address.

nullable
deliveryAddressIdstringfacultatif

Delivery address (party.addresses[]._id) printed on this invoice — copied from the contract. Null/absent = the customer DELIVERY address, if any.

nullable
titlestringfacultatif

Invoice title / subject

max. 200 caractèresnullable
introTextstringfacultatif

Introductory text above positions

max. 2000 caractèresnullable
closingTextstringfacultatif

Closing text below positions

max. 2000 caractèresnullable
notesstringfacultatif

Internal notes (not printed)

max. 2000 caractèresnullable
openTicketNotesobject[]facultatif

ADR 0146 — Snapshot copied from the source Leistungsnachweis: tickets that were still open at billing time but were unlocked via `ticket.billingOverride`. The invoice PDF renders a neutral "Hinweise"-section listing the affected ticket numbers; the internal reason is intentionally NOT propagated here.

Par défaut : []nullable
ticketIduuidobligatoire
ticketNumberstringobligatoire
max. 50 caractères
titlestringfacultatif
max. 500 caractèresnullable
releaseSourcestringfacultatif

ADR 1209 — internal: what released the open ticket (per-ticket override, customer rule, tenant rule). Missing on snapshots before ADR 1209 = TICKET.

TICKETCUSTOMERTENANTnull
nullable
itemsobject[]facultatif

Invoice line items

Par défaut : []
positionintegerfacultatif
≥ 1
descriptionstringobligatoire
max. 500 caractères
unitstringfacultatif
max. 20 caractèresnullable
quantitynumberobligatoire
≥ 0
unitPricestringobligatoire

Decimal string, e.g. "125.00"

vatRatestringfacultatif

VAT rate as percent string

Par défaut : "19"
netAmountstringfacultatif

Computed: quantity * unitPrice

nullable
articleIdstringfacultatif

Article reference (local UUID or weclapp article id)

max. 64 caractèresnullable
articleNumberstringfacultatif

Article SKU / weclapp articleNumber

nullable
itemTypestringfacultatif

Categorizes the line item origin

SERVICETRAVEL_DISTANCETRAVEL_TIMETRAVEL_OTHERFLAT_RATEEXPENSETICKETMATERIAL
nullable
materialBucketIduuidfacultatif

Source material bucket UUID (if generated from Materialkorb)

nullable
materialBucketItemIdstringfacultatif

Source line of the material bucket (`items[].id`) — lets the price weclapp sets reach the asset of that serial-number line

max. 64 caractèresnullable
expenseIduuidfacultatif

Source expense UUID (EXPENSE lines of a per-project billing run)

nullable
positionIduuidfacultatif

Source project_position UUID (FLAT_RATE lines of a per-project billing run)

nullable
contractIdstringfacultatif
Par défaut : nullnullable
contractItemIdstringfacultatif

Which contract position generated this invoice line

Par défaut : nullnullable
timeRecordIdstringfacultatif

Source time_record UUID — set when this line was generated from a single booking (perEntry, ungrouped perTicket, or travel linked via trip.timeRecordId).

MotifPar défaut : nullnullable
timeRecordNumberstringfacultatif

Human-readable record number (e.g. TR-2026-00042) of the source time record. Snapshotted at build time so the UI can deep-link without an extra fetch.

max. 50 caractèresPar défaut : nullnullable
ticketIdstringfacultatif

Source ticket UUID — set when this line aggregates time records of one ticket (perTicket) or originates from a TR with referenceType=TICKET.

MotifPar défaut : nullnullable
accountCodestringfacultatif

DATEV revenue account (Erlöskonto, e.g. "8400"). Falls back to article.revenueAccountCode at posting time.

max. 20 caractèresPar défaut : nullnullable
costCenterIdstringfacultatif

Cost center UUID (Kostenstelle) for DATEV

MotifPar défaut : nullnullable
pricedAtstringfacultatif

ADR 0415 — date (YYYY-MM-DD) at which the base rate of this line was resolved (copied 1:1 from the performance-record snapshot). Service date by default; billing-run date for pricingDateBasis=BILLING_DATE.

Par défaut : nullnullable
rateSourcestringfacultatif

ADR 0415 — provenance of the applied hourly rate (copied 1:1 from the performance-record snapshot). `position` = price of the sold order line (ADR 1056). `record` = rate frozen at booking time with unknown origin (legacy).

positioncontractparty_overrideparty_discountarticleservice_typerecordnull
Par défaut : nullnullable
nonBillableServicebooleanfacultatif

ADR 0873 §7 — travel line of a non-billable booking (copied 1:1 from the performance-record snapshot). Only set on travel lines.

priceFromErpbooleanfacultatif

Material line from a material bucket whose price weclapp sets: pushed without unitPrice and with manualUnitPrice=false, the price weclapp returns replaces the local 0.00 placeholder and the flag is removed. Absent on every other line.

groupLabelstringfacultatif

ADR 0909 — heading of the position group (copied 1:1 from the performance-record snapshot; material lines of a grouped invoice get the rendered material group). Missing = ungrouped. Pushed to weclapp as salesInvoiceItem.groupName.

max. 1000 caractèresnullable
costTypeIdstringfacultatif

Cost type UUID (Kostenträger) for DATEV

MotifPar défaut : nullnullable
taxKeystringfacultatif

DATEV Steuerschlüssel (e.g. "9" for 19% USt., "8" for 7%)

max. 10 caractèresPar défaut : nullnullable
netAmountstringfacultatif

Net total (excl. VAT) as decimal string

Motifnullable
vatAmountstringfacultatif

VAT total as decimal string

Motifnullable
grossAmountstringfacultatif

Gross total (incl. VAT) as decimal string

Motifnullable
vatRatestringfacultatif

Default VAT rate for this invoice

Par défaut : "19"
currencystringfacultatif
max. 3 caractèresPar défaut : "EUR"
paymentTermsDaysintegerfacultatif

Payment terms in days (e.g. 14, 30)

≥ 0nullable
pdfFileIduuidfacultatif

Reference to stored PDF file in files collection

nullable
weclappIdstringfacultatif

External weclapp sales invoice ID (if synced from weclapp)

lecture seulenullable
weclappBaseUrlstringfacultatif

Base URL of the weclapp tenant (e.g. https://demo.weclapp.com) for deep-linking

lecture seulenullable
externalVersionstringfacultatif

External system version (e.g. weclapp `version` field). Used to detect changes without re-downloading the PDF.

lecture seulenullable
syncedAtdatetimefacultatif

Timestamp of the last successful sync from the external system

lecture seulenullable
customerPaymentReportedAtdatetimefacultatif

Set when the customer pressed "Bezahlt gemeldet" in the portal. Does NOT change `status` — the MSP confirms separately. UI surfaces this as a yellow "Zahlung gemeldet" pill until the MSP transitions to PAID.

lecture seulenullable
customerPaymentReportedByuuidfacultatif

Customer portal user who reported the payment

lecture seulenullable
customerPaymentReferencestringfacultatif

Optional reference text from the customer (e.g. SEPA reference, IBAN-Last4)

max. 200 caractèreslecture seulenullable
groupingModestringfacultatif

Grouping mode used when generating line items from performance record

onePositionperTicketperEntry
nullable
groupPositionsByTicketbooleanfacultatif

ADR 0909 — copied from the performance record: items carry groupLabel headings (grouped by ticket). Missing = ungrouped.

nullable
servicePeriodFromdatefacultatif

Service period start (from performance record)

nullable
servicePeriodTodatefacultatif

Service period end (from performance record)

nullable
salesOrderIdstringfacultatif

Source sales order UUID (if generated from order)

MotifPar défaut : nullnullable
proposalIdstringfacultatif

Legacy: source proposal UUID. ADR 1237: proposal entity removed; field kept for existing documents.

MotifPar défaut : nullnullable

Endpoints standard

Cette ressource suit le contrat CRUD générique de la plateforme. Lisez les conventions pour la pagination, l'idempotence, le verrouillage optimiste et l'audit. Les endpoints principaux :

  • GET /api/v1/invoices — Liste, paginée et filtrable
  • GET /api/v1/invoices/<id> — Une entité
  • POST /api/v1/invoices — Créer
  • PATCH /api/v1/invoices/<id> — Mise à jour partielle
  • DELETE /api/v1/invoices/<id> — Suppression logique
  • GET /api/v1/invoices/<id>/timeline — Audit et activités

Recherche