{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","description":"Country-agnostic statement of account: period activity on the customer's ledger with running balance and aged analysis. Classic credit-management tool, commonly referenced when invoking statutory late-payment interest (Dir. 2011/7/EU for EU callers).","required":["issuer","customer","period","opening_balance","lines","closing_balance","aged_balances","currency"],"additionalProperties":false,"properties":{"issuer":{"type":"object","required":["name","address","contact_email"],"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1},"address":{"type":"string","minLength":1},"vat_id":{"type":"string"},"contact_email":{"type":"string","format":"email"}}},"customer":{"type":"object","required":["name","address"],"additionalProperties":false,"properties":{"name":{"type":"string","minLength":1},"address":{"type":"string","minLength":1},"account_number":{"type":"string"},"vat_id":{"type":"string"}}},"period":{"type":"object","required":["from","to"],"additionalProperties":false,"properties":{"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"}}},"opening_balance":{"type":"number"},"lines":{"type":"array","minItems":1,"items":{"type":"object","required":["date","document_type","reference","amount","balance"],"additionalProperties":false,"properties":{"date":{"type":"string","format":"date"},"document_type":{"type":"string","enum":["invoice","credit_note","payment","adjustment"]},"reference":{"type":"string","minLength":1},"description":{"type":"string"},"amount":{"type":"number","description":"Signed amount: positive increases the customer's balance owed (invoice/adjustment debit), negative decreases it (credit note/payment)."},"balance":{"type":"number","description":"Running balance after this line."}}}},"closing_balance":{"type":"number"},"aged_balances":{"type":"object","required":["current","days_1_30","days_31_60","days_61_90","over_90"],"additionalProperties":false,"properties":{"current":{"type":"number","minimum":0},"days_1_30":{"type":"number","minimum":0},"days_31_60":{"type":"number","minimum":0},"days_61_90":{"type":"number","minimum":0},"over_90":{"type":"number","minimum":0}}},"currency":{"type":"string","description":"ISO 4217 code."},"notes":{"type":"string"},"signatory":{"type":"object","required":["name","role"],"additionalProperties":false,"properties":{"name":{"type":"string"},"role":{"type":"string"},"date":{"type":"string","format":"date"}}}}}