xrechnung-kit API reference

MappingData
in package

FinalYes

Root of the typed value-object graph that flows from the consumer's mapper into the generator pipeline. Once constructed, MappingData is structurally trusted; downstream stages (Builder, Generator, Validator, Writer) do not re-validate the shape.

Construction is via one of the five named constructors that match the document classes the kit emits at v1.0:

  • standardInvoice (commercial invoice, UNTDID 380)
  • partialInvoice (Anzahlung, UNTDID 326; period required)
  • cautionInvoice (security deposit; period and dueDate required)
  • creditNote (cancellation, UNTDID 381; prior reference required)
  • depositCancellation (UNTDID 381; both prior reference and period required)

Direct __construct is allowed for advanced callers but does not enforce the per-document-class invariants the named constructors check.

Note on enum naming: the lifted XRechnungInvoiceTypeCode case names follow the L3 convention rather than the UNTDID semantic - CREDIT_NOTE = 326 is actually Partial Invoice, DEBIT_NOTE = 381 is actually Credit Note. The named constructors here use the architecture's terminology (partialInvoice, creditNote) and pin the right enum case internally; consumers should not read the case names directly.

Table of Contents

Properties

$attachments  : array<string|int, mixed>
$buyer  : Party
$lines  : array<string|int, mixed>
$meta  : DocumentMeta
$notes  : array<string|int, mixed>
$payment  : array<string|int, mixed>
$period  : DocumentPeriod|null
$prior  : BillingReference|null
$seller  : Party
$taxes  : array<string|int, mixed>
$totals  : DocumentTotals

Methods

__construct()  : mixed
cautionInvoice()  : self
Caution / security deposit invoice (UNTDID 380 caution variant).
creditNote()  : self
Credit note / cancellation (UNTDID 381). Prior invoice reference (BG-3 / BT-25) is required by BR-DE-22.
depositCancellation()  : self
Deposit cancellation (UNTDID 381). Both prior invoice reference and document period are required.
partialInvoice()  : self
Partial invoice / Anzahlung (UNTDID 326). Document period (BG-14) is required by BR-DE-TMP-32.
standardInvoice()  : self
Standard commercial invoice (UNTDID 380). The vanilla case.

Properties

$attachments read-only

public array<string|int, mixed> $attachments = []

$lines read-only

public array<string|int, mixed> $lines

$notes read-only

public array<string|int, mixed> $notes = []

$payment read-only

public array<string|int, mixed> $payment

$taxes read-only

public array<string|int, mixed> $taxes

Methods

__construct()

public __construct(DocumentMeta $meta, Party $seller, Party $buyer, array<int, LineItem$lines, array<int, TaxBreakdown$taxes, array<int, PaymentMeans$payment, DocumentTotals $totals[, DocumentPeriod|null $period = null ][, BillingReference|null $prior = null ][, array<int, Attachment$attachments = [] ][, array<int, Note$notes = [] ]) : mixed
Parameters
$meta : DocumentMeta
$seller : Party
$buyer : Party
$lines : array<int, LineItem>
$taxes : array<int, TaxBreakdown>
$payment : array<int, PaymentMeans>
$totals : DocumentTotals
$period : DocumentPeriod|null = null
$prior : BillingReference|null = null
$attachments : array<int, Attachment> = []
$notes : array<int, Note> = []

cautionInvoice()

Caution / security deposit invoice (UNTDID 380 caution variant).

public static cautionInvoice(DocumentMeta $meta, Party $seller, Party $buyer, array<int, LineItem$lines, array<int, TaxBreakdown$taxes, array<int, PaymentMeans$payment, DocumentTotals $totals, DocumentPeriod $period[, array<int, Attachment$attachments = [] ][, array<int, Note$notes = [] ]) : self

Both period and dueDate are required.

Parameters
$meta : DocumentMeta
$seller : Party
$buyer : Party
$lines : array<int, LineItem>
$taxes : array<int, TaxBreakdown>
$payment : array<int, PaymentMeans>
$totals : DocumentTotals
$period : DocumentPeriod
$attachments : array<int, Attachment> = []
$notes : array<int, Note> = []
Return values
self

creditNote()

Credit note / cancellation (UNTDID 381). Prior invoice reference (BG-3 / BT-25) is required by BR-DE-22.

public static creditNote(DocumentMeta $meta, Party $seller, Party $buyer, array<int, LineItem$lines, array<int, TaxBreakdown$taxes, array<int, PaymentMeans$payment, DocumentTotals $totals, BillingReference $prior[, DocumentPeriod|null $period = null ][, array<int, Attachment$attachments = [] ][, array<int, Note$notes = [] ]) : self
Parameters
$meta : DocumentMeta
$seller : Party
$buyer : Party
$lines : array<int, LineItem>
$taxes : array<int, TaxBreakdown>
$payment : array<int, PaymentMeans>
$totals : DocumentTotals
$prior : BillingReference
$period : DocumentPeriod|null = null
$attachments : array<int, Attachment> = []
$notes : array<int, Note> = []
Return values
self

depositCancellation()

Deposit cancellation (UNTDID 381). Both prior invoice reference and document period are required.

public static depositCancellation(DocumentMeta $meta, Party $seller, Party $buyer, array<int, LineItem$lines, array<int, TaxBreakdown$taxes, array<int, PaymentMeans$payment, DocumentTotals $totals, BillingReference $prior, DocumentPeriod $period[, array<int, Attachment$attachments = [] ][, array<int, Note$notes = [] ]) : self
Parameters
$meta : DocumentMeta
$seller : Party
$buyer : Party
$lines : array<int, LineItem>
$taxes : array<int, TaxBreakdown>
$payment : array<int, PaymentMeans>
$totals : DocumentTotals
$prior : BillingReference
$period : DocumentPeriod
$attachments : array<int, Attachment> = []
$notes : array<int, Note> = []
Return values
self

partialInvoice()

Partial invoice / Anzahlung (UNTDID 326). Document period (BG-14) is required by BR-DE-TMP-32.

public static partialInvoice(DocumentMeta $meta, Party $seller, Party $buyer, array<int, LineItem$lines, array<int, TaxBreakdown$taxes, array<int, PaymentMeans$payment, DocumentTotals $totals, DocumentPeriod $period[, array<int, Attachment$attachments = [] ][, array<int, Note$notes = [] ]) : self
Parameters
$meta : DocumentMeta
$seller : Party
$buyer : Party
$lines : array<int, LineItem>
$taxes : array<int, TaxBreakdown>
$payment : array<int, PaymentMeans>
$totals : DocumentTotals
$period : DocumentPeriod
$attachments : array<int, Attachment> = []
$notes : array<int, Note> = []
Return values
self

standardInvoice()

Standard commercial invoice (UNTDID 380). The vanilla case.

public static standardInvoice(DocumentMeta $meta, Party $seller, Party $buyer, array<int, LineItem$lines, array<int, TaxBreakdown$taxes, array<int, PaymentMeans$payment, DocumentTotals $totals[, DocumentPeriod|null $period = null ][, array<int, Attachment$attachments = [] ][, array<int, Note$notes = [] ]) : self
Parameters
$meta : DocumentMeta
$seller : Party
$buyer : Party
$lines : array<int, LineItem>
$taxes : array<int, TaxBreakdown>
$payment : array<int, PaymentMeans>
$totals : DocumentTotals
$period : DocumentPeriod|null = null
$attachments : array<int, Attachment> = []
$notes : array<int, Note> = []
Return values
self

        
On this page

Search results