---
title: "PartyBuilder – API-Referenz · Quittio"
description: "Fluent builder for the seller (BG-4), the buyer (BG-7) and the payee (BG-10)."
canonical_url: "https://quittio.dev/docs/api/Quittio/Core/Builder/PartyBuilder"
locale: de
meta:
  "og:description": "Fluent builder for the seller (BG-4), the buyer (BG-7) and the payee (BG-10)."
  "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": "PartyBuilder – 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) \\ [Builder](https://quittio.dev/docs/api/Quittio/Core/Builder)

# PartyBuilder

final class in quittio/core

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

Fluent builder for the seller (BG-4), the buyer (BG-7) and the payee (BG-10).

## Methods \#

| Method | Description |
| --- | --- |
| `->additionalLegalInfo()` | The seller's additional legal information (BT-33), e.g. legal form and share capital; ignored for the buyer. |
| `->address()` | Postal address (seller BG-5, buyer BG-8); the country code (ISO 3166-1 alpha-2) is uppercased. Required for seller and buyer. |
| `->buildBuyer()` | The buyer party (BG-7). |
| `->buildPayee()` | Payee (BG-10): name, the first identifier (BT-60) and the legal registration (BT-61); the other values of the builder do not belong to the payee. |
| `->buildSeller()` | The seller party (BG-4). |
| `->consumer()` | Marks the buyer as a consumer (B2C): gross prices, no e-invoice obligation. |
| `->contact()` | Contact (seller BG-6, buyer BG-9): name, phone and e-mail. XRechnung requires all three for the seller. |
| `->countryCode()` | Country code of the postal address set so far (BT-40, BT-55), e.g. for defaults that depend on the seller's country. |
| `->electronicAddress()` | Electronic address (seller BT-34, buyer BT-49) with its EAS scheme; default e-mail (EM). Required by XRechnung and Peppol. |
| `::fromBuyer()` | A builder with the values of an existing buyer. |
| `->fromModel()` | Lets an application model fill this builder (ProvidesParty). |
| `::fromPayee()` | A builder with the values of an existing payee. |
| `::fromSeller()` | A builder with the values of an existing seller, e.g. to change one of them. |
| `->identifier()` | Adds an identifier (BT-29 seller, BT-46 buyer, BT-60 payee), e.g. a GLN or the customer number. Buyer and payee take the first one. |
| `->legalRegistration()` | Legal registration identifier, e.g. the commercial register number (seller BT-30, buyer BT-47, payee BT-61), with its scheme. |
| `->name()` | Legal name: seller BT-27, buyer BT-44, payee BT-59. Required. |
| `->postalAddress()` | Postal address as object, see address(). |
| `->taxNumber()` | The seller's tax registration number (BT-32), e.g. the German Steuernummer; ignored for the buyer. |
| `->tradingName()` | Trading name: seller BT-28, buyer BT-45; null removes it. |
| `->vatId()` | VAT identifier with country prefix, e.g. "DE123456789" (seller BT-31, buyer BT-48); uppercased, spaces removed; null removes it. A Swiss UID number keeps one space before the note of its VAT registration ("CHE-123.456.789 MWST", also TVA and IVA). |

### `additionalLegalInfo()`#

```
public function additionalLegalInfo(?string $info): self
```

The seller's additional legal information (BT-33), e.g. legal form and share capital; ignored for the buyer.

| Parameter | Type | Description |
| --- | --- | --- |
| `$info` | `?string` | |

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

### `address()`#

```
public function address(
    ?string $line1,
    ?string $postcode,
    ?string $city,
    string $countryCode,
    ?string $line2 = null,
    ?string $line3 = null,
    ?string $subdivision = null,
): self
```

Postal address (seller BG-5, buyer BG-8); the country code (ISO 3166-1 alpha-2) is uppercased. Required for seller and buyer.

| Parameter | Type | Description |
| --- | --- | --- |
| `$line1` | `?string` | |
| `$postcode` | `?string` | |
| `$city` | `?string` | |
| `$countryCode` | `string` | |
| `$line2` | `?string` = `null` | |
| `$line3` | `?string` = `null` | |
| `$subdivision` | `?string` = `null` | |

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

### `buildBuyer()`#

```
public function buildBuyer(): BuyerParty
```

The buyer party (BG-7).

<dl><dt>Returns</dt>
<dd><code><a href="https://quittio.dev/docs/api/Quittio/Core/Data/Party/BuyerParty">BuyerParty</a></code></dd>
<dt>Throws</dt>
<dd><code><a href="https://quittio.dev/docs/api/Quittio/Core/Exceptions/InvalidInvoiceData">InvalidInvoiceData</a></code> – when the name (BT-44) or the postal address (BG-8) is missing</dd></dl>

### `buildPayee()`#

```
public function buildPayee(): PayeeParty
```

Payee (BG-10): name, the first identifier (BT-60) and the legal registration (BT-61); the other values of the builder do not belong to the payee.

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

### `buildSeller()`#

```
public function buildSeller(): SellerParty
```

The seller party (BG-4).

<dl><dt>Returns</dt>
<dd><code><a href="https://quittio.dev/docs/api/Quittio/Core/Data/Party/SellerParty">SellerParty</a></code></dd>
<dt>Throws</dt>
<dd><code><a href="https://quittio.dev/docs/api/Quittio/Core/Exceptions/InvalidInvoiceData">InvalidInvoiceData</a></code> – when the name (BT-27) or the postal address (BG-5) is missing</dd></dl>

### `consumer()`#

```
public function consumer(bool $consumer = true): self
```

Marks the buyer as a consumer (B2C): gross prices, no e-invoice obligation.

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

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

### `contact()`#

