---
title: "DefaultFormatResolver – API reference · Quittio"
description: "Format resolution in this order:"
canonical_url: "https://quittio.dev/en/docs/api/Quittio/Core/Formats/DefaultFormatResolver"
locale: en
meta:
  "og:description": "Format resolution in this order:"
  "og:image": "https://quittio.dev/og/quittio-en.jpg"
  "og:image:alt": "Quittio: Invoices, settled. E-invoicing for PHP and Laravel, with a validated sample invoice."
  "og:image:height": "630"
  "og:image:type": image/jpeg
  "og:image:width": "1200"
  "og:title": "DefaultFormatResolver – API reference · Quittio"
  "twitter:image": "https://quittio.dev/og/quittio-en.jpg"
  "twitter:image:alt": "Quittio: Invoices, settled. E-invoicing for PHP and Laravel, with a validated sample invoice."
---

> 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/en#website","@type":"WebSite","description":"E-invoicing for PHP and Laravel: create, validate, read and archive ZUGFeRD, XRechnung and Peppol invoices.","inLanguage":"en","name":"Quittio","url":"https://quittio.dev/en","publisher":{"@id":"https://quittio.dev/#identity"},"translationOfWork":{"@id":"https://quittio.dev/#website"}},{"@id":"https://quittio.dev/en/docs/api/Quittio/Core/Formats/DefaultFormatResolver#webpage","@type":"WebPage","description":"Format resolution in this order:","name":"DefaultFormatResolver – API reference","url":"https://quittio.dev/en/docs/api/Quittio/Core/Formats/DefaultFormatResolver","isPartOf":{"@id":"https://quittio.dev/en#website"},"potentialAction":[{"@type":"ReadAction","target":["https://quittio.dev/en/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":"en","url":"https://quittio.dev/logo.png"}]}
```