NormAPI

Validate, generate and read German e-invoices (XRechnung, ZUGFeRD) against the official KoSIT rules.

¿Debería usar esto?

Calidad y seguridad

A
Calidad de la descripción
100%
Integridad del esquema
94%
Calidad de los nombres
95%
Riesgo de envenenamiento
100%
Coincidencia de permisos
100%
Cumplimiento del protocolo
100%

Basado en el análisis automatizado de las definiciones de herramientas y el cumplimiento del protocolo.

Costo de contexto

~10,812Tokens (definiciones de herramientas)
~26.9 KBTamaño de respuesta típico
Impacto significativo en la atención (8.45% del contexto de 128k)

Este es el número aproximado de tokens que se consumen cada vez que las herramientas del servidor se cargan en el contexto de un modelo. Los recuentos más altos reducen la atención disponible para otras tareas.

Instalar

Instalación con un clic

Agrega esto a tu archivo `claude_desktop_config.json`:

{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "@normapi/mcp"
      ]
    }
  }
}

Paquetes ejecutables

npm@normapi/mcp1.4.0stdio

Puntos de conexión remotos

https://normapi.com/mcpstreamable-http

Qué puede hacer

Inventario de herramientas

Herramientas (4)

🟢 Solo lectura🟡 Escritura🔴 Eliminación⚪ Desconocido
🟢validate_invoice(xml, pdfBase64, file, fileName, language)

Check an XRechnung (UBL or CII XML) or a ZUGFeRD/Factur-X PDF against the official KoSIT rules. Returns the verdict, the rule set version, and every finding; each business-rule finding comes with a plain-language meaning, cause and fix. Send the XML as text in `xml`, the PDF base64-encoded in `pdfBase64`, or an uploaded file in `file` — exactly one. No account needed; 5 MB at most.

Esquema de entrada

{
  "type": "object",
  "properties": {
    "xml": {
      "description": "The invoice XML as text",
      "type": "string",
      "maxLength": 5242880
    },
    "pdfBase64": {
      "description": "A ZUGFeRD or Factur-X PDF, base64-encoded",
      "type": "string",
      "maxLength": 6990511
    },
    "file": {
      "type": "object",
      "properties": {
        "download_url": {
          "type": "string",
          "maxLength": 4096,
          "description": "Where the file can be downloaded"
        },
        "file_id": {
          "type": "string",
          "maxLength": 200,
          "description": "The client's id for the file"
        },
        "mime_type": {
          "type": "string",
          "maxLength": 200
        },
        "file_name": {
          "type": "string",
          "maxLength": 200
        }
      },
      "required": [
        "download_url",
        "file_id"
      ],
      "description": "An uploaded file, handed over as a download link"
    },
    "fileName": {
      "description": "The file name, echoed into the report only",
      "type": "string",
      "maxLength": 200
    },
    "language": {
      "default": "en",
      "description": "Language of the plain-language explanations: en (default) or de",
      "type": "string",
      "enum": [
        "en",
        "de"
      ]
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}

Esquema de salida

{
  "type": "object",
  "properties": {
    "acceptable": {
      "type": "boolean",
      "description": "The verdict: true when no ERROR-severity finding remains"
    },
    "rulesetVersion": {
      "type": "string",
      "description": "The KoSIT rule set release that produced the verdict"
    },
    "scenario": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "The rules that judged the document; null means nothing was checked"
    },
    "schemaValid": {
      "type": "boolean"
    },
    "businessRulesEvaluated": {
      "type": "boolean",
      "description": "False when a schema failure stopped the run, so an empty list is not a pass"
    },
    "errors": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "warnings": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "findings": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "severity": {
            "type": "string",
            "enum": [
              "ERROR",
              "WARNING",
              "INFORMATION"
            ]
          },
          "origin": {
            "type": "string",
            "enum": [
              "SCHEMA",
              "SCHEMATRON",
              "PDFA",
              "NORMAPI"
            ],
            "description": "SCHEMA and SCHEMATRON are the rule set's findings, PDFA the PDF's, NORMAPI a note from NormAPI itself, such as a check that stopped part-way"
          },
          "text": {
            "type": "string",
            "description": "The rule as the official rule set words it"
          },
          "location": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "XPath of the offending node; null for schema findings"
          },
          "line": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "column": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "explanation": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "meaning": {
                    "type": "string"
                  },
                  "cause": {
                    "type": "string"
                  },
                  "fix": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string"
                  }
                },
                "required": [
                  "meaning",
                  "cause",
                  "fix",
                  "url"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "Plain-language meaning, cause and fix; every business rule has one, schema findings and NormAPI notes none"
          }
        },
        "required": [
          "code",
          "severity",
          "origin",
          "text",
          "location",
          "line",
          "column",
          "explanation"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "acceptable",
    "rulesetVersion",
    "scenario",
    "schemaValid",
    "businessRulesEvaluated",
    "errors",
    "warnings",
    "findings"
  ],
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false
}
🟢parse_invoice(xml, pdfBase64, file, validate, language)

Read a received e-invoice — XRechnung or any EN 16931 invoice as UBL or CII XML, or a ZUGFeRD/Factur-X PDF — into structured data. `invoice` is in exactly the shape generate_invoice takes (fields the document lacks are left out); `stated` has the totals, the VAT breakdown and each line net as the document states them, as exact decimal strings; `notMapped` lists by path every value of the document the data does not carry. Send the XML as text in `xml`, the PDF base64-encoded in `pdfBase64`, or an uploaded file in `file` — exactly one. `validate: true` adds the KoSIT verdict. No account needed; 5 MB at most.

