---
title: "DocumentData – API-Referenz · Quittio"
description: "Quote, order confirmation, delivery note, proforma invoice, payment reminder, account statement or bonus statement. Shares parties, lines and calculation with {@see InvoiceData}, but never produces e-invoice XML. Payment reminders and account statements have no lines: their amount comes from {@see Dunning} and {@see AccountStatement}."
canonical_url: "https://quittio.dev/docs/api/Quittio/Core/Documents/DocumentData"
locale: de
meta:
  "og:description": "Quote, order confirmation, delivery note, proforma invoice, payment reminder, account statement or bonus statement. Shares parties, lines and calculation with {@see InvoiceData}, but never produces e-invoice XML. Payment reminders and account statements have no lines: their amount comes from {@see Dunning} and {@see AccountStatement}."
  "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": "DocumentData – 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) \\ [Documents](https://quittio.dev/docs/api/Quittio/Core/Documents)

# DocumentData

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

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

Quote, order confirmation, delivery note, proforma invoice, payment reminder, account statement or bonus statement. Shares parties, lines and calculation with {@see InvoiceData}, but never produces e-invoice XML. Payment reminders and account statements have no lines: their amount comes from {@see Dunning} and {@see AccountStatement}.

## Constants \#

| Constant | Value | Description |
| --- | --- | --- |
| `SNAPSHOT_VERSION` | `1` | Version of the format of toSnapshot(); a new version comes with an upcaster. |

## Properties \#

| Property | Type | Description |
| --- | --- | --- |
| `$allowances` readonly | `list< [DocumentAllowance](https://quittio.dev/docs/api/Quittio/Core/Data/AllowanceCharge/DocumentAllowance)>` | |
| `$bonus` readonly | `? [BonusStatement](https://quittio.dev/docs/api/Quittio/Core/Documents/BonusStatement)` | |
| `$buyer` readonly | `[BuyerParty](https://quittio.dev/docs/api/Quittio/Core/Data/Party/BuyerParty)` | |
| `$buyerReference` readonly | `?string` | |
| `$charges` readonly | `list< [DocumentCharge](https://quittio.dev/docs/api/Quittio/Core/Data/AllowanceCharge/DocumentCharge)>` | |
| `$currency` readonly | `string` | |
| `$delivery` readonly | `? [Delivery](https://quittio.dev/docs/api/Quittio/Core/Data/Delivery/Delivery)` | |
| `$dunning` readonly | `? [Dunning](https://quittio.dev/docs/api/Quittio/Core/Documents/Dunning)` | |
| `$issueDate` readonly | `[Date](https://quittio.dev/docs/api/Quittio/Core/Support/Date)` | |
| `$lineOptions` readonly | `array<string, [DocumentLineOptions](https://quittio.dev/docs/api/Quittio/Core/Documents/DocumentLineOptions)>` | keyed by line identifier |
| `$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` | |
| `$packages` readonly | `list< [Package](https://quittio.dev/docs/api/Quittio/Core/Documents/Package)>` | |
| `$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)` | |
| `$presentation` readonly | `? [Presentation](https://quittio.dev/docs/api/Quittio/Core/Data/Presentation/Presentation)` | |
| `$purchaseOrderReference` readonly | `?string` | |
| `$reference` readonly | `?string` | |
| `$referenceDate` readonly | `? [Date](https://quittio.dev/docs/api/Quittio/Core/Support/Date)` | |
| `$seller` readonly | `[SellerParty](https://quittio.dev/docs/api/Quittio/Core/Data/Party/SellerParty)` | |
| `$statement` readonly | `? [AccountStatement](https://quittio.dev/docs/api/Quittio/Core/Documents/AccountStatement)` | |
| `$totals` readonly | `? [Totals](https://quittio.dev/docs/api/Quittio/Core/Data/Totals/Totals)` | |
| `$type` readonly | `[DocumentType](https://quittio.dev/docs/api/Quittio/Core/Documents/DocumentType)` | |
| `$validUntil` readonly | `? [Date](https://quittio.dev/docs/api/Quittio/Core/Support/Date)` | |
| `$vatBreakdown` readonly | `list< [VatBreakdown](https://quittio.dev/docs/api/Quittio/Core/Data/Totals/VatBreakdown)>` | |