```
public function contact(
    ?string $name = null,
    ?string $phone = null,
    ?string $email = null,
): self
```

Contact (seller BG-6, buyer BG-9): name, phone and e-mail. XRechnung requires all three for the seller.

| Parameter | Type | Description |
| --- | --- | --- |
| `$name` | `?string` = `null` | |
| `$phone` | `?string` = `null` | |
| `$email` | `?string` = `null` | |

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

### `countryCode()`#

```
public function countryCode(): ?string
```

Country code of the postal address set so far (BT-40, BT-55), e.g. for defaults that depend on the seller's country.

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

### `electronicAddress()`#

```
public function electronicAddress(
    string $value,
    ElectronicAddressScheme|RawCode|string $scheme = \Quittio\Core\Enums\ElectronicAddressScheme::Email,
): self
```

Electronic address (seller BT-34, buyer BT-49) with its EAS scheme; default e-mail (EM). Required by XRechnung and Peppol.

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `string` | |
| `$scheme` | `[ElectronicAddressScheme](https://quittio.dev/docs/api/Quittio/Core/Enums/ElectronicAddressScheme)\| [RawCode](https://quittio.dev/docs/api/Quittio/Core/Codes/RawCode)\|string` = `\Quittio\Core\Enums\ElectronicAddressScheme::Email` | |

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

### `fromBuyer()`#

```
public static function fromBuyer(BuyerParty $buyer): self
```

static

A builder with the values of an existing buyer.

| Parameter | Type | Description |
| --- | --- | --- |
| `$buyer` | `[BuyerParty](https://quittio.dev/docs/api/Quittio/Core/Data/Party/BuyerParty)` | |

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

### `fromModel()`#

```
public function fromModel(ProvidesParty $model): self
```

Lets an application model fill this builder (ProvidesParty).

| Parameter | Type | Description |
| --- | --- | --- |
| `$model` | `[ProvidesParty](https://quittio.dev/docs/api/Quittio/Core/Contracts/ProvidesParty)` | |

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

### `fromPayee()`#

```
public static function fromPayee(PayeeParty $payee): self
```

static

A builder with the values of an existing payee.

| Parameter | Type | Description |
| --- | --- | --- |
| `$payee` | `[PayeeParty](https://quittio.dev/docs/api/Quittio/Core/Data/Party/PayeeParty)` | |

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

### `fromSeller()`#

```
public static function fromSeller(SellerParty $seller): self
```

static

A builder with the values of an existing seller, e.g. to change one of them.

| Parameter | Type | Description |
| --- | --- | --- |
| `$seller` | `[SellerParty](https://quittio.dev/docs/api/Quittio/Core/Data/Party/SellerParty)` | |

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

### `identifier()`#

```
public function identifier(
    string $value,
    IdentifierScheme|RawCode|string|null $scheme = null,
): self
```

Adds an identifier (BT-29 seller, BT-46 buyer, BT-60 payee), e.g. a GLN or the customer number. Buyer and payee take the first one.

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `string` | |
| `$scheme` | `[IdentifierScheme](https://quittio.dev/docs/api/Quittio/Core/Enums/IdentifierScheme)\| [RawCode](https://quittio.dev/docs/api/Quittio/Core/Codes/RawCode)\|string\|null` = `null` | |

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

### `legalRegistration()`#

```
public function legalRegistration(
    ?string $value,
    IdentifierScheme|RawCode|string|null $scheme = null,
): self
```

Legal registration identifier, e.g. the commercial register number (seller BT-30, buyer BT-47, payee BT-61), with its scheme.

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | `?string` | |
| `$scheme` | `[IdentifierScheme](https://quittio.dev/docs/api/Quittio/Core/Enums/IdentifierScheme)\| [RawCode](https://quittio.dev/docs/api/Quittio/Core/Codes/RawCode)\|string\|null` = `null` | |

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

### `name()`#

```
public function name(string $name): self
```

Legal name: seller BT-27, buyer BT-44, payee BT-59. Required.

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

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

### `postalAddress()`#

```
public function postalAddress(Address $address): self
```

Postal address as object, see address().

| Parameter | Type | Description |
| --- | --- | --- |
| `$address` | `[Address](https://quittio.dev/docs/api/Quittio/Core/Data/Party/Address)` | |

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

### `taxNumber()`#

```
public function taxNumber(?string $taxNumber): self
```

The seller's tax registration number (BT-32), e.g. the German Steuernummer; ignored for the buyer.

| Parameter | Type | Description |
| --- | --- | --- |
| `$taxNumber` | `?string` | |

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

### `tradingName()`#

```
public function tradingName(?string $tradingName): self
```

Trading name: seller BT-28, buyer BT-45; null removes it.

| Parameter | Type | Description |
| --- | --- | --- |
| `$tradingName` | `?string` | |

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

### `vatId()`#

```
public function vatId(?string $vatId): self
```

VAT identifier with country prefix, e.g. "DE123456789" (seller BT-31, buyer BT-48); uppercased, spaces removed; null removes it. A Swiss UID number keeps one space before the note of its VAT registration ("CHE-123.456.789 MWST", also TVA and IVA).

| Parameter | Type | Description |
| --- | --- | --- |
| `$vatId` | `?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/Builder/PartyBuilder#webpage","@type":"WebPage","description":"Fluent builder for the seller (BG-4), the buyer (BG-7) and the payee (BG-10).","name":"PartyBuilder – API-Referenz","url":"https://quittio.dev/docs/api/Quittio/Core/Builder/PartyBuilder","isPartOf":{"@id":"https://quittio.dev/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://quittio.dev/docs/api/Quittio/Core/Builder/PartyBuilder"]}],"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"}]}
```