Esquema de entrada

{
  "type": "object",
  "properties": {
    "xml": {
      "description": "The invoice XML as text",
      "type": "string",
      "maxLength": 5242880
    },
    "pdfBase64": {
      "description": "A ZUGFeRD or Factur-X PDF, base64-encoded",
      "type": "string",
      "maxLength": 6990511
    },
    "file": {
      "type": "object",
      "properties": {
        "download_url": {
          "type": "string",
          "maxLength": 4096,
          "description": "Where the file can be downloaded"
        },
        "file_id": {
          "type": "string",
          "maxLength": 200,
          "description": "The client's id for the file"
        },
        "mime_type": {
          "type": "string",
          "maxLength": 200
        },
        "file_name": {
          "type": "string",
          "maxLength": 200
        }
      },
      "required": [
        "download_url",
        "file_id"
      ],
      "description": "An uploaded file, handed over as a download link"
    },
    "validate": {
      "default": false,
      "description": "Also check the invoice against the KoSIT rules and return the verdict",
      "type": "boolean"
    },
    "language": {
      "default": "en",
      "description": "Language of the plain-language explanations: en (default) or de",
      "type": "string",
      "enum": [
        "en",
        "de"
      ]
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}

Esquema de salida

{
  "type": "object",
  "properties": {
    "syntax": {
      "type": "string",
      "enum": [
        "ubl",
        "cii"
      ]
    },
    "documentKind": {
      "type": "string",
      "enum": [
        "invoice",
        "creditNote"
      ],
      "description": "UBL says so by its root element; in CII the type code (BT-3) decides"
    },
    "source": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "xml",
            "pdf"
          ]
        },
        "attachment": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "For a PDF, the embedded file the invoice was read from"
        }
      },
      "required": [
        "kind",
        "attachment"
      ],
      "additionalProperties": false
    },
    "specificationId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "BT-24, the rules the document declares"
    },
    "businessProcess": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "BT-23"
    },
    "profile": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "xrechnung",
            "en16931",
            "france"
          ]
        },
        {
          "type": "null"
        }
      ],
      "description": "The profile that declares exactly this BT-24. xrechnung and en16931 are what generate_invoice takes; france marks an invoice read as French, which generate_invoice does not write yet. null for any other declaration"
    },
    "invoice": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {},
      "description": "The invoice in the shape generate_invoice takes, with what the document lacks left out. Amounts are numbers; the exact decimals of the totals are in `stated`. Where the document has them, it also carries identifierScheme on the parties, taxCurrency and vatTotalInTaxCurrency, and for a French invoice `france`, with what only France asks of an invoice; generate_invoice does not take these yet, so readyToGenerate is false while one is there."
    },
    "readyToGenerate": {
      "type": "boolean",
      "description": "Whether `invoice` passes generate_invoice's schema as it is. False for a French invoice, which generate_invoice does not write yet, and for an invoice that carries a field generate_invoice does not take yet: it would be left out"
    },
    "missingForGeneration": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "What generate_invoice would refuse in `invoice`, field by field; empty when ready"
    },
    "stated": {
      "type": "object",
      "properties": {
        "lineTotal": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "BT-106, the sum of the line nets"
        },
        "allowanceTotal": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "BT-107"
        },
        "chargeTotal": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "BT-108"
        },
        "netTotal": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "BT-109, the total without VAT"
        },
        "vatTotal": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "BT-110, in the invoice currency"
        },
        "vatAccountingCurrency": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "BT-6, when VAT is also accounted in another currency"
        },
        "vatTotalInAccountingCurrency": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "BT-111, the VAT total in that currency"
        },
        "grossTotal": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "BT-112, the total with VAT"
        },
        "prepaidAmount": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "BT-113"
        },
        "roundingAmount": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "BT-114"
        },
        "amountDue": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "BT-115"
        },
        "vatBreakdown": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "category": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "rate": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "taxableAmount": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "vatAmount": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "exemptionReason": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "exemptionReasonCode": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "BT-121, which the invoice data does not carry"
              }
            },
            "required": [
              "category",
              "rate",
              "taxableAmount",
              "vatAmount",
              "exemptionReason",
              "exemptionReasonCode"
            ],
            "additionalProperties": false
          },
          "description": "BG-23, one entry per VAT category and rate"
        },
        "lines": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "netAmount": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "BT-131"
              },
              "priceDiscount": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "BT-147"
              },
              "allowances": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "amount": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "amount"
                  ],
                  "additionalProperties": false
                }
              },
              "charges": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "amount": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "amount"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "netAmount",
              "priceDiscount",
              "allowances",
              "charges"
            ],
            "additionalProperties": false
          },
          "description": "One per invoice line, in the same order"
        },
        "allowances": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "amount": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "amount"
            ],
            "additionalProperties": false
          },
          "description": "One per document allowance"
        },
        "charges": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "amount": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "amount"
            ],
            "additionalProperties": false
          },
          "description": "One per document charge"
        }
      },
      "required": [
        "lineTotal",
        "allowanceTotal",
        "chargeTotal",
        "netTotal",
        "vatTotal",
        "vatAccountingCurrency",
        "vatTotalInAccountingCurrency",
        "grossTotal",
        "prepaidAmount",
        "roundingAmount",
        "amountDue",
        "vatBreakdown",
        "lines",
        "allowances",
        "charges"
      ],
      "additionalProperties": false
    },
    "notMapped": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "path",
          "count"
        ],
        "additionalProperties": false
      },
      "description": "Every value of the document `invoice` and `stated` do not carry: a path without positions and how often. Empty for an invoice NormAPI generated."
    },
    "validation": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "acceptable": {
              "type": "boolean",
              "description": "The verdict: true when no ERROR-severity finding remains"
            },
            "rulesetVersion": {
              "type": "string",
              "description": "The KoSIT rule set release that produced the verdict"
            },
            "scenario": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "The rules that judged the document; null means nothing was checked"
            },
            "schemaValid": {
              "type": "boolean"
            },
            "businessRulesEvaluated": {
              "type": "boolean",
              "description": "False when a schema failure stopped the run, so an empty list is not a pass"
            },
            "errors": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            "warnings": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            "findings": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "severity": {
                    "type": "string",
                    "enum": [
                      "ERROR",
                      "WARNING",
                      "INFORMATION"
                    ]
                  },
                  "origin": {
                    "type": "string",
                    "enum": [
                      "SCHEMA",
                      "SCHEMATRON",
                      "PDFA",
                      "NORMAPI"
                    ],
                    "description": "SCHEMA and SCHEMATRON are the rule set's findings, PDFA the PDF's, NORMAPI a note from NormAPI itself, such as a check that stopped part-way"
                  },
                  "text": {
                    "type": "string",
                    "description": "The rule as the official rule set words it"
                  },
                  "location": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "XPath of the offending node; null for schema findings"
                  },
                  "line": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "column": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "explanation": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "meaning": {
                            "type": "string"
                          },
                          "cause": {
                            "type": "string"
                          },
                          "fix": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "meaning",
                          "cause",
                          "fix",
                          "url"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Plain-language meaning, cause and fix; every business rule has one, schema findings and NormAPI notes none"
                  }
                },
                "required": [
                  "code",
                  "severity",
                  "origin",
                  "text",
                  "location",
                  "line",
                  "column",
                  "explanation"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": [
            "acceptable",
            "rulesetVersion",
            "scenario",
            "schemaValid",
            "businessRulesEvaluated",
            "errors",
            "warnings",
            "findings"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ],
      "description": "With validate: true, the verdict as validate_invoice returns it; otherwise null"
    }
  },
  "required": [
    "syntax",
    "documentKind",
    "source",
    "specificationId",
    "businessProcess",
    "profile",
    "invoice",
    "readyToGenerate",
    "missingForGeneration",
    "stated",
    "notMapped",
    "validation"
  ],
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false
}
⚪generate_invoice(syntax, profile, letterhead, invoice, language)