## Methods \#

| Method | Description |
| --- | --- |
| `->__construct()` | |
| `->billableLines()` | Lines that count towards the totals (without optional and alternative lines). |
| `::fromArray()` | The document from an array of toArray(). |
| `::fromJson()` | |
| `::fromSnapshot()` | Restores a stored snapshot of any older version through the upcaster chain (default: SnapshotUpcasterChain::documentDefault()). Snapshots without "\_version" are version 1. |
| `->isCalculated()` | |
| `->notices()` | Notices on the document; documents are not validated, so these are plausibility hints only. QUITTIO-DUNNING-FLAT-RATE-FEES (warning): a reminder to a business claims the flat rate for recovery costs and reminder fees of its own, which count towards the flat rate (Article 6 (3) Directive 2011/7/EU, section 288 (5) sentence 3 BGB). |
| `->options()` | |
| `->toArray()` | The document as plain array (scalars only); values equal to their default are left out. |
| `->toInvoiceDraft()` | The document as invoice data, e.g. for calculation or rendering. Never use it as an invoice. |
| `->toJson()` | The document as JSON of toArray(). |
| `->toSnapshot()` | The document for storage, with the version of the format ("\_version"), e.g. for a queued render job. Read it with fromSnapshot(). |
| `->with()` | Returns a copy with the given properties replaced. |

### `__construct()`#

```
public function __construct(
    DocumentType $type,
    string $number,
    Date $issueDate,
    string $currency,
    SellerParty $seller,
    BuyerParty $buyer,
    list<InvoiceLine> $lines = [],
    array<string, DocumentLineOptions> $lineOptions = [],
    list<DocumentAllowance> $allowances = [],
    list<DocumentCharge> $charges = [],
    list<Note> $notes = [],
    ?Date $validUntil = null,
    ?string $reference = null,
    ?Date $referenceDate = null,
    ?string $buyerReference = null,
    ?string $purchaseOrderReference = null,
    ?Delivery $delivery = null,
    list<Package> $packages = [],
    ?Dunning $dunning = null,
    ?AccountStatement $statement = null,
    ?PaymentTerms $paymentTerms = null,
    ?PaymentInstructions $paymentInstructions = null,
    ?Totals $totals = null,
    list<VatBreakdown> $vatBreakdown = [],
    ?Presentation $presentation = null,
    Meta $meta = new \Quittio\Core\Data\Meta(),
    ?BonusStatement $bonus = null,
)
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$type` | `[DocumentType](https://quittio.dev/docs/api/Quittio/Core/Documents/DocumentType)` | |
| `$number` | `string` | |
| `$issueDate` | `[Date](https://quittio.dev/docs/api/Quittio/Core/Support/Date)` | |
| `$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)>` = `[]` | |
| `$lineOptions` | `array<string, [DocumentLineOptions](https://quittio.dev/docs/api/Quittio/Core/Documents/DocumentLineOptions)>` = `[]` | keyed by line identifier |
| `$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)>` = `[]` | |
| `$notes` | `list< [Note](https://quittio.dev/docs/api/Quittio/Core/Data/Note)>` = `[]` | |
| `$validUntil` | `? [Date](https://quittio.dev/docs/api/Quittio/Core/Support/Date)` = `null` | |
| `$reference` | `?string` = `null` | |
| `$referenceDate` | `? [Date](https://quittio.dev/docs/api/Quittio/Core/Support/Date)` = `null` | |
| `$buyerReference` | `?string` = `null` | |
| `$purchaseOrderReference` | `?string` = `null` | |
| `$delivery` | `? [Delivery](https://quittio.dev/docs/api/Quittio/Core/Data/Delivery/Delivery)` = `null` | |
| `$packages` | `list< [Package](https://quittio.dev/docs/api/Quittio/Core/Documents/Package)>` = `[]` | |
| `$dunning` | `? [Dunning](https://quittio.dev/docs/api/Quittio/Core/Documents/Dunning)` = `null` | |
| `$statement` | `? [AccountStatement](https://quittio.dev/docs/api/Quittio/Core/Documents/AccountStatement)` = `null` | |
| `$paymentTerms` | `? [PaymentTerms](https://quittio.dev/docs/api/Quittio/Core/Data/Payment/PaymentTerms)` = `null` | |
| `$paymentInstructions` | `? [PaymentInstructions](https://quittio.dev/docs/api/Quittio/Core/Data/Payment/PaymentInstructions)` = `null` | |
| `$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)>` = `[]` | |
| `$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()` | |
| `$bonus` | `? [BonusStatement](https://quittio.dev/docs/api/Quittio/Core/Documents/BonusStatement)` = `null` | |

