{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "#/components/schemas/InvoiceCreate", "title": "InvoiceCreate", "type": "object", "description": "Schema for creating a new invoice", "required": [ "invoice-number", "invoice-date", "supplier", "currency", "invoice-lines" ], "properties": { "invoice-number": { "type": "string", "maxLength": 40 }, "invoice-date": { "type": "string", "format": "date-time" }, "document-type": { "type": "string", "enum": [ "Invoice", "Credit Note" ] }, "supplier": { "$ref": "#/components/schemas/SupplierReference" }, "currency": { "$ref": "#/components/schemas/CurrencyReference" }, "payment-term": { "$ref": "#/components/schemas/PaymentTermReference" }, "bill-to-address": { "$ref": "#/components/schemas/AddressReference" }, "ship-to-address": { "$ref": "#/components/schemas/AddressReference" }, "supplier-remit-to": { "type": "object", "properties": { "id": { "type": "integer" } } }, "invoice-from-address": { "type": "object", "properties": { "id": { "type": "integer" } } }, "tax-amount": { "type": "number", "format": "decimal" }, "discount-amount": { "type": "number", "format": "decimal" }, "shipping-amount": { "type": "number", "format": "decimal" }, "handling-amount": { "type": "number", "format": "decimal" }, "line-level-taxation": { "type": "boolean" }, "tax-code": { "type": "string" }, "tax-rate": { "type": "number", "format": "float" }, "invoice-lines": { "type": "array", "minItems": 1, "items": { "$ref": "#/components/schemas/InvoiceLine" } }, "is-credit-note": { "type": "boolean" }, "original-invoice-number": { "type": "string", "maxLength": 40 }, "original-invoice-date": { "type": "string", "format": "date-time" }, "credit-reason": { "type": "string" } } }