Produce an e-invoice as `ubl` or `cii` XML or a ZUGFeRD hybrid PDF (`zugferd`) from invoice data: an XRechnung for a public-sector buyer (profile `xrechnung`, the default), a plain EN 16931 invoice for a business (profile `en16931`). Totals are computed server-side in decimal arithmetic, and the document is validated against the official rules before it is returned. Data the rules do not permit is refused with the broken rules and how to fix each. Needs the user's NormAPI account; each generated document counts against that account's monthly allowance.

Esquema de entrada

{
  "type": "object",
  "properties": {
    "syntax": {
      "default": "ubl",
      "description": "ubl or cii for XML, zugferd for the PDF/A-3 with the invoice embedded",
      "type": "string",
      "enum": [
        "ubl",
        "cii",
        "zugferd"
      ]
    },
    "profile": {
      "default": "xrechnung",
      "type": "string",
      "enum": [
        "xrechnung",
        "en16931"
      ],
      "description": "xrechnung for public-sector buyers: it requires buyerReference (the Leitweg-ID), a seller contact and both electronic addresses. en16931 for businesses (§ 14 UStG accepts it), without those."
    },
    "letterhead": {
      "default": "auto",
      "description": "zugferd only: 'none' for NormAPI's standard layout instead of the account's letterhead",
      "type": "string",
      "enum": [
        "auto",
        "none"
      ]
    },
    "invoice": {
      "type": "object",
      "properties": {
        "invoiceNumber": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100,
          "description": "BT-1"
        },
        "issueDate": {
          "type": "string",
          "format": "date",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
          "description": "BT-2, YYYY-MM-DD"
        },
        "typeCode": {
          "description": "BT-3, UNTDID 1001; 380 when absent. 381 credit note, 384 corrected invoice, 326 partial, 389 self-billed, 875/876/877 construction invoices.",
          "type": "string",
          "pattern": "^[0-9]{3}$"
        },
        "precedingInvoices": {
          "description": "BG-3, the invoices this one corrects, credits or settles. CII and ZUGFeRD carry one.",
          "maxItems": 50,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "number": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100,
                "description": "BT-25"
              },
              "issueDate": {
                "description": "BT-26",
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              }
            },
            "required": [
              "number"
            ]
          }
        },
        "dueDate": {
          "description": "BT-9. XRechnung wants this or paymentTerms on a payable invoice.",
          "type": "string",
          "format": "date",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
        },
        "deliveryDate": {
          "description": "BT-72. Omitting it and invoicePeriod draws an advisory.",
          "type": "string",
          "format": "date",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
        },
        "deliverTo": {
          "type": "object",
          "properties": {
            "name": {
              "description": "BT-70, who received the goods: a branch, a warehouse, a site",
              "type": "string",
              "maxLength": 200
            },
            "locationId": {
              "description": "BT-71, an identifier of the place, e.g. its GLN",
              "type": "string",
              "maxLength": 100
            },
            "locationIdScheme": {
              "description": "BT-71-1, ISO 6523 ICD of locationId: 0088 for a GLN; absent means the seller's own",
              "type": "string",
              "pattern": "^[0-9]{4}$"
            },
            "address": {
              "description": "BG-15, the delivery address",
              "type": "object",
              "properties": {
                "street": {
                  "description": "BT-35 / BT-50 / BT-75",
                  "type": "string",
                  "maxLength": 200
                },
                "city": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100,
                  "description": "BT-37 / BT-52 / BT-77, mandatory (BR-DE-3, BR-DE-8, BR-DE-10)"
                },
                "postcode": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 20,
                  "description": "BT-38 / BT-53 / BT-78, mandatory (BR-DE-4, BR-DE-9, BR-DE-11)"
                },
                "country": {
                  "type": "string",
                  "pattern": "^[A-Z]{2}$",
                  "description": "BT-40 / BT-55 / BT-80, ISO 3166-1 alpha-2, e.g. DE"
                }
              },
              "required": [
                "city",
                "postcode",
                "country"
              ]
            }
          },
          "description": "BG-13: where the supply went, when not simply to the buyer. Required for VAT category K: the country the goods went to (BR-IC-12)."
        },
        "invoicePeriod": {
          "description": "BG-14, the period a monthly or yearly invoice covers, instead of deliveryDate or beside it",
          "type": "object",
          "properties": {
            "startDate": {
              "description": "BT-73 / BT-134, YYYY-MM-DD",
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
            },
            "endDate": {
              "description": "BT-74 / BT-135, YYYY-MM-DD",
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
            }
          }
        },
        "currency": {
          "type": "string",
          "pattern": "^[A-Z]{3}$",
          "description": "BT-5, ISO 4217, e.g. EUR"
        },
        "buyerReference": {
          "description": "BT-10: the Leitweg-ID for public-sector buyers, else the buyer reference. Mandatory in XRechnung (BR-DE-15), optional in EN 16931.",
          "type": "string",
          "maxLength": 200
        },
        "orderReference": {
          "description": "BT-13, the buyer's purchase order number",
          "type": "string",
          "maxLength": 100
        },
        "contractReference": {
          "description": "BT-12",
          "type": "string",
          "maxLength": 100
        },
        "projectReference": {
          "description": "BT-11",
          "type": "string",
          "maxLength": 100
        },
        "despatchAdviceReference": {
          "description": "BT-16, the delivery note (Lieferschein) number",
          "type": "string",
          "maxLength": 100
        },
        "attachments": {
          "description": "BG-24",
          "maxItems": 20,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "description": "BT-122, the document's number or name; the filename when absent (BR-52)",
                "type": "string",
                "maxLength": 200
              },
              "description": {
                "description": "BT-123",
                "type": "string",
                "maxLength": 500
              },
              "filename": {
                "description": "BT-125-2, unique within the invoice (BR-DE-22)",
                "type": "string",
                "maxLength": 200
              },
              "mimeCode": {
                "description": "BT-125-1, one of BR-CL-24: application/pdf, image/png, image/jpeg, text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.oasis.opendocument.spreadsheet",
                "type": "string",
                "maxLength": 100
              },
              "content": {
                "description": "BT-125, the file as base64, with filename and mimeCode; it must be of that type. At most 3 MB of files per invoice.",
                "type": "string",
                "format": "base64",
                "contentEncoding": "base64",
                "pattern": "^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$"
              },
              "url": {
                "description": "BT-124, where the buyer can fetch the document",
                "type": "string",
                "maxLength": 2000,
                "pattern": "^https?:\\/\\/\\S+$"
              }
            },
            "description": "BG-24, a supporting document: a file inside the invoice (a timesheet, a delivery note), a link, or a reference alone"
          }
        },
        "note": {
          "description": "BT-22",
          "type": "string",
          "maxLength": 1000
        },
        "seller": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "description": "BT-27 / BT-44, the legal name"
            },
            "identifier": {
              "description": "BT-29 / BT-46. A seller without a VAT id repeats its tax number here: BT-32 alone satisfies BR-DE-16 but not BR-CO-26.",
              "type": "string",
              "maxLength": 100
            },
            "vatId": {
              "description": "BT-31 / BT-48, e.g. DE123456789",
              "type": "string",
              "maxLength": 30
            },
            "taxNumber": {
              "description": "BT-32, the German Steuernummer",
              "type": "string",
              "maxLength": 30
            },
            "electronicAddress": {
              "description": "BT-34 / BT-49, an email address unless a scheme says otherwise. XRechnung requires both (PEPPOL-EN16931-R020 seller, R010 buyer); EN 16931 neither.",
              "type": "string",
              "maxLength": 254
            },
            "electronicAddressScheme": {
              "description": "EAS code for the electronic address; EM (email) when absent",
              "type": "string",
              "pattern": "^[0-9A-Z]{2,10}$"
            },
            "address": {
              "type": "object",
              "properties": {
                "street": {
                  "description": "BT-35 / BT-50 / BT-75",
                  "type": "string",
                  "maxLength": 200
                },
                "city": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100,
                  "description": "BT-37 / BT-52 / BT-77, mandatory (BR-DE-3, BR-DE-8, BR-DE-10)"
                },
                "postcode": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 20,
                  "description": "BT-38 / BT-53 / BT-78, mandatory (BR-DE-4, BR-DE-9, BR-DE-11)"
                },
                "country": {
                  "type": "string",
                  "pattern": "^[A-Z]{2}$",
                  "description": "BT-40 / BT-55 / BT-80, ISO 3166-1 alpha-2, e.g. DE"
                }
              },
              "required": [
                "city",
                "postcode",
                "country"
              ],
              "description": "BG-5 / BG-8 / BG-15"
            },
            "contact": {
              "type": "object",
              "properties": {
                "name": {
                  "description": "BT-41",
                  "type": "string",
                  "maxLength": 200
                },
                "phone": {
                  "description": "BT-42",
                  "type": "string",
                  "maxLength": 50
                },
                "email": {
                  "description": "BT-43",
                  "type": "string",
                  "maxLength": 254
                }
              },
              "description": "BG-6. XRechnung requires all three on the seller (BR-DE-2, BR-DE-5 to 7); EN 16931 none."
            },
            "tradingName": {
              "description": "BT-28 / BT-45, the name the party trades under beside its legal name",
              "type": "string",
              "maxLength": 200
            },
            "registrationId": {
              "description": "BT-30 / BT-47, the register entry, e.g. HRB 123456 for a GmbH; identifies a seller for BR-CO-26 like a VAT id does",
              "type": "string",
              "maxLength": 100
            },
            "registrationIdScheme": {
              "description": "BT-30-1 / BT-47-1, ISO 6523 ICD of registrationId: none for a German register number, 0002 for a French SIREN",
              "type": "string",
              "pattern": "^[0-9]{4}$"
            },
            "legalInformation": {
              "description": "BT-33, seller only: what company law wants on business letters beyond the name, e.g. \"Sitz Berlin, Amtsgericht Charlottenburg · Geschäftsführer: Maria Muster\" (§ 35a GmbHG)",
              "type": "string",
              "maxLength": 1000
            }
          },
          "required": [
            "name",
            "address"
          ],
          "description": "BG-4. Needs a VAT id or tax number (BR-DE-16); XRechnung also a contact (BR-DE-2)."
        },
        "buyer": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "description": "BT-27 / BT-44, the legal name"
            },
            "identifier": {
              "description": "BT-29 / BT-46. A seller without a VAT id repeats its tax number here: BT-32 alone satisfies BR-DE-16 but not BR-CO-26.",
              "type": "string",
              "maxLength": 100
            },
            "vatId": {
              "description": "BT-31 / BT-48, e.g. DE123456789",
              "type": "string",
              "maxLength": 30
            },
            "taxNumber": {
              "description": "BT-32, the German Steuernummer",
              "type": "string",
              "maxLength": 30
            },
            "electronicAddress": {
              "description": "BT-34 / BT-49, an email address unless a scheme says otherwise. XRechnung requires both (PEPPOL-EN16931-R020 seller, R010 buyer); EN 16931 neither.",
              "type": "string",
              "maxLength": 254
            },
            "electronicAddressScheme": {
              "description": "EAS code for the electronic address; EM (email) when absent",
              "type": "string",
              "pattern": "^[0-9A-Z]{2,10}$"
            },
            "address": {
              "type": "object",
              "properties": {
                "street": {
                  "description": "BT-35 / BT-50 / BT-75",
                  "type": "string",
                  "maxLength": 200
                },
                "city": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100,
                  "description": "BT-37 / BT-52 / BT-77, mandatory (BR-DE-3, BR-DE-8, BR-DE-10)"
                },
                "postcode": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 20,
                  "description": "BT-38 / BT-53 / BT-78, mandatory (BR-DE-4, BR-DE-9, BR-DE-11)"
                },
                "country": {
                  "type": "string",
                  "pattern": "^[A-Z]{2}$",
                  "description": "BT-40 / BT-55 / BT-80, ISO 3166-1 alpha-2, e.g. DE"
                }
              },
              "required": [
                "city",
                "postcode",
                "country"
              ],
              "description": "BG-5 / BG-8 / BG-15"
            },
            "contact": {
              "type": "object",
              "properties": {
                "name": {
                  "description": "BT-41",
                  "type": "string",
                  "maxLength": 200
                },
                "phone": {
                  "description": "BT-42",
                  "type": "string",
                  "maxLength": 50
                },
                "email": {
                  "description": "BT-43",
                  "type": "string",
                  "maxLength": 254
                }
              },
              "description": "BG-6. XRechnung requires all three on the seller (BR-DE-2, BR-DE-5 to 7); EN 16931 none."
            },
            "tradingName": {
              "description": "BT-28 / BT-45, the name the party trades under beside its legal name",
              "type": "string",
              "maxLength": 200
            },
            "registrationId": {
              "description": "BT-30 / BT-47, the register entry, e.g. HRB 123456 for a GmbH; identifies a seller for BR-CO-26 like a VAT id does",
              "type": "string",
              "maxLength": 100
            },
            "registrationIdScheme": {
              "description": "BT-30-1 / BT-47-1, ISO 6523 ICD of registrationId: none for a German register number, 0002 for a French SIREN",
              "type": "string",
              "pattern": "^[0-9]{4}$"
            },
            "legalInformation": {
              "description": "BT-33, seller only: what company law wants on business letters beyond the name, e.g. \"Sitz Berlin, Amtsgericht Charlottenburg · Geschäftsführer: Maria Muster\" (§ 35a GmbHG)",
              "type": "string",
              "maxLength": 1000
            }
          },
          "required": [
            "name",
            "address"
          ],
          "description": "BG-7"
        },
        "payment": {
          "type": "object",
          "properties": {
            "meansCode": {
              "type": "string",
              "pattern": "^([0-9]{1,3}|ZZZ)$",
              "description": "BT-81, UNTDID 4461: 58 SEPA credit transfer, 30 credit transfer, 59 SEPA direct debit, 48/54/55 card, 10 cash, ZZZ mutually defined"
            },
            "iban": {
              "description": "BT-84, the payee account; required for transfers (BR-DE-23-a)",
              "type": "string",
              "maxLength": 34
            },
            "reference": {
              "description": "BT-83, what the payer should quote",
              "type": "string",
              "maxLength": 140
            },
            "meansText": {
              "description": "BT-82, the payment means in words",
              "type": "string",
              "maxLength": 200
            },
            "accountName": {
              "description": "BT-85, the payee account holder",
              "type": "string",
              "maxLength": 200
            },
            "bic": {
              "description": "BT-86, the payee bank",
              "type": "string",
              "pattern": "^[A-Z]{6}[A-Z0-9]{2}([A-Z0-9]{3})?$"
            },
            "card": {
              "type": "object",
              "properties": {
                "number": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 50,
                  "pattern": "^[^0-9]*([0-9][^0-9]*){0,10}$",
                  "description": "BT-87, masked: at most the first 6 and the last 4 digits, never the full number. Send digits without mask characters."
                },
                "holder": {
                  "description": "BT-88",
                  "type": "string",
                  "maxLength": 200
                },
                "network": {
                  "description": "VISA, MasterCard …; UBL writes NA when absent",
                  "type": "string",
                  "maxLength": 50
                }
              },
              "required": [
                "number"
              ],
              "description": "BG-18, with payment means 48, 54 or 55"
            },
            "directDebit": {
              "type": "object",
              "properties": {
                "mandateReference": {
                  "description": "BT-89",
                  "type": "string",
                  "maxLength": 35
                },
                "creditorId": {
                  "description": "BT-90, the SEPA creditor identifier",
                  "type": "string",
                  "maxLength": 35
                },
                "debitedAccount": {
                  "description": "BT-91, the buyer IBAN debited",
                  "type": "string",
                  "maxLength": 34
                }
              },
              "description": "BG-19, with payment means 59. Leave out the payee IBAN (BR-DE-25-b)."
            }
          },
          "required": [
            "meansCode"
          ],
          "description": "BG-16 and the group its code calls for: BG-17 transfer, BG-18 card, BG-19 direct debit"
        },
        "paymentTerms": {
          "description": "BT-20",
          "type": "string",
          "maxLength": 1000
        },
        "allowances": {
          "description": "BG-20",
          "maxItems": 100,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "amount": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "pattern": "^-?\\d+(\\.\\d+)?$"
                  }
                ],
                "description": "Two decimals. Give amount or percent, exactly one."
              },
              "percent": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "pattern": "^-?\\d+(\\.\\d+)?$"
                  }
                ],
                "description": "Give amount or percent, exactly one."
              },
              "baseAmount": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "pattern": "^-?\\d+(\\.\\d+)?$"
                  }
                ],
                "description": "What the percentage is taken of. Only with percent (PEPPOL-EN16931-R042)."
              },
              "reason": {
                "description": "This or reasonCode is required",
                "type": "string",
                "maxLength": 500
              },
              "reasonCode": {
                "description": "UNTDID 5189 for an allowance (95 discount), UNTDID 7161 for a charge (FC freight)",
                "type": "string",
                "pattern": "^[0-9A-Z]{1,3}$"
              },
              "vatCategory": {
                "type": "string",
                "enum": [
                  "S",
                  "Z",
                  "E",
                  "AE",
                  "K",
                  "G",
                  "O",
                  "L",
                  "M"
                ],
                "description": "UNTDID 5305: S standard, Z zero-rated, E exempt, AE reverse charge, K intra-community supply, G export, O outside scope, L Canary Islands, M Ceuta/Melilla"
              },
              "vatRate": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "pattern": "^-?\\d+(\\.\\d+)?$"
                  }
                ],
                "description": "Percent"
              },
              "vatExemptionReason": {
                "description": "BT-120, as on a line",
                "type": "string",
                "maxLength": 500
              }
            },
            "required": [
              "vatCategory"
            ],
            "description": "A document-level allowance (BG-20) or charge (BG-21)"
          }
        },
        "charges": {
          "description": "BG-21: freight, packaging …",
          "maxItems": 100,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "amount": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "pattern": "^-?\\d+(\\.\\d+)?$"
                  }
                ],
                "description": "Two decimals. Give amount or percent, exactly one."
              },
              "percent": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "pattern": "^-?\\d+(\\.\\d+)?$"
                  }
                ],
                "description": "Give amount or percent, exactly one."
              },
              "baseAmount": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "pattern": "^-?\\d+(\\.\\d+)?$"
                  }
                ],
                "description": "What the percentage is taken of. Only with percent (PEPPOL-EN16931-R042)."
              },
              "reason": {
                "description": "This or reasonCode is required",
                "type": "string",
                "maxLength": 500
              },
              "reasonCode": {
                "description": "UNTDID 5189 for an allowance (95 discount), UNTDID 7161 for a charge (FC freight)",
                "type": "string",
                "pattern": "^[0-9A-Z]{1,3}$"
              },
              "vatCategory": {
                "type": "string",
                "enum": [
                  "S",
                  "Z",
                  "E",
                  "AE",
                  "K",
                  "G",
                  "O",
                  "L",
                  "M"
                ],
                "description": "UNTDID 5305: S standard, Z zero-rated, E exempt, AE reverse charge, K intra-community supply, G export, O outside scope, L Canary Islands, M Ceuta/Melilla"
              },
              "vatRate": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "pattern": "^-?\\d+(\\.\\d+)?$"
                  }
                ],
                "description": "Percent"
              },
              "vatExemptionReason": {
                "description": "BT-120, as on a line",
                "type": "string",
                "maxLength": 500
              }
            },
            "required": [
              "vatCategory"
            ],
            "description": "A document-level allowance (BG-20) or charge (BG-21)"
          }
        },
        "prepaidAmount": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string",
              "pattern": "^-?\\d+(\\.\\d+)?$"
            }
          ],
          "description": "BT-113, already paid; the amount due is the total less this"
        },
        "lines": {
          "minItems": 1,
          "maxItems": 500,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "description": "BT-126; assigned 1..n when absent",
                "type": "string",
                "maxLength": 50
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "description": "BT-153"
              },
              "description": {
                "description": "BT-154",
                "type": "string",
                "maxLength": 1000
              },
              "quantity": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "pattern": "^-?\\d+(\\.\\d+)?$"
                  }
                ],
                "description": "BT-129, up to six decimals"
              },
              "unit": {
                "type": "string",
                "pattern": "^[0-9A-Z]{1,8}$",
                "description": "BT-130, UN/ECE Rec 20: C62 piece, HUR hour, DAY day, KGM kilogram …"
              },
              "unitPrice": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "pattern": "^-?\\d+(\\.\\d+)?$"
                  }
                ],
                "description": "BT-146, net, up to four decimals; per baseQuantity units when one is given"
              },
              "vatCategory": {
                "type": "string",
                "enum": [
                  "S",
                  "Z",
                  "E",
                  "AE",
                  "K",
                  "G",
                  "O",
                  "L",
                  "M"
                ],
                "description": "UNTDID 5305: S standard, Z zero-rated, E exempt, AE reverse charge, K intra-community supply, G export, O outside scope, L Canary Islands, M Ceuta/Melilla"
              },
              "vatRate": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "pattern": "^-?\\d+(\\.\\d+)?$"
                  }
                ],
                "description": "BT-152, percent; required for category S"
              },
              "vatExemptionReason": {
                "description": "BT-120; the rule set wants it for the exempt-family categories",
                "type": "string",
                "maxLength": 500
              },
              "allowances": {
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "amount": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      ],
                      "description": "Two decimals. Give amount or percent, exactly one."
                    },
                    "percent": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      ],
                      "description": "Give amount or percent, exactly one."
                    },
                    "baseAmount": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      ],
                      "description": "What the percentage is taken of. Only with percent (PEPPOL-EN16931-R042)."
                    },
                    "reason": {
                      "description": "This or reasonCode is required",
                      "type": "string",
                      "maxLength": 500
                    },
                    "reasonCode": {
                      "description": "UNTDID 5189 for an allowance (95 discount), UNTDID 7161 for a charge (FC freight)",
                      "type": "string",
                      "pattern": "^[0-9A-Z]{1,3}$"
                    }
                  },
                  "description": "A line allowance (BG-27) or charge (BG-28); it changes the line net, in the line VAT category"
                }
              },
              "charges": {
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "amount": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      ],
                      "description": "Two decimals. Give amount or percent, exactly one."
                    },
                    "percent": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      ],
                      "description": "Give amount or percent, exactly one."
                    },
                    "baseAmount": {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string",
                          "pattern": "^-?\\d+(\\.\\d+)?$"
                        }
                      ],
                      "description": "What the percentage is taken of. Only with percent (PEPPOL-EN16931-R042)."
                    },
                    "reason": {
                      "description": "This or reasonCode is required",
                      "type": "string",
                      "maxLength": 500
                    },
                    "reasonCode": {
                      "description": "UNTDID 5189 for an allowance (95 discount), UNTDID 7161 for a charge (FC freight)",
                      "type": "string",
                      "pattern": "^[0-9A-Z]{1,3}$"
                    }
                  },
                  "description": "A line allowance (BG-27) or charge (BG-28); it changes the line net, in the line VAT category"
                }
              },
              "period": {
                "description": "BG-26, the period this line covers",
                "type": "object",
                "properties": {
                  "startDate": {
                    "description": "BT-73 / BT-134, YYYY-MM-DD",
                    "type": "string",
                    "format": "date",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                  },
                  "endDate": {
                    "description": "BT-74 / BT-135, YYYY-MM-DD",
                    "type": "string",
                    "format": "date",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                  }
                }
              },
              "orderLineReference": {
                "description": "BT-132, the line of the buyer's purchase order this one bills",
                "type": "string",
                "maxLength": 50
              },
              "note": {
                "description": "BT-127, free text on this line",
                "type": "string",
                "maxLength": 1000
              },
              "sellerItemId": {
                "description": "BT-155, the seller's article number",
                "type": "string",
                "maxLength": 100
              },
              "buyerItemId": {
                "description": "BT-156, the buyer's own number for the article",
                "type": "string",
                "maxLength": 100
              },
              "standardItemId": {
                "description": "BT-157, e.g. the GTIN (EAN) on the packaging",
                "type": "string",
                "maxLength": 100
              },
              "standardItemIdScheme": {
                "description": "BT-157-1, ISO 6523 ICD of standardItemId; 0160 (GTIN) when absent",
                "type": "string",
                "pattern": "^[0-9]{4}$"
              },
              "listPrice": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "pattern": "^-?\\d+(\\.\\d+)?$"
                  }
                ],
                "description": "BT-148, the price before the price discount, at least unitPrice; the discount (BT-147) is listPrice − unitPrice"
              },
              "baseQuantity": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "pattern": "^-?\\d+(\\.\\d+)?$"
                  }
                ],
                "description": "BT-149, how many units unitPrice and listPrice are for, e.g. 100 for a price per hundred; 1 when absent"
              }
            },
            "required": [
              "name",
              "quantity",
              "unit",
              "unitPrice",
              "vatCategory"
            ]
          },
          "description": "BG-25. Totals are computed server-side in decimal arithmetic."
        }
      },
      "required": [
        "invoiceNumber",
        "issueDate",
        "currency",
        "seller",
        "buyer",
        "payment",
        "lines"
      ]
    },
    "language": {
      "default": "en",
      "description": "Language of the plain-language explanations: en (default) or de",
      "type": "string",
      "enum": [
        "en",
        "de"
      ]
    }
  },
  "required": [
    "invoice"
  ],
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}

