{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/attestwire-com/json-schema/attestwire-com-parse-result-schema.json",
  "title": "ParseResult",
  "description": "The body of POST /v1/parse: a document read into the model, and nothing judged. There is no `valid` field here and that is deliberate — a response that carried one would be answering a question no rule was asked.",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/attestwire-com-openapi.json#/components/schemas/ParseResult",
  "type": "object",
  "required": [
    "syntax",
    "container",
    "customizationId",
    "profileId",
    "invoice",
    "unmapped",
    "source"
  ],
  "properties": {
    "syntax": {
      "type": "string",
      "enum": [
        "ubl",
        "cii"
      ],
      "description": "Which reader ran, decided from the root element of the document you sent."
    },
    "container": {
      "type": [
        "string",
        "null"
      ],
      "description": "When a Factur-X or ZUGFeRD PDF was sent: the name of the attachment the XML was read from. `null` for an XML file."
    },
    "customizationId": {
      "type": [
        "string",
        "null"
      ],
      "description": "BT-24, exactly as the document states it — not as we would have written it. `invoice.profile` is derived from this. `null` when the document states none."
    },
    "profileId": {
      "type": [
        "string",
        "null"
      ],
      "description": "BT-23, exactly as the document states it. `null` when it states none."
    },
    "invoice": {
      "allOf": [
        {
          "$ref": "#/$defs/InvoiceInput"
        }
      ],
      "description": "The model. THE SAME `InvoiceInput` POST /v1/validate and POST /v1/generate accept — post it straight back to either one. Document totals the file stated unreadably are recorded inside it, at `declaredTotals.defects`."
    },
    "unmapped": {
      "type": "array",
      "description": "The parse-level findings: everything in the document that did not reach the model. SILENT DATA LOSS ON A TAX DOCUMENT IS THE WORST POSSIBLE FAILURE, so this is reported rather than swallowed. `[]` when the whole document was understood.",
      "items": {
        "$ref": "#/$defs/UnmappedElement"
      }
    },
    "unmapped_truncated": {
      "$ref": "#/$defs/UnmappedTruncated"
    },
    "source": {
      "type": "string",
      "description": "One sentence saying that the document was converted and NOT judged, and where to send it for the verdict — and, for a PDF, which attachment was read."
    },
    "provenance": {
      "$ref": "#/$defs/Provenance"
    }
  },
  "$defs": {
    "Contact": {
      "type": "object",
      "description": "BG-6 seller contact or BG-9 buyer contact.",
      "properties": {
        "name": {
          "type": "string",
          "description": "BT-41 / BT-56 contact point: a person or a department.",
          "x-business-term": "BT-41 / BT-56"
        },
        "email": {
          "type": "string",
          "description": "BT-43 / BT-58 contact email address.",
          "x-business-term": "BT-43 / BT-58"
        },
        "phone": {
          "type": "string",
          "description": "BT-42 / BT-57 contact telephone number.",
          "x-business-term": "BT-42 / BT-57"
        }
      }
    },
    "DeclaredTaxSubtotal": {
      "type": "object",
      "description": "One BG-23 VAT breakdown group exactly as the document states it. Set by the readers.",
      "properties": {
        "category": {
          "type": "string",
          "enum": [
            "S",
            "Z",
            "E",
            "AE",
            "K",
            "G",
            "O",
            "L",
            "M"
          ],
          "description": "BT-118 VAT category code, as written.",
          "x-business-term": "BT-118"
        },
        "rate": {
          "type": "number",
          "description": "BT-119 VAT category rate, as written.",
          "x-business-term": "BT-119"
        },
        "taxableAmount": {
          "type": "number",
          "description": "BT-116 VAT category taxable amount, as written.",
          "x-business-term": "BT-116"
        },
        "taxAmount": {
          "type": "number",
          "description": "BT-117 VAT category tax amount, as written.",
          "x-business-term": "BT-117"
        }
      }
    },
    "DeclaredTotalDefect": {
      "type": "object",
      "description": "One document total the document failed to state readably. Set by the readers.",
      "required": [
        "key",
        "field",
        "state",
        "xpath"
      ],
      "properties": {
        "key": {
          "type": "string",
          "enum": [
            "lineExtensionAmount",
            "allowanceTotalAmount",
            "chargeTotalAmount",
            "taxExclusiveAmount",
            "taxAmount",
            "taxInclusiveAmount",
            "payableAmount",
            "taxAmountInAccountingCurrency"
          ],
          "description": "Which total it is, as a key of DeclaredTotals. `taxAmountInAccountingCurrency` names BT-111, which the model carries on the invoice itself."
        },
        "field": {
          "type": "string",
          "description": "The business term, such as BT-115."
        },
        "state": {
          "type": "string",
          "enum": [
            "absent",
            "empty",
            "unreadable"
          ],
          "description": "Why it could not be read: `absent` fails a BR presence rule, while `empty` and `unreadable` fail XML Schema validation at the official validator before any business rule, and this API reports them as ATW-DECLARED-TOTAL-NOT-A-NUMBER."
        },
        "text": {
          "type": "string",
          "description": "What the element held, verbatim, cut at 200 characters. Only for `unreadable`."
        },
        "xpath": {
          "type": "string",
          "description": "Where the value is in the document, or where it should have been."
        }
      }
    },
    "DeclaredTotals": {
      "type": "object",
      "description": "Totals as someone else computed them, checked against the computed ones under BR-CO-10/11/12/13/14/15/16. Generation always writes the computed values: these exist so you can catch a mismatch in your own accounting system before a tax authority does, and omitting one is never an error. The readers (POST /v1/parse, and POST /v1/validate with a document) also record here what a document states, including the fields described as set by the readers, which a caller building the model leaves out. On that path a document must state its totals: one that omits BT-106, BT-109, BT-112 or BT-115 fails BR-12, BR-13, BR-14 or BR-15, and one that states a total that cannot be read as a number fails ATW-DECLARED-TOTAL-NOT-A-NUMBER.",
      "properties": {
        "syntax": {
          "type": "string",
          "enum": [
            "ubl",
            "cii"
          ],
          "description": "Set by the readers: the syntax the document was read from. It decides how BR-S-08 and its per-category siblings compare the stated taxable amount: exactly in CII, within ±1 in UBL."
        },
        "taxTotalsInInvoiceCurrency": {
          "type": "number",
          "description": "Set by the readers: how many VAT totals carry the invoice currency (BT-5). BR-CO-15 requires exactly one."
        },
        "specificationIdentifier": {
          "type": "string",
          "description": "BT-24 specification identifier as the document states it, trimmed; empty when absent. Set by the readers, so BR-01 can be judged.",
          "x-business-term": "BT-24"
        },
        "lineNetAmounts": {
          "type": "array",
          "items": {
            "type": [
              "number",
              "null"
            ]
          },
          "description": "BT-131 invoice line net amounts as each line states them, in document order; null where a line states none. Set by the readers.",
          "x-business-term": "BT-131"
        },
        "subtotals": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/DeclaredTaxSubtotal"
          },
          "description": "BG-23 VAT breakdown as the document states it, in document order. Set by the readers.",
          "x-business-term": "BG-23"
        },
        "lineExtensionAmount": {
          "type": "number",
          "description": "BT-106 sum of invoice line net amounts.",
          "x-business-term": "BT-106"
        },
        "allowanceTotalAmount": {
          "type": "number",
          "description": "BT-107 sum of allowances on document level.",
          "x-business-term": "BT-107"
        },
        "chargeTotalAmount": {
          "type": "number",
          "description": "BT-108 sum of charges on document level.",
          "x-business-term": "BT-108"
        },
        "taxExclusiveAmount": {
          "type": "number",
          "description": "BT-109 invoice total amount without VAT.",
          "x-business-term": "BT-109"
        },
        "taxAmount": {
          "type": "number",
          "description": "BT-110 invoice total VAT amount.",
          "x-business-term": "BT-110"
        },
        "taxInclusiveAmount": {
          "type": "number",
          "description": "BT-112 invoice total amount with VAT.",
          "x-business-term": "BT-112"
        },
        "payableAmount": {
          "type": "number",
          "description": "BT-115 amount due for payment.",
          "x-business-term": "BT-115"
        },
        "defects": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/DeclaredTotalDefect"
          },
          "description": "Set by the readers: document totals the document was supposed to state and did not state readably, one entry per term. On the JSON model an omitted total means \"compute it\" and is never a defect."
        },
        "overPrecise": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/OverPreciseAmount"
          },
          "description": "Set by the readers: amounts the document wrote with more than two decimal places, in document order, which the BR-DEC rules report."
        }
      }
    },
    "DeliverToAddress": {
      "type": "object",
      "description": "BG-15 deliver-to address. Only the country code is required by the model; XRechnung also requires the city and post code once the group is present.",
      "required": [
        "countryCode"
      ],
      "properties": {
        "line1": {
          "type": "string",
          "description": "BT-75 deliver-to address line 1.",
          "x-business-term": "BT-75"
        },
        "line2": {
          "type": "string",
          "description": "BT-76 deliver-to address line 2.",
          "x-business-term": "BT-76"
        },
        "city": {
          "type": "string",
          "description": "BT-77 deliver-to city. Mandatory under XRechnung once BG-15 is present.",
          "x-business-term": "BT-77"
        },
        "postalCode": {
          "type": "string",
          "description": "BT-78 deliver-to post code. Mandatory under XRechnung once BG-15 is present.",
          "x-business-term": "BT-78"
        },
        "countrySubdivision": {
          "type": "string",
          "description": "BT-79 deliver-to country subdivision.",
          "x-business-term": "BT-79"
        },
        "countryCode": {
          "type": "string",
          "description": "BT-80 deliver-to country code, ISO 3166-1 alpha-2.",
          "x-business-term": "BT-80"
        }
      }
    },
    "DirectDebit": {
      "type": "object",
      "description": "BG-19 direct debit information.",
      "properties": {
        "mandateReference": {
          "type": "string",
          "description": "BT-89 mandate reference identifier.",
          "x-business-term": "BT-89"
        },
        "creditorIdentifier": {
          "type": "string",
          "description": "BT-90 bank assigned creditor identifier: the SEPA creditor identifier. Written as the seller's identifier with scheme \"SEPA\", where BR-DE-30 looks for it.",
          "x-business-term": "BT-90"
        },
        "debitedAccount": {
          "type": "string",
          "description": "BT-91 debited account identifier: the payer's IBAN. Required by BR-DE-31.",
          "x-business-term": "BT-91"
        }
      }
    },
    "DocumentAllowanceCharge": {
      "type": "object",
      "description": "BG-20 document level allowance or BG-21 document level charge; the first term of each pair is the allowance's. Which array it is in decides which it is, and the reason code lists differ, so an allowance reason code in `charges` fails BR-CL-20.",
      "required": [
        "amount",
        "vatCategory"
      ],
      "properties": {
        "amount": {
          "type": "number",
          "description": "BT-92 / BT-99 amount, always positive.",
          "x-business-term": "BT-92 / BT-99"
        },
        "baseAmount": {
          "type": "number",
          "description": "BT-93 / BT-100 base amount.",
          "x-business-term": "BT-93 / BT-100"
        },
        "percentage": {
          "type": "number",
          "description": "BT-94 / BT-101 percentage.",
          "x-business-term": "BT-94 / BT-101"
        },
        "vatCategory": {
          "type": "string",
          "enum": [
            "S",
            "Z",
            "E",
            "AE",
            "K",
            "G",
            "O",
            "L",
            "M"
          ],
          "description": "BT-95 / BT-102 VAT category code, UNCL 5305: S standard rate, Z zero rated, E exempt, AE reverse charge, K intra-community supply, G export outside the EU, O not subject to VAT, L IGIC (Canary Islands), M IPSI (Ceuta and Melilla). Left out, it comes from the entry's `vatScenario` or the invoice's.",
          "x-business-term": "BT-95 / BT-102"
        },
        "vatRate": {
          "type": "number",
          "description": "BT-96 / BT-103 VAT rate, in percent.",
          "x-business-term": "BT-96 / BT-103"
        },
        "vatScenario": {
          "type": "string",
          "enum": [
            "domestic",
            "intra-eu-goods",
            "intra-eu-services",
            "export",
            "small-business-exemption"
          ],
          "description": "What happened, instead of the VAT code of this allowance or charge: the engine writes `vatCategory`, the rate (except for \"domestic\", whose rate you give in `vatRate`) and the exemption reason from it. It overrides the invoice's `vatScenario`. A `vatCategory` stated beside it must be the one it stands for: disagreeing is the fatal ATW-VAT-SCENARIO-CONFLICT. With a scenario, `vatCategory` may be left out of the request although this schema lists it as required (the schema describes the explicit model, which POST /v1/parse returns); the response reports each code it filled in as ATW-VAT-SCENARIO-APPLIED, at severity information. \"domestic\": a taxed sale inside the seller's own country — category S at the rate you state in `vatRate`, which is never guessed. \"intra-eu-goods\": goods shipped to a VAT-registered business in another EU member state — K, rate 0, VATEX-EU-IC; the invoice also needs both parties' VAT identifiers, `deliverTo.countryCode` and a delivery date or invoicing period. \"intra-eu-services\": a service to a business in another EU member state, which accounts for the VAT itself (reverse charge) — AE, rate 0, VATEX-EU-AE; needs both VAT identifiers. \"export\": goods leaving the EU — G, rate 0, VATEX-EU-G; needs the seller's VAT identifier. \"small-business-exemption\": the seller does not charge VAT under its small-business scheme, Germany's § 19 UStG or France's franchise en base — E, rate 0, with the wording each country prescribes; a seller elsewhere is refused with ATW-VAT-SCENARIO-UNSUPPORTED. The exemption text is written in German for a seller in DE or AT, in French for FR, in English otherwise. It is not a tax determination: you decide which scenario applies, and the engine only writes its codes."
        },
        "reason": {
          "type": "string",
          "description": "BT-97 / BT-104 reason, free text.",
          "x-business-term": "BT-97 / BT-104"
        },
        "reasonCode": {
          "type": "string",
          "description": "BT-98 / BT-105 reason code: UNCL 5189 for an allowance, UNCL 7161 for a charge.",
          "x-business-term": "BT-98 / BT-105"
        }
      }
    },
    "ElectronicAddress": {
      "type": "object",
      "description": "BT-34 seller or BT-49 buyer electronic address: where the network delivers the document. Both halves are required.",
      "required": [
        "schemeId",
        "value"
      ],
      "properties": {
        "schemeId": {
          "type": "string",
          "description": "BT-34-1 / BT-49-1 scheme identifier, from the Peppol EAS code list.",
          "x-business-term": "BT-34-1 / BT-49-1"
        },
        "value": {
          "type": "string",
          "description": "BT-34 / BT-49 the address itself.",
          "x-business-term": "BT-34 / BT-49"
        }
      }
    },
    "EmbeddedAttachment": {
      "type": "object",
      "description": "BT-125 attached document, embedded in the invoice.",
      "required": [
        "filename",
        "mimeCode",
        "content"
      ],
      "properties": {
        "filename": {
          "type": "string",
          "description": "BT-125-2 attached document filename. Must be unique across the invoice (BR-DE-22).",
          "x-business-term": "BT-125-2"
        },
        "mimeCode": {
          "type": "string",
          "description": "BT-125-1 attached document MIME code. BR-CL-24 admits only application/pdf, image/png, image/jpeg, text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet and application/vnd.oasis.opendocument.spreadsheet.",
          "x-business-term": "BT-125-1"
        },
        "content": {
          "type": "string",
          "description": "BT-125 the document bytes, base64-encoded. Written as given, not re-encoded.",
          "x-business-term": "BT-125"
        }
      }
    },
    "InvoiceInput": {
      "type": "object",
      "description": "The invoice as JSON: the body of POST /v1/validate (as `application/json`) and of POST /v1/generate, and the `invoice` POST /v1/parse returns. Field names map to EN 16931 business terms. The fields in `required` are the only ones the model needs; every other field and group is optional, and one you leave out is not written. Types are the model's and nothing more: the rules judge the values and report what is wrong as findings, so a value this schema allows can still fail validation. Mirrors `InvoiceInput` in @attestwire/en16931.",
      "required": [
        "profile",
        "invoiceNumber",
        "issueDate",
        "currency",
        "seller",
        "buyer",
        "lines"
      ],
      "properties": {
        "profile": {
          "type": "string",
          "enum": [
            "en16931",
            "xrechnung-ubl",
            "xrechnung-cii",
            "facturx-en16931",
            "peppol-bis-3",
            "auto"
          ],
          "x-api-resolved": [
            "auto"
          ],
          "description": "Selects the rule set, and on POST /v1/generate the syntax. Narrower profiles add rules; they never remove core ones. \"auto\" (POST /v1/validate and /v1/generate) has the API choose from the buyer, without any network call: a Leitweg-ID (electronic address scheme 0204, or a German buyer reference) is xrechnung-ubl; a Belgian buyer or a Peppol electronic address is peppol-bis-3; a French buyer is facturx-en16931; a German or Austrian business is xrechnung-cii, or facturx-en16931 with ?format=pdf; anything else is en16931 (facturx-en16931 with ?format=pdf). The answer names the choice and the rule in `profile_choice` and the Attestwire-Profile headers."
        },
        "invoiceNumber": {
          "type": "string",
          "description": "BT-1 invoice number.",
          "x-business-term": "BT-1"
        },
        "issueDate": {
          "type": "string",
          "format": "date",
          "description": "BT-2 issue date, ISO 8601.",
          "x-business-term": "BT-2"
        },
        "currency": {
          "type": "string",
          "description": "BT-5 invoice currency code, ISO 4217.",
          "x-business-term": "BT-5"
        },
        "invoiceTypeCode": {
          "type": "string",
          "description": "BT-3 document type code, UNTDID 1001: \"380\", the default, is a commercial invoice and \"381\" a credit note. It decides the document type: \"381\" makes a UBL `CreditNote` or a CII document with type code 381, from the same fields. State a credit note's amounts positively; the type code carries the direction. BR-DE-17 restricts XRechnung to 326/380/381/384/389/875/876/877.",
          "x-business-term": "BT-3"
        },
        "dueDate": {
          "type": "string",
          "format": "date",
          "description": "BT-9 payment due date, ISO 8601. A UBL credit note carries it inside the payment means (`cac:PaymentMeans/cbc:PaymentDueDate`), so there it needs `payment`; without that group it is dropped and reported as ATW-CREDIT-NOTE-DUE-DATE-UNBOUND.",
          "x-business-term": "BT-9"
        },
        "note": {
          "type": "string",
          "description": "BT-22 invoice note, free text.",
          "x-business-term": "BT-22"
        },
        "noteSubjectCode": {
          "type": "string",
          "description": "BT-21 invoice note subject code, UNCL 4451. Written into the note itself as `#CODE#text`, so it only means something when `note` is set.",
          "x-business-term": "BT-21"
        },
        "buyerReference": {
          "type": "string",
          "description": "BT-10 buyer reference, which XRechnung requires (BR-DE-15). A German public-sector buyer's is its Leitweg-ID.",
          "x-business-term": "BT-10"
        },
        "orderReference": {
          "type": "string",
          "description": "BT-13 purchase order reference.",
          "x-business-term": "BT-13"
        },
        "salesOrderReference": {
          "type": "string",
          "description": "BT-14 sales order reference: your own order number, not the buyer's.",
          "x-business-term": "BT-14"
        },
        "projectReference": {
          "type": "string",
          "description": "BT-11 project reference. `UBL-CreditNote-2.1.xsd` has no element for it, so on a UBL credit note it is dropped and reported as ATW-CREDIT-NOTE-PROJECT-REFERENCE-UNBOUND. CII keeps it.",
          "x-business-term": "BT-11"
        },
        "contractReference": {
          "type": "string",
          "description": "BT-12 contract reference.",
          "x-business-term": "BT-12"
        },
        "despatchAdviceReference": {
          "type": "string",
          "description": "BT-16 despatch advice reference.",
          "x-business-term": "BT-16"
        },
        "receivingAdviceReference": {
          "type": "string",
          "description": "BT-15 receiving advice reference.",
          "x-business-term": "BT-15"
        },
        "tenderOrLotReference": {
          "type": "string",
          "description": "BT-17 tender or lot reference.",
          "x-business-term": "BT-17"
        },
        "invoicedObjectIdentifier": {
          "$ref": "#/$defs/SchemedIdentifier",
          "description": "BT-18 invoiced object identifier, with its BT-18-1 scheme from UNTDID 1153. What the invoice is about when that is not an order: a contract, a meter, a vehicle, a case file.",
          "x-business-term": "BT-18"
        },
        "buyerAccountingReference": {
          "type": "string",
          "description": "BT-19 buyer accounting reference: the buyer's cost centre or ledger account.",
          "x-business-term": "BT-19"
        },
        "taxPointDate": {
          "type": "string",
          "format": "date",
          "description": "BT-7 value added tax point date, ISO 8601. BR-CO-03 does not allow it together with `invoicingPeriod.descriptionCode` (BT-8).",
          "x-business-term": "BT-7"
        },
        "invoicingPeriod": {
          "$ref": "#/$defs/InvoicingPeriod",
          "description": "BG-14 invoicing period: the period the supply relates to.",
          "x-business-term": "BG-14"
        },
        "precedingInvoices": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PrecedingInvoiceReference"
          },
          "description": "BG-3 preceding invoice references: the invoices this document corrects, credits or settles against. BR-DE-26 requires one for a corrected invoice (BT-3 = 384). A credit note is not required to carry one; leaving it out raises ATW-CREDIT-NOTE-NO-PRECEDING-INVOICE at severity `information`.",
          "x-business-term": "BG-3"
        },
        "seller": {
          "$ref": "#/$defs/Party",
          "description": "BG-4 seller.",
          "x-business-term": "BG-4"
        },
        "buyer": {
          "$ref": "#/$defs/Party",
          "description": "BG-7 buyer.",
          "x-business-term": "BG-7"
        },
        "payee": {
          "$ref": "#/$defs/Payee",
          "description": "BG-10 payee, when payment goes to someone other than the seller.",
          "x-business-term": "BG-10"
        },
        "taxRepresentative": {
          "$ref": "#/$defs/TaxRepresentative",
          "description": "BG-11 seller tax representative, for a seller registered through a fiscal representative.",
          "x-business-term": "BG-11"
        },
        "vatScenario": {
          "type": "string",
          "enum": [
            "domestic",
            "intra-eu-goods",
            "intra-eu-services",
            "export",
            "small-business-exemption"
          ],
          "description": "What happened, in business terms, for every line, document level allowance and charge that does not say otherwise: the engine writes the VAT category (BT-151, BT-95, BT-102), the rate and the exemption reason (BT-120, BT-121) from it. \"domestic\": a taxed sale inside the seller's own country — category S at the rate you state in `vatRate`, which is never guessed. \"intra-eu-goods\": goods shipped to a VAT-registered business in another EU member state — K, rate 0, VATEX-EU-IC; the invoice also needs both parties' VAT identifiers, `deliverTo.countryCode` and a delivery date or invoicing period. \"intra-eu-services\": a service to a business in another EU member state, which accounts for the VAT itself (reverse charge) — AE, rate 0, VATEX-EU-AE; needs both VAT identifiers. \"export\": goods leaving the EU — G, rate 0, VATEX-EU-G; needs the seller's VAT identifier. \"small-business-exemption\": the seller does not charge VAT under its small-business scheme, Germany's § 19 UStG or France's franchise en base — E, rate 0, with the wording each country prescribes; a seller elsewhere is refused with ATW-VAT-SCENARIO-UNSUPPORTED. The exemption text is written in German for a seller in DE or AT, in French for FR, in English otherwise. It is not a tax determination: you decide which scenario applies, and the engine only writes its codes. An item's own `vatScenario` or `vatCategory` overrides this default. The document is byte for byte the one the explicit codes produce."
        },
        "lines": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/InvoiceLine"
          },
          "description": "BG-25 invoice lines, at least one (BR-16). An empty list is answered with that finding.",
          "x-business-term": "BG-25"
        },
        "allowances": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/DocumentAllowanceCharge"
          },
          "description": "BG-20 document level allowances: discounts on the whole invoice.",
          "x-business-term": "BG-20"
        },
        "charges": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/DocumentAllowanceCharge"
          },
          "description": "BG-21 document level charges: freight, packing, surcharges.",
          "x-business-term": "BG-21"
        },
        "paymentTerms": {
          "type": "string",
          "description": "BT-20 payment terms, free text.",
          "x-business-term": "BT-20"
        },
        "payment": {
          "$ref": "#/$defs/PaymentInstructions",
          "description": "BG-16 payment instructions, which XRechnung requires (BR-DE-1).",
          "x-business-term": "BG-16"
        },
        "supportingDocuments": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SupportingDocument"
          },
          "description": "BG-24 additional supporting documents.",
          "x-business-term": "BG-24"
        },
        "deliveryDate": {
          "type": "string",
          "format": "date",
          "description": "BT-72 actual delivery date, ISO 8601. Required with BT-80 by BR-IC-11 for category K. On XRechnung profiles, an invoice with no time of supply at all (no BT-72, no `invoicingPeriod`, no line `period`) raises BR-DE-TMP-32 at severity `information`.",
          "x-business-term": "BT-72"
        },
        "deliverTo": {
          "$ref": "#/$defs/DeliverToAddress",
          "description": "BG-15 deliver-to address. Core EN 16931 needs only its country code (BT-80), which BR-IC-12 reads for an intra-community supply; XRechnung also needs its city (BR-DE-10) and post code (BR-DE-11) once the group is present.",
          "x-business-term": "BG-15"
        },
        "deliverToName": {
          "type": "string",
          "description": "BT-70 deliver-to party name.",
          "x-business-term": "BT-70"
        },
        "deliverToLocationId": {
          "$ref": "#/$defs/SchemedIdentifier",
          "description": "BT-71 deliver-to location identifier, with its ISO 6523 ICD scheme.",
          "x-business-term": "BT-71"
        },
        "vatAccountingCurrency": {
          "type": "string",
          "description": "BT-6 VAT accounting currency, ISO 4217, when VAT is reported in a currency other than BT-5. Supplying it obliges you to supply `taxAmountInAccountingCurrency` (BR-53).",
          "x-business-term": "BT-6"
        },
        "taxAmountInAccountingCurrency": {
          "type": "number",
          "description": "BT-111 invoice total VAT amount in the VAT accounting currency. It depends on the exchange rate the tax authority requires for the tax point, which is not on the invoice, so it cannot be derived: you supply it.",
          "x-business-term": "BT-111"
        },
        "paidAmount": {
          "type": "number",
          "description": "BT-113 paid amount: a prepayment or deposit already received. It is subtracted from the amount due (BT-115).",
          "x-business-term": "BT-113"
        },
        "roundingAmount": {
          "type": "number",
          "description": "BT-114 rounding amount, added to the total to produce a payable round figure.",
          "x-business-term": "BT-114"
        },
        "vatExemptionReasons": {
          "type": "object",
          "propertyNames": {
            "enum": [
              "S",
              "Z",
              "E",
              "AE",
              "K",
              "G",
              "O",
              "L",
              "M"
            ]
          },
          "additionalProperties": {
            "type": "string"
          },
          "description": "BT-120 VAT exemption reason text, keyed by VAT category, such as `{\"E\": \"…\"}`. Defaults are applied for AE, K, G and O; category E has no standard text, so BR-E-10 requires you to supply one.",
          "x-business-term": "BT-120"
        },
        "vatExemptionReasonCodes": {
          "type": "object",
          "propertyNames": {
            "enum": [
              "S",
              "Z",
              "E",
              "AE",
              "K",
              "G",
              "O",
              "L",
              "M"
            ]
          },
          "additionalProperties": {
            "type": "string"
          },
          "description": "BT-121 VAT exemption reason code from the CEF VATEX list, keyed by VAT category.",
          "x-business-term": "BT-121"
        },
        "declaredTotals": {
          "$ref": "#/$defs/DeclaredTotals",
          "description": "Totals you computed yourself, checked against ours. Leave it out to have every total computed."
        }
      }
    },
    "InvoiceLine": {
      "type": "object",
      "description": "BG-25 invoice line.",
      "required": [
        "id",
        "description",
        "quantity",
        "unitCode",
        "unitPrice",
        "vatCategory"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "BT-126 invoice line identifier.",
          "x-business-term": "BT-126"
        },
        "description": {
          "type": "string",
          "description": "BT-153 item name.",
          "x-business-term": "BT-153"
        },
        "longDescription": {
          "type": "string",
          "description": "BT-154 item description, when it should say more than the item name.",
          "x-business-term": "BT-154"
        },
        "quantity": {
          "type": "number",
          "description": "BT-129 invoiced quantity.",
          "x-business-term": "BT-129"
        },
        "unitCode": {
          "type": "string",
          "description": "BT-130 unit of measure code, UN/ECE Recommendation 20.",
          "x-business-term": "BT-130"
        },
        "unitPrice": {
          "type": "number",
          "description": "BT-146 item net price.",
          "x-business-term": "BT-146"
        },
        "grossUnitPrice": {
          "type": "number",
          "description": "BT-148 item gross price, before the BT-147 price discount.",
          "x-business-term": "BT-148"
        },
        "priceDiscount": {
          "type": "number",
          "description": "BT-147 item price discount: the difference between BT-148 and BT-146.",
          "x-business-term": "BT-147"
        },
        "baseQuantity": {
          "type": "number",
          "description": "BT-149 item price base quantity, 1 when absent.",
          "x-business-term": "BT-149"
        },
        "vatCategory": {
          "type": "string",
          "enum": [
            "S",
            "Z",
            "E",
            "AE",
            "K",
            "G",
            "O",
            "L",
            "M"
          ],
          "description": "BT-151 invoiced item VAT category code, UNCL 5305: S standard rate, Z zero rated, E exempt, AE reverse charge, K intra-community supply, G export outside the EU, O not subject to VAT, L IGIC (Canary Islands), M IPSI (Ceuta and Melilla). Left out, it comes from the line's `vatScenario` or the invoice's.",
          "x-business-term": "BT-151"
        },
        "vatRate": {
          "type": "number",
          "description": "BT-152 invoiced item VAT rate, in percent.",
          "x-business-term": "BT-152"
        },
        "vatScenario": {
          "type": "string",
          "enum": [
            "domestic",
            "intra-eu-goods",
            "intra-eu-services",
            "export",
            "small-business-exemption"
          ],
          "description": "What happened on this line, instead of its VAT code: the engine writes `vatCategory`, the rate (except for \"domestic\", whose rate you give in `vatRate`) and the exemption reason from it. It overrides the invoice's `vatScenario`. A `vatCategory` stated beside it must be the one it stands for: disagreeing is the fatal ATW-VAT-SCENARIO-CONFLICT. With a scenario, `vatCategory` may be left out of the request although this schema lists it as required (the schema describes the explicit model, which POST /v1/parse returns); the response reports each code it filled in as ATW-VAT-SCENARIO-APPLIED, at severity information. \"domestic\": a taxed sale inside the seller's own country — category S at the rate you state in `vatRate`, which is never guessed. \"intra-eu-goods\": goods shipped to a VAT-registered business in another EU member state — K, rate 0, VATEX-EU-IC; the invoice also needs both parties' VAT identifiers, `deliverTo.countryCode` and a delivery date or invoicing period. \"intra-eu-services\": a service to a business in another EU member state, which accounts for the VAT itself (reverse charge) — AE, rate 0, VATEX-EU-AE; needs both VAT identifiers. \"export\": goods leaving the EU — G, rate 0, VATEX-EU-G; needs the seller's VAT identifier. \"small-business-exemption\": the seller does not charge VAT under its small-business scheme, Germany's § 19 UStG or France's franchise en base — E, rate 0, with the wording each country prescribes; a seller elsewhere is refused with ATW-VAT-SCENARIO-UNSUPPORTED. The exemption text is written in German for a seller in DE or AT, in French for FR, in English otherwise. It is not a tax determination: you decide which scenario applies, and the engine only writes its codes."
        },
        "note": {
          "type": "string",
          "description": "BT-127 invoice line note.",
          "x-business-term": "BT-127"
        },
        "objectIdentifier": {
          "$ref": "#/$defs/SchemedIdentifier",
          "description": "BT-128 invoice line object identifier, with its BT-128-1 scheme from UNTDID 1153.",
          "x-business-term": "BT-128"
        },
        "buyerAccountingReference": {
          "type": "string",
          "description": "BT-133 invoice line buyer accounting reference.",
          "x-business-term": "BT-133"
        },
        "period": {
          "$ref": "#/$defs/InvoicingPeriod",
          "description": "BG-26 invoice line period.",
          "x-business-term": "BG-26"
        },
        "orderLineReference": {
          "type": "string",
          "description": "BT-132 referenced purchase order line reference.",
          "x-business-term": "BT-132"
        },
        "allowances": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/LineAllowanceCharge"
          },
          "description": "BG-27 invoice line allowances: discounts on this line only.",
          "x-business-term": "BG-27"
        },
        "charges": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/LineAllowanceCharge"
          },
          "description": "BG-28 invoice line charges: surcharges on this line only.",
          "x-business-term": "BG-28"
        },
        "sellerItemId": {
          "type": "string",
          "description": "BT-155 item seller's identifier.",
          "x-business-term": "BT-155"
        },
        "buyerItemId": {
          "type": "string",
          "description": "BT-156 item buyer's identifier.",
          "x-business-term": "BT-156"
        },
        "standardItemId": {
          "$ref": "#/$defs/SchemedIdentifier",
          "description": "BT-157 item standard identifier, such as a GTIN, with its BT-157-1 ISO 6523 ICD scheme.",
          "x-business-term": "BT-157"
        },
        "itemClassifications": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ItemClassification"
          },
          "description": "BT-158 item classification identifiers.",
          "x-business-term": "BT-158"
        },
        "originCountryCode": {
          "type": "string",
          "description": "BT-159 item country of origin, ISO 3166-1 alpha-2.",
          "x-business-term": "BT-159"
        },
        "itemAttributes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ItemAttribute"
          },
          "description": "BG-32 item attributes: name and value pairs describing the item.",
          "x-business-term": "BG-32"
        }
      }
    },
    "InvoicingPeriod": {
      "type": "object",
      "description": "BG-14 invoicing period, or BG-26 when it is a line's `period`. The first term of each pair is the document's.",
      "properties": {
        "startDate": {
          "type": "string",
          "format": "date",
          "description": "BT-73 / BT-134 period start date, ISO 8601.",
          "x-business-term": "BT-73 / BT-134"
        },
        "endDate": {
          "type": "string",
          "format": "date",
          "description": "BT-74 / BT-135 period end date, ISO 8601.",
          "x-business-term": "BT-74 / BT-135"
        },
        "descriptionCode": {
          "type": "string",
          "description": "BT-8 value added tax point date code, UNTDID 2005 (3, 35 or 432). Document level only: ignored on a line period. BR-CO-03 does not allow it together with `taxPointDate`.",
          "x-business-term": "BT-8"
        }
      }
    },
    "ItemAttribute": {
      "type": "object",
      "description": "BG-32 item attribute. Both halves are mandatory once the group exists (BR-54).",
      "required": [
        "name",
        "value"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "BT-160 item attribute name.",
          "x-business-term": "BT-160"
        },
        "value": {
          "type": "string",
          "description": "BT-161 item attribute value.",
          "x-business-term": "BT-161"
        }
      }
    },
    "ItemClassification": {
      "type": "object",
      "description": "BT-158 item classification identifier.",
      "required": [
        "code",
        "schemeId"
      ],
      "properties": {
        "code": {
          "type": "string",
          "description": "BT-158 the classification code.",
          "x-business-term": "BT-158"
        },
        "schemeId": {
          "type": "string",
          "description": "BT-158-1 the scheme it is drawn from, UNTDID 7143.",
          "x-business-term": "BT-158-1"
        },
        "schemeVersion": {
          "type": "string",
          "description": "BT-158-2 the version of that scheme.",
          "x-business-term": "BT-158-2"
        }
      }
    },
    "KositConformance": {
      "type": "object",
      "description": "When the official KoSIT validator was last run against this engine's committed fixtures, and with what.\n\n**NOTHING IS SENT TO KoSIT WHEN YOU CALL US.** This is a dated record of a check we ran on release, not a per-call verification, and it says nothing about YOUR document.",
      "required": [
        "recorded",
        "validator",
        "configuration",
        "configuration_published"
      ],
      "properties": {
        "recorded": {
          "type": "string",
          "format": "date",
          "description": "The date of the last recorded full fixture run."
        },
        "validator": {
          "type": "string",
          "description": "Version of the KoSIT standalone validator used."
        },
        "configuration": {
          "type": "string",
          "description": "Version of the XRechnung validator configuration used."
        },
        "configuration_published": {
          "type": "string",
          "format": "date",
          "description": "The date that configuration was published by KoSIT."
        }
      }
    },
    "LineAllowanceCharge": {
      "type": "object",
      "description": "BG-27 invoice line allowance or BG-28 invoice line charge; the first term of each pair is the allowance's. It has no VAT category of its own: it changes the line net amount (BT-131) and takes the line's VAT treatment.",
      "required": [
        "amount"
      ],
      "properties": {
        "amount": {
          "type": "number",
          "description": "BT-136 / BT-141 amount, always positive.",
          "x-business-term": "BT-136 / BT-141"
        },
        "baseAmount": {
          "type": "number",
          "description": "BT-137 / BT-142 base amount.",
          "x-business-term": "BT-137 / BT-142"
        },
        "percentage": {
          "type": "number",
          "description": "BT-138 / BT-143 percentage.",
          "x-business-term": "BT-138 / BT-143"
        },
        "reason": {
          "type": "string",
          "description": "BT-139 / BT-144 reason, free text.",
          "x-business-term": "BT-139 / BT-144"
        },
        "reasonCode": {
          "type": "string",
          "description": "BT-140 / BT-145 reason code: UNCL 5189 for an allowance, UNCL 7161 for a charge.",
          "x-business-term": "BT-140 / BT-145"
        }
      }
    },
    "OverPreciseAmount": {
      "type": "object",
      "description": "A monetary amount the document wrote with more than two decimal places. Set by the readers: a number cannot say how it was written, so they record it while reading.",
      "required": [
        "field",
        "decimals",
        "text",
        "xpath"
      ],
      "properties": {
        "field": {
          "type": "string",
          "description": "The business term, which selects the BR-DEC rule."
        },
        "decimals": {
          "type": "number",
          "description": "Digits after the decimal point, trailing zeros included."
        },
        "text": {
          "type": "string",
          "description": "The amount exactly as the document writes it."
        },
        "xpath": {
          "type": "string",
          "description": "Where it was found."
        },
        "line": {
          "type": "number",
          "description": "1-based invoice line, for a line-level term (BT-131)."
        },
        "group": {
          "type": "number",
          "description": "1-based VAT breakdown group, for BT-116 and BT-117."
        }
      }
    },
    "Party": {
      "type": "object",
      "description": "BG-4 seller or BG-7 buyer. Where a field names two terms, the first is the seller's and the second the buyer's; a field with one term exists for the seller only.",
      "required": [
        "name",
        "address"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "BT-27 / BT-44 name, written as both the legal name and the trading name (BT-28 / BT-45) unless `legalName` or `tradingName` says otherwise.",
          "x-business-term": "BT-27 / BT-44"
        },
        "vatId": {
          "type": "string",
          "description": "BT-31 / BT-48 VAT identifier, with its country prefix.",
          "x-business-term": "BT-31 / BT-48"
        },
        "taxRegistrationId": {
          "type": "string",
          "description": "BT-32 seller tax registration identifier, such as the German Steuernummer.",
          "x-business-term": "BT-32"
        },
        "legalRegistrationId": {
          "type": "string",
          "description": "BT-30 / BT-47 legal registration identifier, such as an HRB number.",
          "x-business-term": "BT-30 / BT-47"
        },
        "legalRegistrationSchemeId": {
          "type": "string",
          "description": "BT-30-1 / BT-47-1 ISO 6523 ICD scheme of the legal registration identifier.",
          "x-business-term": "BT-30-1 / BT-47-1"
        },
        "identifier": {
          "$ref": "#/$defs/SchemedIdentifier",
          "description": "BT-29 / BT-46 seller or buyer identifier, with its BT-29-1 / BT-46-1 ISO 6523 ICD scheme. A machine-resolvable handle for the party: a GLN, a DUNS number, a national organisation number.",
          "x-business-term": "BT-29 / BT-46"
        },
        "additionalLegalInformation": {
          "type": "string",
          "description": "BT-33 seller additional legal information: legal form, share capital and the like.",
          "x-business-term": "BT-33"
        },
        "tradingName": {
          "type": "string",
          "description": "BT-28 / BT-45 trading name, when the party trades under a name other than its legal one.",
          "x-business-term": "BT-28 / BT-45"
        },
        "legalName": {
          "type": "string",
          "description": "BT-27 / BT-44 registered legal name, when it differs from `name`.",
          "x-business-term": "BT-27 / BT-44"
        },
        "address": {
          "$ref": "#/$defs/PostalAddress",
          "description": "BG-5 / BG-8 postal address.",
          "x-business-term": "BG-5 / BG-8"
        },
        "electronicAddress": {
          "$ref": "#/$defs/ElectronicAddress",
          "description": "BT-34 / BT-49 electronic address: where the network delivers the document, such as a Peppol participant identifier. Without it PEPPOL-EN16931-R010/R020 are fatal under `peppol-bis-3` and warnings under XRechnung.",
          "x-business-term": "BT-34 / BT-49"
        },
        "contact": {
          "$ref": "#/$defs/Contact",
          "description": "BG-6 / BG-9 contact, which XRechnung requires in full for the seller: name, phone and email (BR-DE-2/5/6/7).",
          "x-business-term": "BG-6 / BG-9"
        }
      }
    },
    "Payee": {
      "type": "object",
      "description": "BG-10 payee: where the money goes, when that is not the seller.",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "BT-59 payee name. Must differ from the seller name (BR-17).",
          "x-business-term": "BT-59"
        },
        "identifier": {
          "$ref": "#/$defs/SchemedIdentifier",
          "description": "BT-60 payee identifier, with its ISO 6523 ICD scheme.",
          "x-business-term": "BT-60"
        },
        "legalRegistrationId": {
          "$ref": "#/$defs/SchemedIdentifier",
          "description": "BT-61 payee legal registration identifier, with its ISO 6523 ICD scheme.",
          "x-business-term": "BT-61"
        }
      }
    },
    "PaymentCard": {
      "type": "object",
      "description": "BG-18 payment card information.",
      "required": [
        "primaryAccountNumber"
      ],
      "properties": {
        "primaryAccountNumber": {
          "type": "string",
          "description": "BT-87 payment card primary account number: at most its first six and last four digits. BR-51 warns above ten characters; never put a full card number on an invoice.",
          "x-business-term": "BT-87"
        },
        "holderName": {
          "type": "string",
          "description": "BT-88 payment card holder name.",
          "x-business-term": "BT-88"
        }
      }
    },
    "PaymentInstructions": {
      "type": "object",
      "description": "BG-16 payment instructions. Required for XRechnung profiles by BR-DE-1.",
      "required": [
        "meansCode"
      ],
      "properties": {
        "meansCode": {
          "type": "string",
          "description": "BT-81 payment means type code, UNTDID 4461: \"58\" SEPA credit transfer, \"30\" credit transfer, \"59\" SEPA direct debit, \"48\" card, \"57\" standing order, \"97\" clearing. Left out of a request, it is inferred from the account, as the engine's `applyDefaults` does: \"59\" for a direct debit mandate in euro and \"49\" in another currency, else \"58\" for an IBAN in the SEPA scheme paid in euro and \"30\" for any other IBAN; the response reports it as ATW-PAYMENT-MEANS-INFERRED, at severity information.",
          "x-business-term": "BT-81"
        },
        "meansName": {
          "type": "string",
          "description": "BT-82 payment means text.",
          "x-business-term": "BT-82"
        },
        "iban": {
          "type": "string",
          "description": "BT-84 payment account identifier (BG-17): the IBAN, for a credit transfer.",
          "x-business-term": "BT-84"
        },
        "accountName": {
          "type": "string",
          "description": "BT-85 payment account name (BG-17).",
          "x-business-term": "BT-85"
        },
        "bic": {
          "type": "string",
          "description": "BT-86 payment service provider identifier (BG-17): the BIC.",
          "x-business-term": "BT-86"
        },
        "remittanceInformation": {
          "type": "string",
          "description": "BT-83 remittance information: the payment reference.",
          "x-business-term": "BT-83"
        },
        "card": {
          "$ref": "#/$defs/PaymentCard",
          "description": "BG-18 payment card information. Obliged by `meansCode` 48, 54 or 55.",
          "x-business-term": "BG-18"
        },
        "directDebit": {
          "$ref": "#/$defs/DirectDebit",
          "description": "BG-19 direct debit information. Obliged by `meansCode` 59.",
          "x-business-term": "BG-19"
        }
      }
    },
    "PostalAddress": {
      "type": "object",
      "description": "A postal address: BG-5 seller, BG-8 buyer or BG-12 tax representative. The terms are listed in that order.",
      "required": [
        "city",
        "postalCode",
        "countryCode"
      ],
      "properties": {
        "line1": {
          "type": "string",
          "description": "BT-35 / BT-50 / BT-64 address line 1.",
          "x-business-term": "BT-35 / BT-50 / BT-64"
        },
        "line2": {
          "type": "string",
          "description": "BT-36 / BT-51 / BT-65 address line 2.",
          "x-business-term": "BT-36 / BT-51 / BT-65"
        },
        "line3": {
          "type": "string",
          "description": "BT-162 / BT-163 / BT-164 address line 3.",
          "x-business-term": "BT-162 / BT-163 / BT-164"
        },
        "city": {
          "type": "string",
          "description": "BT-37 / BT-52 / BT-66 city.",
          "x-business-term": "BT-37 / BT-52 / BT-66"
        },
        "postalCode": {
          "type": "string",
          "description": "BT-38 / BT-53 / BT-67 post code.",
          "x-business-term": "BT-38 / BT-53 / BT-67"
        },
        "countrySubdivision": {
          "type": "string",
          "description": "BT-39 / BT-54 / BT-68 country subdivision: a Bundesland, a région, a county.",
          "x-business-term": "BT-39 / BT-54 / BT-68"
        },
        "countryCode": {
          "type": "string",
          "description": "BT-40 / BT-55 / BT-69 country code, ISO 3166-1 alpha-2.",
          "x-business-term": "BT-40 / BT-55 / BT-69"
        }
      }
    },
    "PrecedingInvoiceReference": {
      "type": "object",
      "description": "BG-3 preceding invoice reference.",
      "required": [
        "invoiceNumber"
      ],
      "properties": {
        "invoiceNumber": {
          "type": "string",
          "description": "BT-25 the number of the invoice being corrected or referenced.",
          "x-business-term": "BT-25"
        },
        "issueDate": {
          "type": "string",
          "format": "date",
          "description": "BT-26 the issue date of that invoice, ISO 8601.",
          "x-business-term": "BT-26"
        }
      }
    },
    "Provenance": {
      "type": "object",
      "description": "What ran. Present on every metered response — POST /v1/validate and POST /v1/parse, JSON body or XML document, and the JSON envelope of POST /v1/generate including the `422` it returns for an invoice it will not emit.\n\nWHY IT EXISTS. Pin `@attestwire/en16931` and your CI gets the same answer for the same invoice forever; the hosted API always runs the current rule set, because a compliance service that froze its rules would be answering last quarter's regulation. Both are correct and the difference used to be invisible — a `valid: false` looked identical whether your invoice had changed or our rules had. This says which.\n\nThe one metered response WITHOUT it is `/v1/generate?format=xml`, which returns the document alone: an XML file has nowhere to put this, and this API does not write its own metadata into a customer's tax document.",
      "required": [
        "engine",
        "engine_version",
        "ruleset",
        "profile",
        "kosit_conformance"
      ],
      "properties": {
        "engine": {
          "type": "string",
          "description": "The npm package every compliance decision on this API comes from. Install this package at `engine_version` and you have the build that judged your document."
        },
        "engine_version": {
          "type": "string"
        },
        "ruleset": {
          "type": "string",
          "description": "The standard and our build of it, as one identifier to quote."
        },
        "profile": {
          "type": [
            "string",
            "null"
          ],
          "description": "The CIUS that ACTUALLY ran, read from the result rather than from your request: a body naming no profile is judged as `en16931`, and this is where you see that. `null` when there was no verdict to read it from."
        },
        "kosit_conformance": {
          "$ref": "#/$defs/KositConformance"
        }
      }
    },
    "SchemedIdentifier": {
      "type": "object",
      "description": "An identifier with its scheme. The field that holds it names the business term, and which code list the scheme comes from.",
      "required": [
        "value"
      ],
      "properties": {
        "value": {
          "type": "string",
          "description": "The identifier."
        },
        "schemeId": {
          "type": "string",
          "description": "Its scheme identifier: ISO 6523 ICD for party, location and item identifiers, UNTDID 1153 for the invoiced object and line object identifiers."
        }
      }
    },
    "SupportingDocument": {
      "type": "object",
      "description": "BG-24 additional supporting document.",
      "required": [
        "reference"
      ],
      "properties": {
        "reference": {
          "type": "string",
          "description": "BT-122 supporting document reference.",
          "x-business-term": "BT-122"
        },
        "description": {
          "type": "string",
          "description": "BT-123 supporting document description.",
          "x-business-term": "BT-123"
        },
        "externalUri": {
          "type": "string",
          "description": "BT-124 external document location: a URL.",
          "x-business-term": "BT-124"
        },
        "attachment": {
          "$ref": "#/$defs/EmbeddedAttachment",
          "description": "BT-125 the document itself, embedded.",
          "x-business-term": "BT-125"
        }
      }
    },
    "TaxRepresentative": {
      "type": "object",
      "description": "BG-11 seller tax representative party.",
      "required": [
        "name",
        "vatId",
        "address"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "BT-62 tax representative name.",
          "x-business-term": "BT-62"
        },
        "vatId": {
          "type": "string",
          "description": "BT-63 tax representative VAT identifier. BR-56 requires it once BG-11 exists.",
          "x-business-term": "BT-63"
        },
        "address": {
          "$ref": "#/$defs/PostalAddress",
          "description": "BG-12 tax representative postal address. BR-19 requires it once BG-11 exists.",
          "x-business-term": "BG-12"
        }
      }
    },
    "UnmappedElement": {
      "type": "object",
      "description": "One element of the document that did not reach the invoice model. `kind` separates two very different situations and you must not treat them alike.",
      "required": [
        "path",
        "name",
        "namespace",
        "kind",
        "reason"
      ],
      "properties": {
        "path": {
          "type": "string",
          "description": "Path from the root, with a `[n]` index on repeated siblings."
        },
        "name": {
          "type": "string",
          "description": "Qualified name as the document writes it."
        },
        "namespace": {
          "type": "string",
          "description": "Namespace URI of the element."
        },
        "kind": {
          "type": "string",
          "enum": [
            "unknown",
            "recomputed"
          ],
          "description": "`unknown` — there is no field for it, so THE CONTENT IS GONE from the model and from this validation. If it matters, read it out of the XML yourself. `recomputed` — the element is understood, but the model derives the value from the lines rather than storing it (line net amounts, the VAT breakdown). Nothing is lost."
        },
        "reason": {
          "type": "string",
          "description": "Why it did not reach the model."
        },
        "text": {
          "type": "string",
          "description": "Text content of the element, when it had any."
        }
      }
    },
    "UnmappedTruncated": {
      "type": "object",
      "description": "Present ONLY when the `unmapped` array was cut, and absent otherwise. One entry per invoice line is normal — line net amounts are recomputed — so a very long document produces a very long list that helps nobody. The validation itself is unaffected.",
      "required": [
        "total",
        "returned",
        "cap",
        "note"
      ],
      "properties": {
        "total": {
          "type": "integer",
          "description": "Unmapped elements the reader found."
        },
        "returned": {
          "type": "integer",
          "description": "Unmapped elements listed in this response."
        },
        "cap": {
          "type": "integer",
          "description": "The cap this deployment applied."
        },
        "note": {
          "type": "string"
        }
      }
    }
  }
}