{"openapi":"3.1.0","info":{"title":"InvoiceIn","description":"\n**Any received European or UAE (PINT AE) e-invoice in — canonical JSON, validation report with fix hints, PDF, CSV and DATEV out.**\n\nAccepted inputs: XRechnung (UBL or CII), EN 16931 UBL 2.1 Invoice/CreditNote, Peppol BIS Billing 3, CII D16B,\nZUGFeRD 1.0 / 2.x and Factur-X hybrid PDFs (the XML is extracted from the PDF), Italy's FatturaPA 1.2,\nPoland's KSeF FA(2)/FA(3), Romania's RO e-Factura (CIUS-RO), the UAE's PINT AE (Billing and Self-Billing).\n\nSend the file as multipart field `file` or as the raw request body. Nothing is persisted; processing is in memory only.\n\n**Poland:** the KSeF number is not part of the FA(2)/FA(3) document — pass it as `?ksef=` or `X-KSeF-Number` and it is\nchecked against the invoice and returned on `payment.ksef_number`, the reference art. 108g requires in the transfer\ntitle from 1 January 2027.\n\n**Versions:** every validation names the rule sets it ran, with versions — `validation.rule_sets` and `validation.coverage` in the body, `X-Invoicein-Rulesets` and `X-Invoicein-Coverage` on the response. `coverage: schema` means only XSD and arithmetic could run (a profile below EN 16931, FatturaPA, KSeF): `valid: true` is then \"nothing we could check failed\", not a conformance verdict. Dated changes: `GET /v1/rulesets` and https://invoicein.peculiar.systems/rules/changelog (Atom feed).\n\n**Auth:** `Authorization: Bearer <key>` or `X-Api-Key: <key>`. Without a key, a small per-IP daily demo quota applies (20 invoices a day).\nOne invoice = one credit, whatever outputs you ask for; a file that carries several invoices (a FatturaPA lot) costs one credit per invoice.\n","version":"0.1.0"},"paths":{"/v1/formats":{"get":{"tags":["meta"],"summary":"Supported input formats and rule-set versions","operationId":"formats_v1_formats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/rulesets":{"get":{"tags":["meta"],"summary":"Rule-set versions in force and their dated changelog","description":"Every rule set and schema the validator runs, at the version it runs today, plus the\npublic changelog (newest first). The same table prints on every /rules page and is sent\nwith every validation as the `X-Invoicein-Rulesets` header.","operationId":"rulesets_v1_rulesets_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/countries":{"get":{"tags":["meta"],"summary":"Which format each country's mandate asks for, and what we validate it with","operationId":"countries_map_v1_countries_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/rules/{rule_id}":{"get":{"tags":["meta"],"summary":"Plain-language explanation of a validation rule id","operationId":"rule_v1_rules__rule_id__get","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}},{"name":"lang","in":"query","required":false,"schema":{"type":"string","pattern":"^(en|de|pl|it|fr)$","default":"en","title":"Lang"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/vat/{number}":{"get":{"tags":["meta"],"summary":"Check an EU VAT number: format offline, then live VIES, with the dated receipt","description":"Free and unmetered: this calls the Commission's own service, so it costs us nothing and\ncosts you no credits. A failed lookup never comes back as `invalid` — an unreachable member\nstate is `unverified`, and the response says which one and when we asked.","operationId":"vat_check_v1_vat__number__get","parameters":[{"name":"number","in":"path","required":true,"schema":{"type":"string","title":"Number"}},{"name":"requester","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Your own VAT number. VIES then issues a consultation number — the form auditors ask for.","title":"Requester"},"description":"Your own VAT number. VIES then issues a consultation number — the form auditors ask for."},{"name":"live","in":"query","required":false,"schema":{"type":"boolean","description":"false checks the national format only, without calling VIES","default":true,"title":"Live"},"description":"false checks the national format only, without calling VIES"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/peppol/{identifier}":{"get":{"tags":["meta"],"summary":"Is a counterparty published on Peppol, and what can it receive","description":"Registry presence from the Peppol Directory — `0088:1234567890128`, or free text to search.\nFree and unmetered. A directory outage comes back as `unverified`, never as `not_found`.","operationId":"peppol_lookup_v1_peppol__identifier__get","parameters":[{"name":"identifier","in":"path","required":true,"schema":{"type":"string","title":"Identifier"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/schema":{"get":{"tags":["meta"],"summary":"Canonical JSON field guide (BT/BG numbers)","operationId":"schema_v1_schema_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/invoice":{"post":{"tags":["invoice"],"summary":"Everything in one call: canonical JSON + validation (+ optional html/pdf/csv/datev)","operationId":"invoice_v1_invoice_post","parameters":[{"name":"file","in":"query","required":false,"schema":{"type":"null","title":"File"}},{"name":"include","in":"query","required":false,"schema":{"type":"string","description":"Comma list of extras: validation, html, pdf, csv, datev","default":"validation","title":"Include"},"description":"Comma list of extras: validation, html, pdf, csv, datev"},{"name":"full","in":"query","required":false,"schema":{"type":"boolean","description":"Force full Schematron rule sets on very large invoices (>3000 lines)","default":false,"title":"Full"},"description":"Force full Schematron rule sets on very large invoices (>3000 lines)"},{"name":"lang","in":"query","required":false,"schema":{"type":"string","pattern":"^(en|de|pl|it|fr)$","description":"Language of hints and rendering","default":"en","title":"Lang"},"description":"Language of hints and rendering"},{"name":"skr","in":"query","required":false,"schema":{"type":"string","pattern":"^(03|04)$","description":"DATEV chart of accounts","default":"03","title":"Skr"},"description":"DATEV chart of accounts"},{"name":"creditor_account","in":"query","required":false,"schema":{"type":"string","description":"DATEV creditor (Gegenkonto)","default":"70000","title":"Creditor Account"},"description":"DATEV creditor (Gegenkonto)"},{"name":"ksef","in":"query","required":false,"schema":{"type":"string","description":"Poland: the KSeF number the National e-Invoice System gave this invoice (35 characters, NNNNNNNNNN-RRRRMMDD-FFFFFFFFFFFF-FF), or the collective identifier covering it (NNNNNNNNNN-IZRRRRMM-FFFFFFFFFFFF-FF). KSeF assigns it on acceptance, so it is never in the XML: pass it here or in the X-KSeF-Number header and it comes back on payment.ksef_number, checked against the invoice.","default":"","title":"Ksef"},"description":"Poland: the KSeF number the National e-Invoice System gave this invoice (35 characters, NNNNNNNNNN-RRRRMMDD-FFFFFFFFFFFF-FF), or the collective identifier covering it (NNNNNNNNNN-IZRRRRMM-FFFFFFFFFFFF-FF). KSeF assigns it on acceptance, so it is never in the XML: pass it here or in the X-KSeF-Number header and it comes back on payment.ksef_number, checked against the invoice."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}}},"application/xml":{"schema":{"type":"string","format":"binary"}},"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/octet-stream":{"schema":{"type":"string","format":"binary"}}},"description":"The e-invoice: multipart field `file`, or the raw XML/PDF as the body."}}},"/v1/parse":{"post":{"tags":["invoice"],"summary":"Canonical JSON only (no validation)","operationId":"parse_v1_parse_post","parameters":[{"name":"file","in":"query","required":false,"schema":{"type":"null","title":"File"}},{"name":"ksef","in":"query","required":false,"schema":{"type":"string","description":"Poland: the KSeF number the National e-Invoice System gave this invoice (35 characters, NNNNNNNNNN-RRRRMMDD-FFFFFFFFFFFF-FF), or the collective identifier covering it (NNNNNNNNNN-IZRRRRMM-FFFFFFFFFFFF-FF). KSeF assigns it on acceptance, so it is never in the XML: pass it here or in the X-KSeF-Number header and it comes back on payment.ksef_number, checked against the invoice.","default":"","title":"Ksef"},"description":"Poland: the KSeF number the National e-Invoice System gave this invoice (35 characters, NNNNNNNNNN-RRRRMMDD-FFFFFFFFFFFF-FF), or the collective identifier covering it (NNNNNNNNNN-IZRRRRMM-FFFFFFFFFFFF-FF). KSeF assigns it on acceptance, so it is never in the XML: pass it here or in the X-KSeF-Number header and it comes back on payment.ksef_number, checked against the invoice."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}}},"application/xml":{"schema":{"type":"string","format":"binary"}},"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/octet-stream":{"schema":{"type":"string","format":"binary"}}},"description":"The e-invoice: multipart field `file`, or the raw XML/PDF as the body."}}},"/v1/validate":{"post":{"tags":["invoice"],"summary":"Validation report with fix hints (no invoice body)","operationId":"validate_v1_validate_post","parameters":[{"name":"file","in":"query","required":false,"schema":{"type":"null","title":"File"}},{"name":"lang","in":"query","required":false,"schema":{"type":"string","pattern":"^(en|de|pl|it|fr)$","default":"en","title":"Lang"}},{"name":"ksef","in":"query","required":false,"schema":{"type":"string","description":"Poland: the KSeF number the National e-Invoice System gave this invoice (35 characters, NNNNNNNNNN-RRRRMMDD-FFFFFFFFFFFF-FF), or the collective identifier covering it (NNNNNNNNNN-IZRRRRMM-FFFFFFFFFFFF-FF). KSeF assigns it on acceptance, so it is never in the XML: pass it here or in the X-KSeF-Number header and it comes back on payment.ksef_number, checked against the invoice.","default":"","title":"Ksef"},"description":"Poland: the KSeF number the National e-Invoice System gave this invoice (35 characters, NNNNNNNNNN-RRRRMMDD-FFFFFFFFFFFF-FF), or the collective identifier covering it (NNNNNNNNNN-IZRRRRMM-FFFFFFFFFFFF-FF). KSeF assigns it on acceptance, so it is never in the XML: pass it here or in the X-KSeF-Number header and it comes back on payment.ksef_number, checked against the invoice."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}}},"application/xml":{"schema":{"type":"string","format":"binary"}},"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/octet-stream":{"schema":{"type":"string","format":"binary"}}},"description":"The e-invoice: multipart field `file`, or the raw XML/PDF as the body."}}},"/v1/render.html":{"post":{"tags":["render"],"summary":"Human-readable HTML","operationId":"render_html_v1_render_html_post","parameters":[{"name":"file","in":"query","required":false,"schema":{"type":"null","title":"File"}},{"name":"lang","in":"query","required":false,"schema":{"type":"string","pattern":"^(en|de|pl|it|fr)$","default":"en","title":"Lang"}},{"name":"ksef","in":"query","required":false,"schema":{"type":"string","description":"Poland: the KSeF number the National e-Invoice System gave this invoice (35 characters, NNNNNNNNNN-RRRRMMDD-FFFFFFFFFFFF-FF), or the collective identifier covering it (NNNNNNNNNN-IZRRRRMM-FFFFFFFFFFFF-FF). KSeF assigns it on acceptance, so it is never in the XML: pass it here or in the X-KSeF-Number header and it comes back on payment.ksef_number, checked against the invoice.","default":"","title":"Ksef"},"description":"Poland: the KSeF number the National e-Invoice System gave this invoice (35 characters, NNNNNNNNNN-RRRRMMDD-FFFFFFFFFFFF-FF), or the collective identifier covering it (NNNNNNNNNN-IZRRRRMM-FFFFFFFFFFFF-FF). KSeF assigns it on acceptance, so it is never in the XML: pass it here or in the X-KSeF-Number header and it comes back on payment.ksef_number, checked against the invoice."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}}},"application/xml":{"schema":{"type":"string","format":"binary"}},"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/octet-stream":{"schema":{"type":"string","format":"binary"}}},"description":"The e-invoice: multipart field `file`, or the raw XML/PDF as the body."}}},"/v1/render.pdf":{"post":{"tags":["render"],"summary":"Human-readable PDF (A4)","operationId":"render_pdf_v1_render_pdf_post","parameters":[{"name":"file","in":"query","required":false,"schema":{"type":"null","title":"File"}},{"name":"lang","in":"query","required":false,"schema":{"type":"string","pattern":"^(en|de|pl|it|fr)$","default":"en","title":"Lang"}},{"name":"ksef","in":"query","required":false,"schema":{"type":"string","description":"Poland: the KSeF number the National e-Invoice System gave this invoice (35 characters, NNNNNNNNNN-RRRRMMDD-FFFFFFFFFFFF-FF), or the collective identifier covering it (NNNNNNNNNN-IZRRRRMM-FFFFFFFFFFFF-FF). KSeF assigns it on acceptance, so it is never in the XML: pass it here or in the X-KSeF-Number header and it comes back on payment.ksef_number, checked against the invoice.","default":"","title":"Ksef"},"description":"Poland: the KSeF number the National e-Invoice System gave this invoice (35 characters, NNNNNNNNNN-RRRRMMDD-FFFFFFFFFFFF-FF), or the collective identifier covering it (NNNNNNNNNN-IZRRRRMM-FFFFFFFFFFFF-FF). KSeF assigns it on acceptance, so it is never in the XML: pass it here or in the X-KSeF-Number header and it comes back on payment.ksef_number, checked against the invoice."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}}},"application/xml":{"schema":{"type":"string","format":"binary"}},"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/octet-stream":{"schema":{"type":"string","format":"binary"}}},"description":"The e-invoice: multipart field `file`, or the raw XML/PDF as the body."}}},"/v1/export.csv":{"post":{"tags":["export"],"summary":"Flat CSV (one row per line item, or per document with level=documents)","operationId":"export_csv_v1_export_csv_post","parameters":[{"name":"file","in":"query","required":false,"schema":{"type":"null","title":"File"}},{"name":"level","in":"query","required":false,"schema":{"type":"string","pattern":"^(lines|documents)$","default":"lines","title":"Level"}},{"name":"ksef","in":"query","required":false,"schema":{"type":"string","description":"Poland: the KSeF number the National e-Invoice System gave this invoice (35 characters, NNNNNNNNNN-RRRRMMDD-FFFFFFFFFFFF-FF), or the collective identifier covering it (NNNNNNNNNN-IZRRRRMM-FFFFFFFFFFFF-FF). KSeF assigns it on acceptance, so it is never in the XML: pass it here or in the X-KSeF-Number header and it comes back on payment.ksef_number, checked against the invoice.","default":"","title":"Ksef"},"description":"Poland: the KSeF number the National e-Invoice System gave this invoice (35 characters, NNNNNNNNNN-RRRRMMDD-FFFFFFFFFFFF-FF), or the collective identifier covering it (NNNNNNNNNN-IZRRRRMM-FFFFFFFFFFFF-FF). KSeF assigns it on acceptance, so it is never in the XML: pass it here or in the X-KSeF-Number header and it comes back on payment.ksef_number, checked against the invoice."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}}},"application/xml":{"schema":{"type":"string","format":"binary"}},"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/octet-stream":{"schema":{"type":"string","format":"binary"}}},"description":"The e-invoice: multipart field `file`, or the raw XML/PDF as the body."}}},"/v1/export.datev":{"post":{"tags":["export"],"summary":"DATEV Buchungsstapel (EXTF 700, UTF-8) for the incoming invoice","operationId":"export_datev_v1_export_datev_post","parameters":[{"name":"file","in":"query","required":false,"schema":{"type":"null","title":"File"}},{"name":"skr","in":"query","required":false,"schema":{"type":"string","pattern":"^(03|04)$","default":"03","title":"Skr"}},{"name":"creditor_account","in":"query","required":false,"schema":{"type":"string","default":"70000","title":"Creditor Account"}},{"name":"consultant","in":"query","required":false,"schema":{"type":"string","default":"0","title":"Consultant"}},{"name":"client","in":"query","required":false,"schema":{"type":"string","default":"0","title":"Client"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}}},"application/xml":{"schema":{"type":"string","format":"binary"}},"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/octet-stream":{"schema":{"type":"string","format":"binary"}}},"description":"The e-invoice: multipart field `file`, or the raw XML/PDF as the body."}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"X-Api-Key"},"Bearer":{"type":"http","scheme":"bearer"}}},"tags":[{"name":"invoice","description":"Parse and validate a received e-invoice."},{"name":"render","description":"Human-readable HTML or A4 PDF from the structured data."},{"name":"export","description":"CSV and DATEV Buchungsstapel for the books."},{"name":"meta","description":"Formats, rule versions, rule explanations, canonical field guide."}],"security":[{"ApiKey":[]},{"Bearer":[]}],"servers":[{"url":"https://invoicein-api.peculiar.systems"}]}