Esquema de salida

{
  "type": "object",
  "properties": {
    "syntax": {
      "type": "string",
      "enum": [
        "ubl",
        "cii",
        "zugferd"
      ]
    },
    "profile": {
      "type": "string",
      "enum": [
        "xrechnung",
        "en16931"
      ],
      "description": "xrechnung for public-sector buyers: it requires buyerReference (the Leitweg-ID), a seller contact and both electronic addresses. en16931 for businesses (§ 14 UStG accepts it), without those."
    },
    "fileName": {
      "type": "string"
    },
    "mimeType": {
      "type": "string"
    },
    "bytes": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "rulesetVersion": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "The rule set the document passed before it was returned"
    },
    "scenario": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "letterhead": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "The id of the account's letterhead the ZUGFeRD PDF is printed on; null when it is not, for XML, and for an account without a letterhead"
    },
    "letterheadSkipped": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Why the account's letterhead was left out: requested, customer-call, seller-mismatch, needs-confirmation, recheck-failed or render-failed; null when it was used, for XML, and for an account without a letterhead"
    },
    "xml": {
      "description": "The XML document; absent for the ZUGFeRD PDF, which is the attached resource",
      "type": "string"
    }
  },
  "required": [
    "syntax",
    "profile",
    "fileName",
    "mimeType",
    "bytes",
    "rulesetVersion",
    "scenario",
    "letterhead",
    "letterheadSkipped"
  ],
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false
}
🟢explain_rule(code, language)

