---
title: "DefaultFormatResolver – API-Referenz · Quittio"
description: "Format resolution in this order:"
canonical_url: "https://quittio.dev/docs/api/Quittio/Core/Formats/DefaultFormatResolver"
locale: de
meta:
  "og:description": "Format resolution in this order:"
  "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": "DefaultFormatResolver – 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) \\ [Formats](https://quittio.dev/docs/api/Quittio/Core/Formats)

# DefaultFormatResolver

final class in quittio/core · implements [`FormatResolver`](https://quittio.dev/docs/api/Quittio/Core/Formats/FormatResolver)

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

Format resolution in this order:

1. explicit choice (handled by the caller),
2. known Peppol participant of the buyer (optional lookup),
3. domestic invoice: rules of the seller's country pack,
4. cross-border to a business: rules of the buyer's country pack (also for sellers outside the EU, e.g. XRechnung for German public buyers), otherwise ZUGFeRD EN 16931 within the EU VAT territory,
5. outside the EU VAT territory or to consumers: PDF,
6. EXTENDED features used: profile EXTENDED (or an error without auto upgrade).

"Domestic" and "EU" refer to the VAT territory (see VatTerritory): Monaco counts as France, Northern Ireland as part of the EU, Büsingen and Heligoland are outside of it.

## Constants \#

| Constant | Value | Description |
| --- | --- | --- |
| `EU_COUNTRIES` | `\Quittio\Core\Countries\VatTerritory::EU_MEMBER_STATES` | |

## Methods \#

| Method | Description |
| --- | --- |
| `->__construct()` | |
| `->resolve()` | |

### `__construct()`#

```
public function __construct(
    string $defaultProfile = 'en16931',
    bool $autoUpgradeProfile = true,
    (Closure(BuyerParty): bool)|null $peppolLookup = null,
)
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$defaultProfile` | `string` = `'en16931'` | |
| `$autoUpgradeProfile` | `bool` = `true` | |
| `$peppolLookup` | `(Closure([BuyerParty](https://quittio.dev/docs/api/Quittio/Core/Data/Party/BuyerParty)): bool)\|null` = `null` | returns true if the buyer is reachable via Peppol |

### `resolve()`#

```
public function resolve(InvoiceData $invoice, ResolvedCountries $countries): FormatChoice
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$invoice` | `[InvoiceData](https://quittio.dev/docs/api/Quittio/Core/Data/InvoiceData)` | |
| `$countries` | `[ResolvedCountries](https://quittio.dev/docs/api/Quittio/Core/Countries/ResolvedCountries)` | |

<dl><dt>Returns</dt>
<dd><code><a href="https://quittio.dev/docs/api/Quittio/Core/Formats/FormatChoice">FormatChoice</a></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/Formats/DefaultFormatResolver#webpage","@type":"WebPage","description":"Format resolution in this order:","name":"DefaultFormatResolver – API-Referenz","url":"https://quittio.dev/docs/api/Quittio/Core/Formats/DefaultFormatResolver","isPartOf":{"@id":"https://quittio.dev/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://quittio.dev/docs/api/Quittio/Core/Formats/DefaultFormatResolver"]}],"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"}]}
```