{"$id":"https://freeinvoices.app/invoice-schema.json","$schema":"https://json-schema.org/draft/2020-12/schema","title":"FreeInvoices document","description":"A business document (invoice, receipt, quote, proforma invoice, credit note or purchase order) to open pre-filled in the FreeInvoices editor. All fields are optional except items.","type":"object","additionalProperties":false,"required":["items"],"properties":{"type":{"type":"string","enum":["invoice","receipt","quote","proforma","credit-note","purchase-order"],"default":"invoice","description":"Document type."},"title":{"type":"string","maxLength":120,"description":"Heading printed on the document, e.g. 'Estimate'. Defaults to the type's name."},"number":{"type":"string","maxLength":120,"description":"Document number, e.g. INV-0042."},"date":{"type":"string","format":"date","description":"Issue date (payment date for receipts), YYYY-MM-DD. Defaults to today."},"dueDate":{"type":"string","format":"date","description":"Due date (invoice), valid-until date (quote, proforma) or delivery date (purchase order), YYYY-MM-DD."},"paymentTerms":{"type":"string","maxLength":120,"description":"e.g. 'Net 30' or 'Due on receipt'. Invoices and purchase orders only. The due date is derived from it when dueDate is omitted."},"reference":{"type":"string","maxLength":120,"description":"PO number (invoice), invoice number (receipt), project (quote), Incoterms (proforma), original invoice (credit note) or requisitioner (purchase order)."},"paymentMethod":{"type":"string","maxLength":120,"description":"Receipts only, e.g. 'Bank transfer'."},"from":{"type":"string","maxLength":2000,"description":"Sender's name and address, one item per line."},"billTo":{"type":"string","maxLength":2000,"description":"Recipient's name and address, one item per line."},"shipTo":{"type":"string","maxLength":2000,"description":"Delivery address, if different."},"currency":{"type":"string","enum":["USD","EUR","GBP","CAD","AUD","NZD","INR","JPY","CNY","HKD","SGD","CHF","SEK","NOK","DKK","PLN","CZK","HUF","RON","BGN","TRY","UAH","ILS","AED","SAR","QAR","EGP","ZAR","NGN","KES","GHS","MAD","BRL","MXN","ARS","CLP","COP","PEN","KRW","TWD","THB","MYR","IDR","PHP","VND","PKR","BDT","LKR"],"default":"USD","description":"ISO 4217 currency code."},"items":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["description","rate"],"properties":{"description":{"type":"string","maxLength":2000},"quantity":{"type":"number","default":1},"rate":{"type":"number","description":"Unit price in the document currency."}}}},"taxRate":{"type":"number","minimum":0,"maximum":100,"description":"Tax percentage applied after discount, e.g. 20 for 20%."},"taxLabel":{"type":"string","maxLength":30,"description":"e.g. 'VAT', 'GST', 'Sales tax'. Defaults to 'Tax'."},"discountPercent":{"type":"number","minimum":0,"maximum":100,"description":"Percentage discount on the subtotal. Use this or discountAmount."},"discountAmount":{"type":"number","minimum":0,"description":"Flat discount on the subtotal."},"shipping":{"type":"number","minimum":0},"amountPaid":{"type":"number","minimum":0,"description":"Invoices only: amount already paid; the balance due is total minus this."},"notes":{"type":"string","maxLength":2000,"description":"Payment instructions or a thank-you note."},"terms":{"type":"string","maxLength":2000,"description":"Terms and conditions."}}}