Explain one EN 16931 / XRechnung / Peppol business rule by its code (e.g. BR-DE-15, BR-CO-10, PEPPOL-EN16931-R010): what it requires, why invoices typically break it, and how to fix it, with a link to the full page. Case does not matter. Schema findings (cvc-*) have no explanation.

Esquema de entrada

{
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "minLength": 2,
      "maxLength": 60,
      "description": "The rule code, e.g. BR-DE-15"
    },
    "language": {
      "default": "en",
      "description": "Language of the plain-language explanations: en (default) or de",
      "type": "string",
      "enum": [
        "en",
        "de"
      ]
    }
  },
  "required": [
    "code"
  ],
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}

Esquema de salida

{
  "type": "object",
  "properties": {
    "code": {
      "type": "string"
    },
    "language": {
      "type": "string",
      "enum": [
        "de",
        "en",
        "fr"
      ]
    },
    "meaning": {
      "type": "string"
    },
    "cause": {
      "type": "string"
    },
    "fix": {
      "type": "string"
    },
    "url": {
      "type": "string"
    }
  },
  "required": [
    "code",
    "language",
    "meaning",
    "cause",
    "fix",
    "url"
  ],
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false
}

Comunidad

Califica este servidor

Evidencia

Observaciones recientes

verificadoversión no registrada4 herramientas
verificadoversión no registrada4 herramientas
verificadoversión no registrada4 herramientas
verificadoversión no registrada3 herramientas
verificadoversión no registrada3 herramientas