{"$schema":"http://json-schema.org/draft-07/schema#","title":"Invoice","type":"object","additionalProperties":false,"required":["number","issueDate","currency","from","to","items"],"properties":{"number":{"type":"string","maxLength":60},"reference":{"type":"string","maxLength":80,"description":"Purchase order or customer reference"},"issueDate":{"type":"string","format":"date"},"dueDate":{"type":"string","format":"date"},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"ISO 4217 code, e.g. USD, EUR, ILS"},"from":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","maxLength":200},"address":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":6},"email":{"type":"string","maxLength":200},"phone":{"type":"string","maxLength":60},"taxId":{"type":"string","maxLength":60}}},"to":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","maxLength":200},"address":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":6},"email":{"type":"string","maxLength":200},"phone":{"type":"string","maxLength":60},"taxId":{"type":"string","maxLength":60}}},"items":{"type":"array","minItems":1,"maxItems":1000,"items":{"type":"object","required":["description","quantity","unitPrice"],"additionalProperties":false,"properties":{"description":{"type":"string","maxLength":300},"details":{"type":"string","maxLength":500},"quantity":{"type":"number","minimum":0},"unitPrice":{"type":"number"},"taxRate":{"type":"number","minimum":0,"maximum":100,"description":"Overrides the invoice tax rate for this line"}}}},"taxRate":{"type":"number","minimum":0,"maximum":100,"default":0},"discount":{"type":"number","minimum":0,"default":0,"description":"Absolute amount off the subtotal"},"notes":{"type":"string","maxLength":2000},"paymentDetails":{"type":"array","items":{"type":"object","required":["label","value"],"properties":{"label":{"type":"string"},"value":{"type":"string"}}},"maxItems":8},"status":{"type":"string","enum":["draft","sent","paid","overdue"]}}}