API · v1 · stabiel
CODEMETA OSDeveloper Center
NL
Console openen
Entity · invoices

Invoice Schema

Schema-ID
invoice
Collection
invoices
Permissions
  • Lezeninvoice_view
  • Aanmakeninvoice_create
  • Wijzigeninvoice_edit
  • Verwijdereninvoice_delete
Relaties

Velden

Invoice Schema

invoices4 permissions

Schema for validating Rechnung (invoice) entities

documentLanguagestringoptioneel

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
partyIduuidvereist

Customer party UUID

invoiceNumberstringoptioneel

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

max. 1000 tekensread-onlynullable
invoiceDatedateoptioneel

Invoice date

nullable
dueDatedateoptioneel

Payment due date

nullable
statusstringvereist

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

DRAFTPOSTEDSENTPAIDPARTIALLY_PAIDOVERDUECANCELLEDCREDITED
Default: "DRAFT"
salesInvoiceTypestringoptioneel

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

STANDARDADVANCE_PAYMENTPART_PAYMENTPREPAYMENTFINALRECURRINGRETAIL
Default: "STANDARD"
bookingDatedateoptioneel

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

nullable
lockedAtdatetimeoptioneel

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

read-onlynullable
lockedByuuidoptioneel

User UUID who posted (locked) the invoice

read-onlynullable
contentHashstringoptioneel

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

max. 128 tekensread-onlynullable
recordAddressSnapshotobjectoptioneel

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

read-onlynullable
namestringoptioneel
max. 300 tekensnullable
addressLine1stringoptioneel
max. 300 tekensnullable
addressLine2stringoptioneel
max. 300 tekensnullable
postalCodestringoptioneel
max. 20 tekensnullable
citystringoptioneel
max. 200 tekensnullable
statestringoptioneel
max. 200 tekensnullable
countryCodestringoptioneel
max. 2 tekensnullable
vatRegistrationNumberstringoptioneel
max. 50 tekensnullable
deliveryAddressSnapshotobjectoptioneel

Frozen delivery address snapshot (if different from invoice address)

read-onlynullable
namestringoptioneel
max. 300 tekensnullable
addressLine1stringoptioneel
max. 300 tekensnullable
addressLine2stringoptioneel
max. 300 tekensnullable
postalCodestringoptioneel
max. 20 tekensnullable
citystringoptioneel
max. 200 tekensnullable
statestringoptioneel
max. 200 tekensnullable
countryCodestringoptioneel
max. 2 tekensnullable
exchangeRatestringoptioneel

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

Patternnullable
sourcestringoptioneel

How the invoice was created

MANUALPERFORMANCE_RECORDSALES_ORDERCONTRACTWECLAPPCREDIT_NOTEWHOLESALE_LICENSING
Default: "MANUAL"
customerTenantIdstringoptioneel

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

PatternDefault: nullnullable
invoiceTypestringoptioneel
INVOICECREDIT_NOTE
Default: "INVOICE"
creditedInvoiceIdstringoptioneel

Original invoice ID (for credit notes)

PatternDefault: nullnullable
contractIdstringoptioneel

Source contract (if generated from recurring billing)

PatternDefault: nullnullable
dunningLevelintegeroptioneel
0 – 3Default: 0
lastDunningAtdatetimeoptioneel
Default: nullnullable
dunningBlockedUntildateoptioneel

Dunning suspended until this date

Default: nullnullable
projectIduuidoptioneel

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

read-onlynullable
performanceRecordIduuidoptioneel

Source performance record UUID (if generated from Leistungsnachweis)

nullable
billingAddressIdstringoptioneel

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

nullable
deliveryAddressIdstringoptioneel

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

nullable
titlestringoptioneel

Invoice title / subject

max. 200 tekensnullable
introTextstringoptioneel

Introductory text above positions

max. 2000 tekensnullable
closingTextstringoptioneel

Closing text below positions

max. 2000 tekensnullable
notesstringoptioneel

Internal notes (not printed)

max. 2000 tekensnullable
openTicketNotesobject[]optioneel

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.

Default: []nullable
ticketIduuidvereist
ticketNumberstringvereist
max. 50 tekens
titlestringoptioneel
max. 500 tekensnullable
releaseSourcestringoptioneel

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[]optioneel

Invoice line items

