Invoice Schema
Felder
Invoice Schema
Schema for validating Rechnung (invoice) entities
partyId
Customer party UUID
invoiceNumber
Auto-generated sequence number (e.g. RE-2026-00001)
invoiceDate
Invoice date
dueDate
Payment due date
status
Invoice lifecycle status. POSTED = verbucht / revisionssicher festgeschrieben (lockedAt set). SENT = an Kunden versandt. Beide sind immutable.
DRAFTPOSTEDSENTPAIDPARTIALLY_PAIDOVERDUECANCELLEDCREDITEDsalesInvoiceType
Type of sales invoice (mirrors weclapp salesInvoiceOrigin). ADVANCE_PAYMENT=Anzahlung, PART_PAYMENT=Teilrechnung, FINAL=Schlussrechnung, RECURRING=wiederkehrend
STANDARDADVANCE_PAYMENTPART_PAYMENTPREPAYMENTFINALRECURRINGRETAILbookingDate
Buchungsdatum für DATEV (may differ from invoiceDate). Set on POSTED, drives the booking period.
lockedAt
When the invoice was locked (POSTED). After this the invoice is immutable except for status changes (PAID/OVERDUE/CANCELLED) and dunning fields.
lockedBy
User UUID who posted (locked) the invoice
contentHash
SHA-256 hash of canonical invoice content at lock time (GoBD revisionssicher). Verified on every read after POSTED.
recordAddressSnapshot
Frozen invoice (recipient) address snapshot taken at POSTED. GoBD requires the address as printed on the original document.
name
addressLine1
addressLine2
postalCode
city
state
countryCode
vatRegistrationNumber
deliveryAddressSnapshot
Frozen delivery address snapshot (if different from invoice address)
name
addressLine1
addressLine2
postalCode
city
state
countryCode
exchangeRate
Exchange rate to EUR at invoice date. Only set when currency != EUR. Used for DATEV export.
source
How the invoice was created
MANUALPERFORMANCE_RECORDSALES_ORDERCONTRACTWECLAPPCREDIT_NOTEWHOLESALE_LICENSINGcustomerTenantId
Customer tenant this invoice was generated for (only set when source=WHOLESALE_LICENSING).
invoiceType
INVOICECREDIT_NOTEcreditedInvoiceId
Original invoice ID (for credit notes)
contractId
Source contract (if generated from recurring billing)
dunningLevel
lastDunningAt
dunningBlockedUntil
Dunning suspended until this date
projectId
Project this invoice bills (propagated from a per-project performance record). Null/absent for collective, per-ticket and legacy invoices.
performanceRecordId
Source performance record UUID (if generated from Leistungsnachweis)
title
Invoice title / subject
introText
Introductory text above positions
closingText
Closing text below positions
notes
Internal notes (not printed)
openTicketNotes
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.
items
Invoice line items
position
description
unit
quantity
unitPrice
Decimal string, e.g. "125.00"
vatRate
VAT rate as percent string
netAmount
Computed: quantity * unitPrice
articleId
Article reference (local UUID or weclapp article id)
articleNumber
Article SKU / weclapp articleNumber
itemType
Categorizes the line item origin
SERVICETRAVEL_DISTANCETRAVEL_TIMETRAVEL_OTHERFLAT_RATEEXPENSETICKETMATERIALmaterialBucketId
Source material bucket UUID (if generated from Materialkorb)
expenseId
Source expense UUID (EXPENSE lines of a per-project billing run)
positionId
Source project_position UUID (FLAT_RATE lines of a per-project billing run)
contractId
contractItemId
Which contract position generated this invoice line
timeRecordId
Source time_record UUID — set when this line was generated from a single booking (perEntry, ungrouped perTicket, or travel linked via trip.timeRecordId).
timeRecordNumber
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.
ticketId
Source ticket UUID — set when this line aggregates time records of one ticket (perTicket) or originates from a TR with referenceType=TICKET.
accountCode
DATEV revenue account (Erlöskonto, e.g. "8400"). Falls back to article.revenueAccountCode at posting time.
costCenterId
Cost center UUID (Kostenstelle) for DATEV
pricedAt
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.
rateSource
ADR 0415 — provenance of the applied hourly rate (copied 1:1 from the performance-record snapshot). `record` = rate frozen at booking time with unknown origin (legacy).
contractparty_overrideparty_discountarticleservice_typerecordnullcostTypeId
Cost type UUID (Kostenträger) for DATEV
taxKey
DATEV Steuerschlüssel (e.g. "9" for 19% USt., "8" for 7%)
netAmount
Net total (excl. VAT) as decimal string
vatAmount
VAT total as decimal string
grossAmount
Gross total (incl. VAT) as decimal string
vatRate
Default VAT rate for this invoice
currency
paymentTermsDays
Payment terms in days (e.g. 14, 30)
pdfFileId
Reference to stored PDF file in files collection
weclappId
External weclapp sales invoice ID (if synced from weclapp)
weclappBaseUrl
Base URL of the weclapp tenant (e.g. https://demo.weclapp.com) for deep-linking
externalVersion
External system version (e.g. weclapp `version` field). Used to detect changes without re-downloading the PDF.
syncedAt
Timestamp of the last successful sync from the external system
customerPaymentReportedAt
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.
customerPaymentReportedBy
Customer portal user who reported the payment
customerPaymentReference
Optional reference text from the customer (e.g. SEPA reference, IBAN-Last4)
groupingMode
Grouping mode used when generating line items from performance record
onePositionperTicketperEntryservicePeriodFrom
Service period start (from performance record)
servicePeriodTo
Service period end (from performance record)
salesOrderId
Source sales order UUID (if generated from order)
proposalId
Source proposal UUID (if traceable to a proposal)
Keine Felder passen zum Filter.
Standard-Endpoints
Diese Resource folgt dem generischen CRUD-Vertrag der Plattform. Lesen Sie die Konventionen für Pagination, Idempotenz, Optimistic Locking und Audit. Die wichtigsten Endpoints:
GET /api/v1/invoices— Liste, paginiert + filterbarGET /api/v1/invoices/<id>— Einzelne EntityPOST /api/v1/invoices— AnlegenPATCH /api/v1/invoices/<id>— Teil-UpdateDELETE /api/v1/invoices/<id>— Soft-DeleteGET /api/v1/invoices/<id>/timeline— Audit + Aktivitäten