{"$schema":"https://json-schema.org/draft/2020-12/schema","title":"Intra-Community B2B Invoice (VAT Directive)","description":"Cross-border EU B2B supply invoice. Goods qualify for the Art. 138 exemption when the acquirer is VAT-registered in another member state and the goods leave the supplier's member state; services usually reverse-charge under Art. 44/196. Invoice must carry the mandatory mentions of Arts. 226 + 226a.","type":"object","required":["supplier","acquirer","invoice","lines","totals"],"additionalProperties":false,"properties":{"supplier":{"$ref":"#/$defs/party"},"acquirer":{"$ref":"#/$defs/party"},"invoice":{"type":"object","required":["number","date","type"],"additionalProperties":false,"properties":{"number":{"type":"string"},"date":{"type":"string","format":"date"},"due_date":{"type":"string","format":"date"},"reference":{"type":"string"},"type":{"type":"string","enum":["goods","services","mixed"],"description":"Drives the applicable exemption / reverse-charge wording."},"transport_ref":{"type":"string","description":"Proof of transport / CMR reference supporting the Art. 138 exemption for goods."}}},"lines":{"type":"array","minItems":1,"items":{"type":"object","required":["description","quantity","unit_price","amount"],"additionalProperties":false,"properties":{"description":{"type":"string"},"quantity":{"type":"number"},"unit_price":{"type":"number"},"amount":{"type":"number"},"line_type":{"type":"string","enum":["goods","services"]}}}},"totals":{"type":"object","required":["net","currency"],"additionalProperties":false,"properties":{"net":{"type":"number"},"vat":{"type":"number","description":"Usually 0 under intra-community exemption / reverse charge."},"gross":{"type":"number"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}}},"payment":{"type":"object","additionalProperties":false,"properties":{"iban":{"type":"string"},"bic":{"type":"string"},"terms":{"type":"string"}}}},"$defs":{"party":{"type":"object","required":["name","address","country_code","vat_id"],"additionalProperties":false,"properties":{"name":{"type":"string"},"address":{"type":"string"},"country_code":{"type":"string","pattern":"^[A-Z]{2}$"},"vat_id":{"type":"string","description":"Acquirer VAT ID must be valid in another EU member state for the Art. 138 exemption to apply."},"contact":{"type":"string"}}}}}