Default: []
positionintegeroptioneel
≥ 1
descriptionstringvereist
max. 500 tekens
unitstringoptioneel
max. 20 tekensnullable
quantitynumbervereist
≥ 0
unitPricestringvereist

Decimal string, e.g. "125.00"

vatRatestringoptioneel

VAT rate as percent string

Default: "19"
netAmountstringoptioneel

Computed: quantity * unitPrice

nullable
articleIdstringoptioneel

Article reference (local UUID or weclapp article id)

max. 64 tekensnullable
articleNumberstringoptioneel

Article SKU / weclapp articleNumber

nullable
itemTypestringoptioneel

Categorizes the line item origin

SERVICETRAVEL_DISTANCETRAVEL_TIMETRAVEL_OTHERFLAT_RATEEXPENSETICKETMATERIAL
nullable
materialBucketIduuidoptioneel

Source material bucket UUID (if generated from Materialkorb)

nullable
materialBucketItemIdstringoptioneel

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

max. 64 tekensnullable
expenseIduuidoptioneel

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

nullable
positionIduuidoptioneel

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

nullable
contractIdstringoptioneel
Default: nullnullable
contractItemIdstringoptioneel

Which contract position generated this invoice line

Default: nullnullable
timeRecordIdstringoptioneel

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

PatternDefault: nullnullable
timeRecordNumberstringoptioneel

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 tekensDefault: nullnullable
ticketIdstringoptioneel

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

PatternDefault: nullnullable
accountCodestringoptioneel

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

max. 20 tekensDefault: nullnullable
costCenterIdstringoptioneel

Cost center UUID (Kostenstelle) for DATEV

PatternDefault: nullnullable
pricedAtstringoptioneel

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.

Default: nullnullable
rateSourcestringoptioneel

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
Default: nullnullable
nonBillableServicebooleanoptioneel

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

priceFromErpbooleanoptioneel

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.

groupLabelstringoptioneel

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 tekensnullable
costTypeIdstringoptioneel

Cost type UUID (Kostenträger) for DATEV

PatternDefault: nullnullable
taxKeystringoptioneel

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

max. 10 tekensDefault: nullnullable
netAmountstringoptioneel

Net total (excl. VAT) as decimal string

Patternnullable
vatAmountstringoptioneel

VAT total as decimal string

Patternnullable
grossAmountstringoptioneel

Gross total (incl. VAT) as decimal string

Patternnullable
vatRatestringoptioneel

Default VAT rate for this invoice

Default: "19"
currencystringoptioneel
max. 3 tekensDefault: "EUR"
paymentTermsDaysintegeroptioneel

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

≥ 0nullable
pdfFileIduuidoptioneel

Reference to stored PDF file in files collection

nullable
weclappIdstringoptioneel

External weclapp sales invoice ID (if synced from weclapp)

read-onlynullable
weclappBaseUrlstringoptioneel

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

read-onlynullable
externalVersionstringoptioneel

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

read-onlynullable
syncedAtdatetimeoptioneel

Timestamp of the last successful sync from the external system

read-onlynullable
customerPaymentReportedAtdatetimeoptioneel

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.

read-onlynullable
customerPaymentReportedByuuidoptioneel

Customer portal user who reported the payment

read-onlynullable
customerPaymentReferencestringoptioneel

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

max. 200 tekensread-onlynullable
groupingModestringoptioneel

Grouping mode used when generating line items from performance record

onePositionperTicketperEntry
nullable
groupPositionsByTicketbooleanoptioneel

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

nullable
servicePeriodFromdateoptioneel

Service period start (from performance record)

nullable
servicePeriodTodateoptioneel

Service period end (from performance record)

nullable
salesOrderIdstringoptioneel

Source sales order UUID (if generated from order)

PatternDefault: nullnullable
proposalIdstringoptioneel

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

PatternDefault: nullnullable

Standaard-endpoints

Deze resource volgt het generieke CRUD-contract van het platform. Lees de conventies voor paginering, idempotentie, optimistic locking en audit. De belangrijkste endpoints:

  • GET /api/v1/invoices — Lijst, gepagineerd + filterbaar
  • GET /api/v1/invoices/<id> — Enkele entity
  • POST /api/v1/invoices — Aanmaken
  • PATCH /api/v1/invoices/<id> — Gedeeltelijke update
  • DELETE /api/v1/invoices/<id> — Soft-delete
  • GET /api/v1/invoices/<id>/timeline — Audit + activiteiten

Zoeken