### `billableLines()`#

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

Lines that count towards the totals (without optional and alternative lines).

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

### `fromArray()`#

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

static

The document from an array of toArray().

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

<dl><dt>Returns</dt>
<dd><code>self</code></dd>
<dt>Throws</dt>
<dd><code><a href="https://quittio.dev/docs/api/Quittio/Core/Exceptions/HydrationException">HydrationException</a></code> – for missing, unknown or invalid values</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>
<dt>Throws</dt>
<dd><code><a href="https://quittio.dev/docs/api/Quittio/Core/Exceptions/HydrationException">HydrationException</a></code> – for invalid JSON or invalid values</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 (default: SnapshotUpcasterChain::documentDefault()). Snapshots without "\_version" are 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>
<dt>Throws</dt>
<dd><code><a href="https://quittio.dev/docs/api/Quittio/Core/Serialization/Snapshots/SnapshotVersionException">SnapshotVersionException</a></code> – for a version that this installation cannot read</dd>
<dt>Throws</dt>
<dd><code><a href="https://quittio.dev/docs/api/Quittio/Core/Exceptions/HydrationException">HydrationException</a></code> – for missing, unknown or invalid values</dd></dl>

### `isCalculated()`#

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

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

### `notices()`#

```
public function notices(string $locale = 'en'): list<ValidationMessage>
```

Notices on the document; documents are not validated, so these are plausibility hints only. QUITTIO-DUNNING-FLAT-RATE-FEES (warning): a reminder to a business claims the flat rate for recovery costs and reminder fees of its own, which count towards the flat rate (Article 6 (3) Directive 2011/7/EU, section 288 (5) sentence 3 BGB).

| Parameter | Type | Description |
| --- | --- | --- |
| `$locale` | `string` = `'en'` | |

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

### `options()`#

```
public function options(string $lineId): DocumentLineOptions
```

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

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

### `toArray()`#

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

The document as plain array (scalars only); values equal to their default are left out.

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

### `toInvoiceDraft()`#

```
public function toInvoiceDraft(bool $billableOnly = true): InvoiceData
```

The document as invoice data, e.g. for calculation or rendering. Never use it as an invoice.

| Parameter | Type | Description |
| --- | --- | --- |
| `$billableOnly` | `bool` = `true` | |

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

### `toJson()`#

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

The document as JSON of toArray().

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

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

### `toSnapshot()`#

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

The document for storage, with the version of the format ("\_version"), e.g. for a queued render job. Read it with fromSnapshot().

<dl><dt>Returns</dt>
<dd><code>array&lt;string, mixed&gt;</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>

```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/Documents/DocumentData#webpage","@type":"WebPage","description":"Quote, order confirmation, delivery note, proforma invoice, payment reminder, account statement or bonus statement. Shares parties, lines and calculation with {@see InvoiceData}, but never produces e-invoice XML. Payment reminders and account statements have no lines: their amount comes from {@see Dunning} and {@see AccountStatement}.","name":"DocumentData – API-Referenz","url":"https://quittio.dev/docs/api/Quittio/Core/Documents/DocumentData","isPartOf":{"@id":"https://quittio.dev/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://quittio.dev/docs/api/Quittio/Core/Documents/DocumentData"]}],"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"}]}
```