---
title: "InvoiceData – API-Referenz · Quittio"
description: "Root of the semantic invoice model (EN 16931, superset of the 2017 and 2026 versions)."
canonical_url: "https://quittio.dev/docs/api/Quittio/Core/Data/InvoiceData"
locale: de
meta:
  "og:description": "Root of the semantic invoice model (EN 16931, superset of the 2017 and 2026 versions)."
  "og:image": "https://quittio.dev/og/quittio-de.jpg"
  "og:image:alt": "Quittio: E-Rechnungen für PHP und Laravel. Rechtssicher, validiert, archiviert, mit geprüfter Beispielrechnung."
  "og:image:height": "630"
  "og:image:type": image/jpeg
  "og:image:width": "1200"
  "og:title": "InvoiceData – API-Referenz · Quittio"
  "twitter:image": "https://quittio.dev/og/quittio-de.jpg"
  "twitter:image:alt": "Quittio: E-Rechnungen für PHP und Laravel. Rechtssicher, validiert, archiviert, mit geprüfter Beispielrechnung."
---

> Index of every page on this site: [llms.txt](https://quittio.dev/llms.txt)

[API reference](https://quittio.dev/docs/api) / [Quittio](https://quittio.dev/docs/api/Quittio) \\ [Core](https://quittio.dev/docs/api/Quittio/Core) \\ [Data](https://quittio.dev/docs/api/Quittio/Core/Data)

# InvoiceData

final readonly class in quittio/core · uses [`Immutable`](https://quittio.dev/docs/api/Quittio/Core/Data/Concerns/Immutable)

`Quittio\Core\Data\InvoiceData` · [Source](https://github.com/Quittio/quittio/blob/v0.7.1/packages/core/src/Data/InvoiceData.php#L51)

Root of the semantic invoice model (EN 16931, superset of the 2017 and 2026 versions).

The specification identifier (BT-24) is not part of the data: it is derived from the profile. Totals (BG-22) and the VAT breakdown (BG-23) are set by the calculator.

## Constants \#

| Constant | Value | Description |
| --- | --- | --- |
| `SNAPSHOT_VERSION` | `1` | Schema version of serialised snapshots, used by upcasters. |

## Properties \#

| Property | Type | Description |
| --- | --- | --- |
| `$allowances` readonly | `list< [DocumentAllowance](https://quittio.dev/docs/api/Quittio/Core/Data/AllowanceCharge/DocumentAllowance)>` | |
| `$attachments` readonly | `list< [Attachment](https://quittio.dev/docs/api/Quittio/Core/Data/Attachments/Attachment)>` | |
| `$businessProcess` readonly | `?string` | |
| `$buyer` readonly | `[BuyerParty](https://quittio.dev/docs/api/Quittio/Core/Data/Party/BuyerParty)` | |
| `$buyerAccountingReference` readonly | `?string` | |
| `$buyerReference` readonly | `?string` | |
| `$charges` readonly | `list< [DocumentCharge](https://quittio.dev/docs/api/Quittio/Core/Data/AllowanceCharge/DocumentCharge)>` | |
| `$contractReference` readonly | `?string` | |
| `$currency` readonly | `string` | |
| `$delivery` readonly | `? [Delivery](https://quittio.dev/docs/api/Quittio/Core/Data/Delivery/Delivery)` | |
| `$despatchAdviceReference` readonly | `?string` | |
| `$dueDate` readonly | `? [Date](https://quittio.dev/docs/api/Quittio/Core/Support/Date)` | |
| `$extended` readonly | `? [ExtendedData](https://quittio.dev/docs/api/Quittio/Core/Data/Extensions/ExtendedData)` | |
| `$invoicedObject` readonly | `? [Identifier](https://quittio.dev/docs/api/Quittio/Core/Data/Identifier)` | |
| `$invoicingPeriod` readonly | `? [Period](https://quittio.dev/docs/api/Quittio/Core/Data/Delivery/Period)` | |
| `$issueDate` readonly | `[Date](https://quittio.dev/docs/api/Quittio/Core/Support/Date)` | |
| `$lines` readonly | `list< [InvoiceLine](https://quittio.dev/docs/api/Quittio/Core/Data/Lines/InvoiceLine)>` | |
| `$meta` readonly | `[Meta](https://quittio.dev/docs/api/Quittio/Core/Data/Meta)` | |
| `$notes` readonly | `list< [Note](https://quittio.dev/docs/api/Quittio/Core/Data/Note)>` | |
| `$number` readonly | `string` | |
| `$payee` readonly | `? [PayeeParty](https://quittio.dev/docs/api/Quittio/Core/Data/Party/PayeeParty)` | |
| `$paymentInstructions` readonly | `? [PaymentInstructions](https://quittio.dev/docs/api/Quittio/Core/Data/Payment/PaymentInstructions)` | |
| `$paymentTerms` readonly | `? [PaymentTerms](https://quittio.dev/docs/api/Quittio/Core/Data/Payment/PaymentTerms)` | |
| `$precedingInvoices` readonly | `list< [PrecedingInvoiceReference](https://quittio.dev/docs/api/Quittio/Core/Data/References/PrecedingInvoiceReference)>` | |
| `$prepaidAmount` readonly | `?Brick\Money\Money` | |
| `$presentation` readonly | `? [Presentation](https://quittio.dev/docs/api/Quittio/Core/Data/Presentation/Presentation)` | |
| `$projectReference` readonly | `? [ProjectReference](https://quittio.dev/docs/api/Quittio/Core/Data/References/ProjectReference)` | |
| `$purchaseOrderReference` readonly | `?string` | |
| `$receivingAdviceReference` readonly | `?string` | |
| `$roundingAmount` readonly | `?Brick\Money\Money` | |
| `$salesOrderReference` readonly | `?string` | |
| `$seller` readonly | `[SellerParty](https://quittio.dev/docs/api/Quittio/Core/Data/Party/SellerParty)` | |
| `$sellerTaxRepresentative` readonly | `? [TaxRepresentativeParty](https://quittio.dev/docs/api/Quittio/Core/Data/Party/TaxRepresentativeParty)` | |
| `$standardVersion` readonly | `[StandardVersion](https://quittio.dev/docs/api/Quittio/Core/Standards/StandardVersion)` | |
| `$taxCurrency` readonly | `?string` | |
| `$taxPointDate` readonly | `? [Date](https://quittio.dev/docs/api/Quittio/Core/Support/Date)` | |
| `$taxPointDateCode` readonly | `[TaxPointDateCode](https://quittio.dev/docs/api/Quittio/Core/Enums/TaxPointDateCode)\| [RawCode](https://quittio.dev/docs/api/Quittio/Core/Codes/RawCode)\|null` | |
| `$tenderReference` readonly | `?string` | |
| `$totals` readonly | `? [Totals](https://quittio.dev/docs/api/Quittio/Core/Data/Totals/Totals)` | |
| `$typeCode` readonly | `[InvoiceTypeCode](https://quittio.dev/docs/api/Quittio/Core/Enums/InvoiceTypeCode)\| [RawCode](https://quittio.dev/docs/api/Quittio/Core/Codes/RawCode)` | |
| `$vatBreakdown` readonly | `list< [VatBreakdown](https://quittio.dev/docs/api/Quittio/Core/Data/Totals/VatBreakdown)>` | |
| `$xrechnungExtension` readonly | `? [XRechnungExtensionData](https://quittio.dev/docs/api/Quittio/Core/Data/Extensions/XRechnungExtensionData)` | |

## Methods \#

| Method | Description |
| --- | --- |
| `->__construct()` | |
| `->allLines()` | All lines including sub lines, depth first. |
| `::factory()` | Deterministic test data, e.g. InvoiceData::factory()->reverseCharge()->withLines(5)->make(). |
| `::fromArray()` | |
| `::fromJson()` | |
| `::fromSnapshot()` | Restores a stored snapshot of any older version through the upcaster chain. Snapshots without "\_version" are treated as version 1. |
| `->isCalculated()` | |
| `->isCreditNote()` | |
| `->toArray()` | |
| `->toJson()` | |
| `->toSnapshot()` | Serialised form for storage (Managed layer). Includes the snapshot version. |
| `->typeCodeValue()` | |
| `->with()` | Returns a copy with the given properties replaced. |
| `->withImpliedExchangeRate()` | Copy with the exchange rate implied by the declared VAT totals (BT-111 / BT-110, ten decimals), e.g. for data read from XML, which carries no exchange rate. A recalculation then reproduces BT-111, also with changed or negated amounts. Data with an exchange rate, without a VAT accounting currency (BT-6) or without a declared non-zero BT-110 is returned unchanged. |
| `->withIssueDate()` | |
| `->withNumber()` | |

### `__construct()`#

```
public function __construct(
    string $number,
    Date $issueDate,
    InvoiceTypeCode|RawCode $typeCode,
    string $currency,
    SellerParty $seller,
    BuyerParty $buyer,
    list<InvoiceLine> $lines,
    ?string $taxCurrency = null,
    ?Date $taxPointDate = null,
    TaxPointDateCode|RawCode|null $taxPointDateCode = null,
    ?Date $dueDate = null,
    ?string $buyerReference = null,
    ?ProjectReference $projectReference = null,
    ?string $contractReference = null,
    ?string $purchaseOrderReference = null,
    ?string $salesOrderReference = null,
    ?string $receivingAdviceReference = null,
    ?string $despatchAdviceReference = null,
    ?string $tenderReference = null,
    ?Identifier $invoicedObject = null,
    ?string $buyerAccountingReference = null,
    ?PaymentTerms $paymentTerms = null,
    list<Note> $notes = [],
    ?string $businessProcess = null,
    list<PrecedingInvoiceReference> $precedingInvoices = [],
    ?PayeeParty $payee = null,
    ?TaxRepresentativeParty $sellerTaxRepresentative = null,
    ?Delivery $delivery = null,
    ?Period $invoicingPeriod = null,
    ?PaymentInstructions $paymentInstructions = null,
    list<DocumentAllowance> $allowances = [],
    list<DocumentCharge> $charges = [],
    ?Totals $totals = null,
    list<VatBreakdown> $vatBreakdown = [],
    list<Attachment> $attachments = [],
    ?Money $prepaidAmount = null,
    ?Money $roundingAmount = null,
    ?ExtendedData $extended = null,
    ?XRechnungExtensionData $xrechnungExtension = null,
    ?Presentation $presentation = null,
    Meta $meta = new \Quittio\Core\Data\Meta(),
    StandardVersion $standardVersion = \Quittio\Core\Standards\StandardVersion::En16931_2017,
)
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$number` | `string` | |
| `$issueDate` | `[Date](https://quittio.dev/docs/api/Quittio/Core/Support/Date)` | |
| `$typeCode` | `[InvoiceTypeCode](https://quittio.dev/docs/api/Quittio/Core/Enums/InvoiceTypeCode)\| [RawCode](https://quittio.dev/docs/api/Quittio/Core/Codes/RawCode)` | |
| `$currency` | `string` | |
| `$seller` | `[SellerParty](https://quittio.dev/docs/api/Quittio/Core/Data/Party/SellerParty)` | |
| `$buyer` | `[BuyerParty](https://quittio.dev/docs/api/Quittio/Core/Data/Party/BuyerParty)` | |
| `$lines` | `list< [InvoiceLine](https://quittio.dev/docs/api/Quittio/Core/Data/Lines/InvoiceLine)>` | |
| `$taxCurrency` | `?string` = `null` | |
| `$taxPointDate` | `? [Date](https://quittio.dev/docs/api/Quittio/Core/Support/Date)` = `null` | |
| `$taxPointDateCode` | `[TaxPointDateCode](https://quittio.dev/docs/api/Quittio/Core/Enums/TaxPointDateCode)\| [RawCode](https://quittio.dev/docs/api/Quittio/Core/Codes/RawCode)\|null` = `null` | |
| `$dueDate` | `? [Date](https://quittio.dev/docs/api/Quittio/Core/Support/Date)` = `null` | |
| `$buyerReference` | `?string` = `null` | |
| `$projectReference` | `? [ProjectReference](https://quittio.dev/docs/api/Quittio/Core/Data/References/ProjectReference)` = `null` | |
| `$contractReference` | `?string` = `null` | |
| `$purchaseOrderReference` | `?string` = `null` | |
| `$salesOrderReference` | `?string` = `null` | |
| `$receivingAdviceReference` | `?string` = `null` | |
| `$despatchAdviceReference` | `?string` = `null` | |
| `$tenderReference` | `?string` = `null` | |
| `$invoicedObject` | `? [Identifier](https://quittio.dev/docs/api/Quittio/Core/Data/Identifier)` = `null` | |
| `$buyerAccountingReference` | `?string` = `null` | |
| `$paymentTerms` | `? [PaymentTerms](https://quittio.dev/docs/api/Quittio/Core/Data/Payment/PaymentTerms)` = `null` | |
| `$notes` | `list< [Note](https://quittio.dev/docs/api/Quittio/Core/Data/Note)>` = `[]` | |
| `$businessProcess` | `?string` = `null` | |
| `$precedingInvoices` | `list< [PrecedingInvoiceReference](https://quittio.dev/docs/api/Quittio/Core/Data/References/PrecedingInvoiceReference)>` = `[]` | |
| `$payee` | `? [PayeeParty](https://quittio.dev/docs/api/Quittio/Core/Data/Party/PayeeParty)` = `null` | |
| `$sellerTaxRepresentative` | `? [TaxRepresentativeParty](https://quittio.dev/docs/api/Quittio/Core/Data/Party/TaxRepresentativeParty)` = `null` | |
| `$delivery` | `? [Delivery](https://quittio.dev/docs/api/Quittio/Core/Data/Delivery/Delivery)` = `null` | |
| `$invoicingPeriod` | `? [Period](https://quittio.dev/docs/api/Quittio/Core/Data/Delivery/Period)` = `null` | |
| `$paymentInstructions` | `? [PaymentInstructions](https://quittio.dev/docs/api/Quittio/Core/Data/Payment/PaymentInstructions)` = `null` | |
| `$allowances` | `list< [DocumentAllowance](https://quittio.dev/docs/api/Quittio/Core/Data/AllowanceCharge/DocumentAllowance)>` = `[]` | |
| `$charges` | `list< [DocumentCharge](https://quittio.dev/docs/api/Quittio/Core/Data/AllowanceCharge/DocumentCharge)>` = `[]` | |
| `$totals` | `? [Totals](https://quittio.dev/docs/api/Quittio/Core/Data/Totals/Totals)` = `null` | |
| `$vatBreakdown` | `list< [VatBreakdown](https://quittio.dev/docs/api/Quittio/Core/Data/Totals/VatBreakdown)>` = `[]` | |
| `$attachments` | `list< [Attachment](https://quittio.dev/docs/api/Quittio/Core/Data/Attachments/Attachment)>` = `[]` | |
| `$prepaidAmount` | `?Brick\Money\Money` = `null` | |
| `$roundingAmount` | `?Brick\Money\Money` = `null` | |
| `$extended` | `? [ExtendedData](https://quittio.dev/docs/api/Quittio/Core/Data/Extensions/ExtendedData)` = `null` | |
| `$xrechnungExtension` | `? [XRechnungExtensionData](https://quittio.dev/docs/api/Quittio/Core/Data/Extensions/XRechnungExtensionData)` = `null` | |
| `$presentation` | `? [Presentation](https://quittio.dev/docs/api/Quittio/Core/Data/Presentation/Presentation)` = `null` | |
| `$meta` | `[Meta](https://quittio.dev/docs/api/Quittio/Core/Data/Meta)` = `new \Quittio\Core\Data\Meta()` | |
| `$standardVersion` | `[StandardVersion](https://quittio.dev/docs/api/Quittio/Core/Standards/StandardVersion)` = `\Quittio\Core\Standards\StandardVersion::En16931_2017` | |

### `allLines()`#

```
public function allLines(): list<InvoiceLine>
```

All lines including sub lines, depth first.

<dl><dt>Returns</dt>
<dd><code>list&lt;<a href="https://quittio.dev/docs/api/Quittio/Core/Data/Lines/InvoiceLine">InvoiceLine</a>&gt;</code></dd>
</dl>

### `factory()`#

```
public static function factory(): InvoiceFactory
```

static

Deterministic test data, e.g. InvoiceData::factory()->reverseCharge()->withLines(5)->make().

<dl><dt>Returns</dt>
<dd><code><a href="https://quittio.dev/docs/api/Quittio/Core/Testing/InvoiceFactory">InvoiceFactory</a></code></dd>
</dl>

### `fromArray()`#

```
public static function fromArray(array<string, mixed> $data): self
```

static

| Parameter | Type | Description |
| --- | --- | --- |
| `$data` | `array<string, mixed>` | |

<dl><dt>Returns</dt>
<dd><code>self</code></dd>
</dl>

### `fromJson()`#

```
public static function fromJson(string $json): self
```

static

| Parameter | Type | Description |
| --- | --- | --- |
| `$json` | `string` | |

<dl><dt>Returns</dt>
<dd><code>self</code></dd>
</dl>

### `fromSnapshot()`#

```
public static function fromSnapshot(
    array<array-key, mixed> $snapshot,
    ?SnapshotUpcasterChain $chain = null,
): self
```

static

Restores a stored snapshot of any older version through the upcaster chain. Snapshots without "\_version" are treated as version 1.

| Parameter | Type | Description |
| --- | --- | --- |
| `$snapshot` | `array<array-key, mixed>` | |
| `$chain` | `? [SnapshotUpcasterChain](https://quittio.dev/docs/api/Quittio/Core/Serialization/Snapshots/SnapshotUpcasterChain)` = `null` | |

<dl><dt>Returns</dt>
<dd><code>self</code></dd>
</dl>

### `isCalculated()`#

```
public function isCalculated(): bool
```

<dl><dt>Returns</dt>
<dd><code>bool</code></dd>
</dl>

### `isCreditNote()`#

```
public function isCreditNote(): bool
```

<dl><dt>Returns</dt>
<dd><code>bool</code></dd>
</dl>

### `toArray()`#

```
public function toArray(): array<string, mixed>
```

<dl><dt>Returns</dt>
<dd><code>array&lt;string, mixed&gt;</code></dd>
</dl>

### `toJson()`#

```
public function toJson(int $flags = 0): string
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$flags` | `int` = `0` | |

<dl><dt>Returns</dt>
<dd><code>string</code></dd>
</dl>

### `toSnapshot()`#

```
public function toSnapshot(): array<string, mixed>
```

Serialised form for storage (Managed layer). Includes the snapshot version.

<dl><dt>Returns</dt>
<dd><code>array&lt;string, mixed&gt;</code></dd>
</dl>

### `typeCodeValue()`#

```
public function typeCodeValue(): string
```

<dl><dt>Returns</dt>
<dd><code>string</code></dd>
</dl>

### `with()`#

```
public function with(array<string, mixed> $changes): static
```

Returns a copy with the given properties replaced.

| Parameter | Type | Description |
| --- | --- | --- |
| `$changes` | `array<string, mixed>` | |

<dl><dt>Returns</dt>
<dd><code>static</code></dd>
</dl>

### `withImpliedExchangeRate()`#

```
public function withImpliedExchangeRate(): self
```

Copy with the exchange rate implied by the declared VAT totals (BT-111 / BT-110, ten decimals), e.g. for data read from XML, which carries no exchange rate. A recalculation then reproduces BT-111, also with changed or negated amounts. Data with an exchange rate, without a VAT accounting currency (BT-6) or without a declared non-zero BT-110 is returned unchanged.

<dl><dt>Returns</dt>
<dd><code>self</code></dd>
</dl>

### `withIssueDate()`#

```
public function withIssueDate(Date $issueDate): self
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$issueDate` | `[Date](https://quittio.dev/docs/api/Quittio/Core/Support/Date)` | |

<dl><dt>Returns</dt>
<dd><code>self</code></dd>
</dl>

### `withNumber()`#

```
public function withNumber(string $number): self
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$number` | `string` | |

<dl><dt>Returns</dt>
<dd><code>self</code></dd>
</dl>

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://quittio.dev/#website","@type":"WebSite","description":"E-Rechnungen für PHP und Laravel: ZUGFeRD, XRechnung und Peppol erstellen, prüfen, lesen und archivieren.","inLanguage":"de-DE","name":"Quittio","url":"https://quittio.dev/","publisher":{"@id":"https://quittio.dev/#identity"},"workTranslation":{"@id":"https://quittio.dev/en#website"}},{"@id":"https://quittio.dev/docs/api/Quittio/Core/Data/InvoiceData#webpage","@type":"WebPage","description":"Root of the semantic invoice model (EN 16931, superset of the 2017 and 2026 versions).","name":"InvoiceData – API-Referenz","url":"https://quittio.dev/docs/api/Quittio/Core/Data/InvoiceData","isPartOf":{"@id":"https://quittio.dev/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://quittio.dev/docs/api/Quittio/Core/Data/InvoiceData"]}],"primaryImageOfPage":{"@id":"https://quittio.dev/#logo"}},{"@id":"https://quittio.dev/#identity","@type":"Organization","description":"Open-Source-Bibliothek für E-Rechnungen in PHP und Laravel (ZUGFeRD, XRechnung, Peppol) und Quittio Managed.","email":"kontakt@niklasforst.de","legalName":"Niklas Forst – Softwareentwicklung","name":"Quittio","url":"https://quittio.dev","founder":{"@type":"Person","name":"Niklas Forst","url":"https://quittio.dev/ueber"},"logo":{"@id":"https://quittio.dev/#logo"},"sameAs":["https://github.com/Quittio/quittio","https://packagist.org/packages/quittio/quittio"]},{"@id":"https://quittio.dev/#logo","@type":"ImageObject","caption":"Quittio","contentUrl":"https://quittio.dev/logo.png","inLanguage":"de-DE","url":"https://quittio.dev/logo.png"}]}
```