{"openapi":"3.1.0","info":{"title":"InvoiceVerify API","version":"1.1.0","summary":"Validate, generate and convert EU e-invoices; check Peppol receivability, including whole Belgian client lists.","description":"REST API for EN 16931 e-invoices: UBL 2.1, Peppol BIS Billing 3.0, XRechnung (UBL & CII) and Factur-X / ZUGFeRD.\n\n**Metering.** Every validate, convert, generate, parse and Peppol lookup request uses one call; a Belgian list check uses one call per company (up to 25 per request). Free accounts include 100 calls per month, Pro includes 1,000. After that, prepaid call packs are used (Starter pack: 2,000 calls for €19; Growth pack: 10,000 calls for €79; Scale pack: 50,000 calls for €299; valid 12 months). Failed requests (4xx) are not charged. `GET /v1/usage` and the rules endpoints are free.\n\n**Rate limit.** 120 metered requests per minute per account.\n\n**Privacy.** Invoice contents are processed in memory and never stored; only metadata (format, validity, counts) is logged.\n\nAn MCP server with the same tools is available at https://peppol-invoice-compass.lovable.app/mcp (OAuth).","contact":{"url":"https://peppol-invoice-compass.lovable.app/docs/api"}},"servers":[{"url":"https://peppol-invoice-compass.lovable.app/api/public"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Invoices","description":"Validation and format conversion"},{"name":"Peppol","description":"Participant and receivability lookups"},{"name":"Reference","description":"Business rule reference (free)"},{"name":"Account","description":"Usage (free)"}],"paths":{"/v1/validate":{"post":{"tags":["Invoices"],"operationId":"validateInvoice","summary":"Validate an e-invoice","description":"Validates syntax, EN 16931 business rules, Peppol BIS 3 or XRechnung rules, VAT and totals. Returns every finding with rule ID, line number and XPath.","parameters":[{"name":"profile","in":"query","schema":{"type":"string","enum":["auto","peppol","en16931","xrechnung"],"default":"auto"}},{"name":"filename","in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/xml":{"schema":{"type":"string","description":"UBL 2.1 or CII invoice XML"}},"application/pdf":{"schema":{"type":"string","format":"binary","description":"Factur-X / ZUGFeRD PDF"}},"application/json":{"schema":{"type":"object","required":["xml"],"properties":{"xml":{"type":"string"},"filename":{"type":"string"},"profile":{"type":"string","enum":["auto","peppol","en16931","xrechnung"]},"format":{"type":"string","enum":["peppol","xrechnung-ubl","xrechnung-cii","cii"]}}}}}},"responses":{"200":{"description":"Validation report","headers":{"X-Usage-Allowance":{"schema":{"type":"integer"},"description":"Included calls this month"},"X-Usage-Calls-This-Month":{"schema":{"type":"integer"},"description":"Calls used this month"},"X-Usage-Pack-Credits-Remaining":{"schema":{"type":"integer"},"description":"Unused, unexpired pack credits"},"X-Usage-Charged-To":{"schema":{"type":"string","enum":["allowance","pack"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationReport"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Monthly allowance used up and no call-pack credits left","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The document or data could not be processed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/generate":{"post":{"tags":["Invoices"],"operationId":"generateInvoice","summary":"Generate invoice XML from JSON","description":"Computes line totals, VAT breakdown and payable amount, serialises to the requested format and validates the result. Send `Accept: application/xml` to receive the raw XML.","parameters":[{"name":"format","in":"query","required":false,"description":"`peppol` — Peppol BIS Billing 3.0 (UBL 2.1); `xrechnung-ubl` — XRechnung 3.0 (UBL 2.1); `xrechnung-cii` — XRechnung 3.0 (UN/CEFACT CII); `cii` — Factur-X / ZUGFeRD EN 16931 XML (CII)","schema":{"type":"string","enum":["peppol","xrechnung-ubl","xrechnung-cii","cii"],"default":"peppol"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["invoice"],"properties":{"format":{"type":"string","enum":["peppol","xrechnung-ubl","xrechnung-cii","cii"]},"invoice":{"$ref":"#/components/schemas/InvoiceData"}}},{"$ref":"#/components/schemas/InvoiceData"}]}}}},"responses":{"200":{"description":"Generated invoice","headers":{"X-Usage-Allowance":{"schema":{"type":"integer"},"description":"Included calls this month"},"X-Usage-Calls-This-Month":{"schema":{"type":"integer"},"description":"Calls used this month"},"X-Usage-Pack-Credits-Remaining":{"schema":{"type":"integer"},"description":"Unused, unexpired pack credits"},"X-Usage-Charged-To":{"schema":{"type":"string","enum":["allowance","pack"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeneratedInvoice"}},"application/xml":{"schema":{"type":"string"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Monthly allowance used up and no call-pack credits left","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The document or data could not be processed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/convert":{"post":{"tags":["Invoices"],"operationId":"convertInvoice","summary":"Convert an invoice to another format","description":"Reads UBL or CII (or a Factur-X PDF) and writes it as Peppol BIS 3 UBL, XRechnung UBL/CII or Factur-X CII. JSON invoice data is also accepted (same as /v1/generate).","parameters":[{"name":"format","in":"query","required":false,"description":"`peppol` — Peppol BIS Billing 3.0 (UBL 2.1); `xrechnung-ubl` — XRechnung 3.0 (UBL 2.1); `xrechnung-cii` — XRechnung 3.0 (UN/CEFACT CII); `cii` — Factur-X / ZUGFeRD EN 16931 XML (CII)","schema":{"type":"string","enum":["peppol","xrechnung-ubl","xrechnung-cii","cii"],"default":"peppol"}}],"requestBody":{"required":true,"content":{"application/xml":{"schema":{"type":"string","description":"UBL 2.1 or CII invoice XML"}},"application/pdf":{"schema":{"type":"string","format":"binary","description":"Factur-X / ZUGFeRD PDF"}},"application/json":{"schema":{"type":"object","required":["xml"],"properties":{"xml":{"type":"string"},"filename":{"type":"string"},"profile":{"type":"string","enum":["auto","peppol","en16931","xrechnung"]},"format":{"type":"string","enum":["peppol","xrechnung-ubl","xrechnung-cii","cii"]}}}}}},"responses":{"200":{"description":"Converted invoice","headers":{"X-Usage-Allowance":{"schema":{"type":"integer"},"description":"Included calls this month"},"X-Usage-Calls-This-Month":{"schema":{"type":"integer"},"description":"Calls used this month"},"X-Usage-Pack-Credits-Remaining":{"schema":{"type":"integer"},"description":"Unused, unexpired pack credits"},"X-Usage-Charged-To":{"schema":{"type":"string","enum":["allowance","pack"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeneratedInvoice"}},"application/xml":{"schema":{"type":"string"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Monthly allowance used up and no call-pack credits left","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The document or data could not be processed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/parse":{"post":{"tags":["Invoices"],"operationId":"parseInvoice","summary":"Read an invoice into JSON","requestBody":{"required":true,"content":{"application/xml":{"schema":{"type":"string","description":"UBL 2.1 or CII invoice XML"}},"application/pdf":{"schema":{"type":"string","format":"binary","description":"Factur-X / ZUGFeRD PDF"}},"application/json":{"schema":{"type":"object","required":["xml"],"properties":{"xml":{"type":"string"},"filename":{"type":"string"},"profile":{"type":"string","enum":["auto","peppol","en16931","xrechnung"]},"format":{"type":"string","enum":["peppol","xrechnung-ubl","xrechnung-cii","cii"]}}}}}},"responses":{"200":{"description":"Parsed invoice","headers":{"X-Usage-Allowance":{"schema":{"type":"integer"},"description":"Included calls this month"},"X-Usage-Calls-This-Month":{"schema":{"type":"integer"},"description":"Calls used this month"},"X-Usage-Pack-Credits-Remaining":{"schema":{"type":"integer"},"description":"Unused, unexpired pack credits"},"X-Usage-Charged-To":{"schema":{"type":"string","enum":["allowance","pack"]}}},"content":{"application/json":{"schema":{"type":"object","properties":{"format":{"type":"string"},"valid":{"type":"boolean"},"invoice":{"oneOf":[{"$ref":"#/components/schemas/InvoiceData"},{"type":"null"}]},"counts":{"$ref":"#/components/schemas/Counts"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Monthly allowance used up and no call-pack credits left","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The document or data could not be processed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/peppol/lookup":{"get":{"tags":["Peppol"],"operationId":"lookupPeppolParticipant","summary":"Check whether a company can receive Peppol invoices","description":"Accepts a VAT number, company number (KBO/BCE, KvK, SIREN/SIRET), GLN, Leitweg-ID or Peppol ID and checks every relevant identifier (e.g. Belgian 0208 and 9925) in the live Peppol SML/SMP and Directory. Returns supported document types, the endpoint and advice on which ID to use.","parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string","maxLength":80},"example":"BE0403170701"},{"name":"country","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Za-z]{2}$"}}],"responses":{"200":{"description":"Receivability result","headers":{"X-Usage-Allowance":{"schema":{"type":"integer"},"description":"Included calls this month"},"X-Usage-Calls-This-Month":{"schema":{"type":"integer"},"description":"Calls used this month"},"X-Usage-Pack-Credits-Remaining":{"schema":{"type":"integer"},"description":"Unused, unexpired pack credits"},"X-Usage-Charged-To":{"schema":{"type":"string","enum":["allowance","pack"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LookupResult"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Monthly allowance used up and no call-pack credits left","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The document or data could not be processed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/peppol/belgium-list":{"post":{"tags":["Peppol"],"operationId":"checkBelgianPeppolList","summary":"Check a list of Belgian companies under 0208 and 9925","description":"Checks up to 25 Belgian enterprise or VAT numbers live in the Peppol SML/SMP under both Belgian identifiers: 0208 (enterprise number, KBO/BCE) and 9925 (VAT number). Each company gets a coverage of both, only_0208, only_9925, neither or unknown, plus the risk and fix in English, Dutch or French. One metered call per valid company, charged all or nothing; unreadable numbers are free.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["companies"],"properties":{"companies":{"type":"array","minItems":1,"maxItems":25,"items":{"oneOf":[{"type":"string","maxLength":80,"example":"BE0403170701"},{"type":"object","required":["id"],"properties":{"id":{"type":"string","maxLength":80},"name":{"type":"string","maxLength":200}}}]}},"lang":{"type":"string","enum":["en","nl","fr"],"default":"en"}}},"example":{"lang":"nl","companies":["BE0403170701",{"id":"0462.920.226","name":"Klant NV"}]}}}},"responses":{"200":{"description":"Per-company coverage under 0208 and 9925","headers":{"X-Usage-Allowance":{"schema":{"type":"integer"},"description":"Included calls this month"},"X-Usage-Calls-This-Month":{"schema":{"type":"integer"},"description":"Calls used this month"},"X-Usage-Pack-Credits-Remaining":{"schema":{"type":"integer"},"description":"Unused, unexpired pack credits"},"X-Usage-Charged-To":{"schema":{"type":"string","enum":["allowance","pack"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BelgianListResult"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Monthly allowance used up and no call-pack credits left","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"No valid Belgian number in the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/rules":{"get":{"tags":["Reference"],"operationId":"listRules","summary":"List all business rules checked","security":[],"parameters":[{"name":"lang","in":"query","schema":{"type":"string","enum":["en","nl","fr"],"default":"en"}}],"responses":{"200":{"description":"Rules","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/rules/{id}":{"get":{"tags":["Reference"],"operationId":"getRule","summary":"Explain one business rule, with the fix","security":[],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"example":"BR-CO-15"},{"name":"lang","in":"query","schema":{"type":"string","enum":["en","nl","fr"],"default":"en"}}],"responses":{"200":{"description":"Rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rule"}}}},"404":{"description":"Unknown rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/usage":{"get":{"tags":["Account"],"operationId":"getUsage","summary":"Calls used this month, allowance and pack credits","responses":{"200":{"description":"Usage","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Usage"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key from https://peppol-invoice-compass.lovable.app/dashboard/api-keys (iv_live_…)."}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}}}}}}}},"Counts":{"type":"object","properties":{"error":{"type":"integer"},"warning":{"type":"integer"},"info":{"type":"integer"}}},"Finding":{"type":"object","properties":{"rule":{"type":"string","example":"BR-CO-15"},"source":{"type":"string","enum":["EN16931","Peppol","XRechnung","InvoiceVerify"]},"severity":{"type":"string","enum":["error","warning","info"]},"section":{"type":"string"},"title":{"type":"string"},"message":{"type":"string"},"line":{"type":["integer","null"]},"column":{"type":["integer","null"]},"xpath":{"type":["string","null"]},"expected":{"type":["string","null"]},"actual":{"type":["string","null"]}}},"ValidationReport":{"type":"object","properties":{"valid":{"type":"boolean"},"format":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"syntax":{"type":"string"},"document":{"type":"string"}}},"profile":{"type":"string","enum":["peppol","en16931","xrechnung","none"]},"invoice":{"type":["object","null"]},"counts":{"$ref":"#/components/schemas/Counts"},"sections":{"type":"object"},"rulesChecked":{"type":"integer"},"findings":{"type":"array","items":{"$ref":"#/components/schemas/Finding"}},"durationMs":{"type":"number"}}},"GeneratedInvoice":{"type":"object","properties":{"format":{"type":"string","enum":["peppol","xrechnung-ubl","xrechnung-cii","cii"]},"formatLabel":{"type":"string"},"filename":{"type":"string"},"xml":{"type":"string"},"valid":{"type":"boolean"},"counts":{"$ref":"#/components/schemas/Counts"},"findings":{"type":"array","items":{"$ref":"#/components/schemas/Finding"}},"sourceFormat":{"type":"string","description":"Only for /v1/convert"}}},"LookupResult":{"type":"object","properties":{"query":{"type":"string"},"inputKind":{"type":"string"},"country":{"type":"string"},"checkedAt":{"type":"string","format":"date-time"},"verdict":{"type":"string","enum":["receivable","partial","not_registered","unknown"]},"recommendedId":{"type":"string","example":"0208:0403170701"},"canReceive":{"type":"object","properties":{"invoice":{"type":"boolean"},"creditNote":{"type":"boolean"}}},"company":{"type":"object","properties":{"name":{"type":"string"},"country":{"type":"string"}}},"participants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scheme":{"type":"string"},"schemeLabel":{"type":"string"},"status":{"type":"string","enum":["registered","not_registered","error"]},"smpUrl":{"type":"string"},"smpHost":{"type":"string"},"documents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","enum":["invoice","creditnote","other"]},"billing3":{"type":"boolean"}}}},"endpoint":{"type":"object","properties":{"transportProfile":{"type":"string"},"url":{"type":"string"},"activation":{"type":"string"},"expiration":{"type":"string"}}},"error":{"type":"string"}}}},"directory":{"type":"array","items":{"type":"object"}},"advice":{"type":"array","items":{"type":"object","properties":{"level":{"type":"string","enum":["ok","info","warning","error"]},"text":{"type":"string"}}}}}},"BelgianListResult":{"type":"object","properties":{"summary":{"type":"object","properties":{"checked":{"type":"integer"},"both":{"type":"integer"},"only0208":{"type":"integer"},"only9925":{"type":"integer"},"neither":{"type":"integer"},"unknown":{"type":"integer"},"invalid":{"type":"integer"}}},"results":{"type":"array","items":{"type":"object","properties":{"input":{"type":"string"},"name":{"type":["string","null"]},"enterpriseNumber":{"type":"string","example":"0403.170.701"},"vatNumber":{"type":"string","example":"BE0403170701"},"coverage":{"type":"string","enum":["both","only_0208","only_9925","neither","unknown"]},"receivableUnder0208":{"type":"boolean"},"receivableUnder9925":{"type":"boolean"},"sendTo":{"type":["string","null"],"example":"0208:0403170701"},"ids":{"type":"object","additionalProperties":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["receivable","no_invoices","not_registered","error"]},"serviceProvider":{"type":["string","null"]}}}},"differentProviders":{"type":"boolean"},"registeredWithoutInvoices":{"type":"boolean"},"result":{"type":"string"},"risk":{"type":"string"},"fix":{"type":"array","items":{"type":"string"}},"notes":{"type":"array","items":{"type":"string"}},"checkedAt":{"type":"string","format":"date-time"}}}},"invalid":{"type":"array","items":{"type":"object","properties":{"input":{"type":"string"},"name":{"type":["string","null"]},"error":{"type":"string","enum":["empty","not_belgian","format","checksum"]},"message":{"type":"string"}}}}}},"Rule":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string"},"severity":{"type":"string"},"section":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"fix":{"type":"string"},"plain":{"type":"object","description":"Plain-language explanation in the requested language"},"url":{"type":"string"}}},"Usage":{"type":"object","properties":{"period":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}}},"callsThisMonth":{"type":"integer"},"includedCalls":{"type":"integer"},"includedRemaining":{"type":"integer"},"packCreditsRemaining":{"type":"integer"},"packs":{"type":"array","items":{"type":"object"}},"rateLimitPerMinute":{"type":"integer"}}},"InvoiceData":{"type":"object","properties":{"number":{"type":"string","minLength":1},"issueDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"dueDate":{"anyOf":[{"anyOf":[{"not":{}},{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}]},{"type":"string","enum":[""]}]},"typeCode":{"type":"string","default":"380"},"currency":{"type":"string","minLength":3,"maxLength":3,"default":"EUR"},"buyerReference":{"type":"string"},"orderReference":{"type":"string"},"contractReference":{"type":"string"},"projectReference":{"type":"string"},"note":{"type":"string"},"paymentTerms":{"type":"string"},"periodStart":{"type":"string"},"periodEnd":{"type":"string"},"deliveryDate":{"type":"string"},"deliveryCountry":{"type":"string"},"precedingInvoice":{"type":"object","properties":{"number":{"type":"string"},"date":{"type":"string"}},"required":["number"],"additionalProperties":false},"seller":{"type":"object","properties":{"name":{"type":"string","minLength":1},"tradingName":{"type":"string"},"vatId":{"type":"string"},"companyId":{"type":"string"},"companyIdScheme":{"type":"string"},"endpointId":{"type":"string","minLength":1},"endpointScheme":{"type":"string","pattern":"^[0-9A-Z]{2,4}$"},"street":{"type":"string"},"additionalStreet":{"type":"string"},"city":{"type":"string"},"postalCode":{"type":"string"},"subdivision":{"type":"string"},"country":{"type":"string","minLength":2,"maxLength":2},"contactName":{"type":"string"},"contactEmail":{"type":"string"},"contactPhone":{"type":"string"}},"required":["name","endpointId","endpointScheme","country"],"additionalProperties":false},"buyer":{"type":"object","properties":{"name":{"type":"string","minLength":1},"tradingName":{"type":"string"},"vatId":{"type":"string"},"companyId":{"type":"string"},"companyIdScheme":{"type":"string"},"endpointId":{"type":"string","minLength":1},"endpointScheme":{"type":"string","pattern":"^[0-9A-Z]{2,4}$"},"street":{"type":"string"},"additionalStreet":{"type":"string"},"city":{"type":"string"},"postalCode":{"type":"string"},"subdivision":{"type":"string"},"country":{"type":"string","minLength":2,"maxLength":2},"contactName":{"type":"string"},"contactEmail":{"type":"string"},"contactPhone":{"type":"string"}},"required":["name","endpointId","endpointScheme","country"],"additionalProperties":false},"payment":{"type":"object","properties":{"meansCode":{"type":"string","default":"58"},"iban":{"type":"string"},"bic":{"type":"string"},"accountName":{"type":"string"},"paymentReference":{"type":"string"},"mandateReference":{"type":"string"}},"additionalProperties":false},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","minLength":1},"description":{"type":"string"},"sellerItemId":{"type":"string"},"quantity":{"type":"number"},"unitCode":{"type":"string","minLength":1,"default":"C62"},"unitPrice":{"type":"number","minimum":0},"discount":{"type":"number","minimum":0},"vatCategory":{"type":"string","enum":["S","Z","E","AE","K","G","O","L","M"],"default":"S"},"vatRate":{"type":"number","minimum":0,"maximum":100},"periodStart":{"type":"string"},"periodEnd":{"type":"string"}},"required":["name","quantity","unitPrice"],"additionalProperties":false},"minItems":1},"allowances":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string","minLength":1},"reasonCode":{"type":"string"},"amount":{"type":"number","minimum":0},"vatCategory":{"type":"string","enum":["S","Z","E","AE","K","G","O","L","M"],"default":"S"},"vatRate":{"type":"number","minimum":0,"maximum":100}},"required":["reason","amount"],"additionalProperties":false}},"charges":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string","minLength":1},"reasonCode":{"type":"string"},"amount":{"type":"number","minimum":0},"vatCategory":{"type":"string","enum":["S","Z","E","AE","K","G","O","L","M"],"default":"S"},"vatRate":{"type":"number","minimum":0,"maximum":100}},"required":["reason","amount"],"additionalProperties":false}},"prepaidAmount":{"type":"number"},"exemptionReasons":{"type":"object","additionalProperties":{"type":"object","properties":{"code":{"type":"string"},"text":{"type":"string"}},"additionalProperties":false}}},"required":["number","issueDate","seller","buyer","lines"],"additionalProperties":false,"description":"Structured invoice data (EN 16931 semantic model, simplified)."}}}}