{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://docs.datashift.com.au/edi/contracts/releases/1.0.12/schemas/invoice.schema.json","title":"Invoice (INV) Canonical Schema","description":"Public canonical Invoice contract used to request payment for goods or services supplied against purchase orders and shipments.","version":"1.0.12","type":"object","required":["docType","correlationId","timestamp","metadata","data"],"properties":{"docType":{"const":"INV","x-datashift-managed":true,"x-datashift-system":true,"description":"Canonical document type. For invoices this value is INV.","x-order":1},"correlationId":{"type":"string","format":"uuid","x-datashift-managed":true,"x-datashift-system":true,"description":"Stable UUID used to trace this invoice through order, shipment, and payment workflows.","x-order":2},"timestamp":{"type":"string","format":"date-time","description":"UTC timestamp indicating when DataShift created the canonical invoice.","x-datashift-managed":true,"x-datashift-system":true,"x-order":3},"metadata":{"type":"object","description":"Public source metadata retained for integration troubleshooting.","required":["sourceLanguage","sourceVersion","userAgent"],"properties":{"sourceLanguage":{"type":"string","enum":["json","cxml"],"x-order":1},"sourceVersion":{"const":"1.0.12","description":"Canonical schema version used to create this document","x-order":2},"payloadId":{"type":"string","description":"Original cXML payload ID","x-order":3},"userAgent":{"const":"DataShift Edge v1","description":"DataShift Edge version that generated the canonical document","x-order":4}},"additionalProperties":false,"x-order":4},"data":{"type":"object","required":["invoiceNumber","poNumber","invoiceDate","purpose","supplier","billTo","lineItems","invoiceSummary"],"properties":{"invoiceNumber":{"type":"string","description":"Supplier-generated invoice number.","x-order":1},"poNumber":{"type":"string","description":"Primary purchase order number this invoice bills against.","x-order":2},"invoiceDate":{"type":"string","oneOf":[{"format":"date"},{"format":"date-time"}],"description":"Date and time the supplier issued the invoice.","x-order":3},"dueDate":{"type":"string","oneOf":[{"format":"date"},{"format":"date-time"}],"description":"Payment due date.","x-order":4},"purpose":{"type":"string","enum":["standard","creditMemo","debitMemo","lineLevelCreditMemo","lineLevelDebitMemo"],"default":"standard","description":"Invoice business purpose.","x-enum-descriptions":{"standard":"Standard invoice requesting payment.","creditMemo":"Document reducing a previously invoiced amount.","debitMemo":"Document increasing a previously invoiced amount.","lineLevelCreditMemo":"Line-level credit against a previous invoice.","lineLevelDebitMemo":"Line-level debit against a previous invoice."},"x-order":5},"operation":{"type":"string","enum":["new","update","delete"],"default":"new","description":"Whether this creates, updates, or deletes an invoice","x-order":6},"invoiceOrigin":{"type":"string","enum":["supplier","buyer"],"description":"Whether invoice was originated by supplier or buyer (ERS)","x-order":7},"isInformationOnly":{"type":"boolean","default":false,"description":"If true, invoice is for information only and no action required","x-order":8},"isERS":{"type":"boolean","default":false,"description":"Evaluated Receipt Settlement invoice","x-order":9},"documentReference":{"type":"object","description":"Reference to previous invoice (for credit/debit memos or cancellations)","properties":{"invoiceId":{"type":"string","x-order":1},"invoiceDate":{"type":"string","oneOf":[{"format":"date"},{"format":"date-time"}],"x-order":2},"documentId":{"type":"string","x-order":3},"payloadId":{"type":"string","x-order":4}},"additionalProperties":false,"x-order":10},"poReferences":{"type":"array","description":"Purchase orders being invoiced.","items":{"type":"object","required":["poNumber"],"properties":{"poNumber":{"type":"string","x-order":1},"poVersion":{"type":"string","x-order":2},"documentId":{"type":"string","x-order":3},"payloadId":{"type":"string","x-order":4},"orderDate":{"type":"string","oneOf":[{"format":"date"},{"format":"date-time"}],"x-order":5}},"additionalProperties":false},"x-order":11},"asnReference":{"type":"object","description":"Shipment notice reference when invoicing against a dispatched shipment.","properties":{"shipmentId":{"type":"string","x-order":1},"shipmentDate":{"type":"string","oneOf":[{"format":"date"},{"format":"date-time"}],"x-order":2},"documentId":{"type":"string","x-order":3},"payloadId":{"type":"string","x-order":4}},"additionalProperties":false,"x-order":12},"supplier":{"title":"Party Definition","description":"Supplier or seller issuing the invoice.","type":"object","properties":{"id":{"type":"string","x-order":1},"name":{"type":"string","x-order":2},"taxRegistrations":{"type":"object","description":"Australian tax registrations for the party","required":["type","value"],"properties":{"type":{"type":"string","enum":["ABN"],"x-order":1},"value":{"type":"string","x-order":2}},"additionalProperties":false,"x-order":3},"contact":{"type":"object","properties":{"name":{"type":"string","x-order":1},"phone":{"type":"string","x-order":2},"email":{"type":"string","anyOf":[{"format":"email"},{"const":""}],"x-order":3},"role":{"type":"string","x-order":4}},"additionalProperties":false,"x-order":4},"address":{"title":"Address Definition","description":"Standard address structure for DataShift canonical documents","type":"object","properties":{"addressId":{"type":"string","x-order":1},"addressee":{"type":"string","x-order":2},"street1":{"type":"string","x-order":3},"street2":{"type":"string","x-order":4},"city":{"type":"string","x-order":5},"state":{"type":"string","x-order":6},"postalCode":{"type":"string","x-order":7},"country":{"type":"string","enum":["AU"],"x-order":8}},"required":["street1","city","state","postalCode","country"],"additionalProperties":false,"x-order":5}},"required":["id","name"],"additionalProperties":false,"x-order":13},"billTo":{"title":"Address Definition","description":"Buyer billing party.","type":"object","properties":{"addressId":{"type":"string","x-order":1},"addressee":{"type":"string","x-order":2},"street1":{"type":"string","x-order":3},"street2":{"type":"string","x-order":4},"city":{"type":"string","x-order":5},"state":{"type":"string","x-order":6},"postalCode":{"type":"string","x-order":7},"country":{"type":"string","enum":["AU"],"x-order":8}},"required":["street1","city","state","postalCode","country"],"additionalProperties":false,"x-order":14},"soldTo":{"allOf":[{"title":"Address Definition","description":"Standard address structure for DataShift canonical documents","type":"object","properties":{"addressId":{"type":"string","x-order":1},"addressee":{"type":"string","x-order":2},"street1":{"type":"string","x-order":3},"street2":{"type":"string","x-order":4},"city":{"type":"string","x-order":5},"state":{"type":"string","x-order":6},"postalCode":{"type":"string","x-order":7},"country":{"type":"string","enum":["AU"],"x-order":8}},"required":["street1","city","state","postalCode","country"],"additionalProperties":false}],"description":"Sold-to party (may differ from bill-to)","x-order":15},"shipTo":{"title":"Address Definition","description":"Standard address structure for DataShift canonical documents","type":"object","properties":{"addressId":{"type":"string","x-order":1},"addressee":{"type":"string","x-order":2},"street1":{"type":"string","x-order":3},"street2":{"type":"string","x-order":4},"city":{"type":"string","x-order":5},"state":{"type":"string","x-order":6},"postalCode":{"type":"string","x-order":7},"country":{"type":"string","enum":["AU"],"x-order":8}},"required":["street1","city","state","postalCode","country"],"additionalProperties":false,"x-order":16},"remitTo":{"type":"object","description":"Address where payment should be sent","properties":{"addressId":{"type":"string","x-order":1},"addressee":{"type":"string","x-order":2},"street1":{"type":"string","x-order":3},"street2":{"type":"string","x-order":4},"city":{"type":"string","x-order":5},"state":{"type":"string","x-order":6},"postalCode":{"type":"string","x-order":7},"country":{"type":"string","enum":["AU"],"x-order":8},"bankDetails":{"type":"object","properties":{"bankName":{"type":"string","x-order":1},"accountName":{"type":"string","x-order":2},"accountNumber":{"type":"string","x-order":3},"bsb":{"type":"string","x-order":4},"swift":{"type":"string","x-order":5},"iban":{"type":"string","x-order":6}},"additionalProperties":false,"x-order":9}},"additionalProperties":false,"x-order":17},"shipping":{"type":"object","description":"Commercial freight charges and instructions for the invoice.","properties":{"amount":{"description":"Integer amount in ISO 4217 minor units (e.g. AUD in cents, exponent 2: 561.02 -> 56102). Negative for credits or adjustments.","type":"integer","x-datashift-money":"minor","x-order":1},"currency":{"title":"Currency Enumeration","description":"ISO 4217 currency codes supported by DataShift canonical schemas","type":"string","enum":["AUD"],"x-order":2},"carrier":{"type":"string","x-order":3},"route":{"type":"string","x-order":4},"shippingInstructions":{"type":"string","x-order":5},"buyerAcctNumber":{"type":"string","x-order":6},"incoTerms":{"type":"string","enum":["cfr","cif","cip","cpt","daf","dap","ddp","ddu","dpu","deq","des","exw","fas","fca","fob"],"x-order":7}},"additionalProperties":false,"x-order":18},"shipmentDetails":{"type":"object","description":"Actual dispatch and tracking information for the invoiced goods","properties":{"carrier":{"type":"string","x-order":1},"trackingNumber":{"type":"string","x-order":2},"shippingDate":{"type":"string","oneOf":[{"format":"date"},{"format":"date-time"}],"x-order":3}},"additionalProperties":false,"x-order":19},"paymentTerms":{"type":"object","description":"Payment terms and conditions","properties":{"description":{"type":"string","description":"Human-readable payment terms (e.g., 'Net 30', '2/10 Net 30')","x-order":1},"netDays":{"type":"integer","description":"Number of days until payment is due","x-order":2},"discountTerms":{"type":"array","description":"Early payment discount tiers","items":{"type":"object","properties":{"discountPercent":{"type":"number","multipleOf":0.01,"description":"Discount percentage (e.g., 2 for 2%)","x-order":1},"discountDays":{"type":"integer","description":"Days within which discount applies","x-order":2},"discountDueDate":{"type":"string","format":"date","description":"Specific date by which discount applies","x-order":3}},"additionalProperties":false},"x-order":3}},"additionalProperties":false,"x-order":20},"contacts":{"type":"array","description":"Contact information for various roles","items":{"type":"object","required":["role"],"properties":{"role":{"type":"string","enum":["issuerOfInvoice","soldTo","billTo","remitTo","shipFrom","shipTo"],"x-order":1},"name":{"type":"string","x-order":2},"email":{"type":"string","anyOf":[{"format":"email"},{"const":""}],"x-order":3},"phone":{"type":"string","x-order":4}},"additionalProperties":false},"x-order":21},"comments":{"type":"string","maxLength":2000,"description":"Invoice-level comments or notes","x-order":22},"lineItems":{"type":"array","minItems":1,"items":{"type":"object","required":["invoiceLineNumber","quantity","unitPrice","subtotal","currency"],"properties":{"invoiceLineNumber":{"type":"integer","description":"Supplier's line number for this invoice line.","x-order":1},"uniqueLineKey":{"type":"string","description":"DataShift-managed stable line key from the original purchase order.","x-datashift-managed":true,"x-datashift-system":true,"x-order":2},"poLineReference":{"type":"integer","description":"Line number from the purchase order being invoiced.","x-order":3},"asnLineReference":{"type":"integer","description":"Line number from the ship notice","x-order":4},"supplierItemId":{"type":"string","description":"Supplier's part/item number","x-order":5},"buyerItemId":{"type":"string","description":"Buyer's part/item number","x-order":6},"description":{"type":"string","description":"Item description","x-order":7},"quantity":{"type":"number","multipleOf":0.01,"description":"Quantity invoiced.","x-order":8},"unitOfMeasure":{"title":"REC20 Unit of Measure Codes","description":"UN/ECE Recommendation 20 unit of measure codes for DataShift canonical documents","type":"string","enum":["AY","BG","BL","BR","BLL","E2","BO","BX","BJ","BE","KA","CA","CG","CT","CQ","CS","CMT","CL","CH","MTQ","CY","DAY","DC","DZN","DR","EA","FOT","GRM","HUR","CEN","INH","JR","KGM","KMT","KT","LN","LK","LTR","MTR","TNE","MLT","MMT","MON","PK","PD","PL","PR","D97","C62","PG","LBR","RL","RO","SA","SE","SET","ST","SO","MTK","U3","MIL","TU","WEE"],"x-order":9},"unitPrice":{"description":"Integer unit price at ISO 4217 minor-unit scale + 2 (e.g. AUD, exponent 2 -> 1/10000: 5.2185 -> 52185). Carries sub-minor precision; not rounded to minor units.","type":"integer","x-datashift-money":"rate","x-order":10},"subtotal":{"description":"Line subtotal before tax and adjustments.","type":"integer","x-datashift-money":"minor","x-order":11},"taxAmount":{"description":"Integer amount in ISO 4217 minor units (e.g. AUD in cents, exponent 2: 561.02 -> 56102). Negative for credits or adjustments.","type":"integer","x-datashift-money":"minor","x-order":12},"taxRate":{"type":"number","multipleOf":0.01,"description":"Tax rate as percentage (e.g., 10 for 10%)","x-order":13},"discountAmount":{"description":"Integer amount in ISO 4217 minor units (e.g. AUD in cents, exponent 2: 561.02 -> 56102). Negative for credits or adjustments.","type":"integer","x-datashift-money":"minor","x-order":14},"shippingAmount":{"description":"Integer amount in ISO 4217 minor units (e.g. AUD in cents, exponent 2: 561.02 -> 56102). Negative for credits or adjustments.","type":"integer","x-datashift-money":"minor","x-order":15},"grossAmount":{"description":"Integer amount in ISO 4217 minor units (e.g. AUD in cents, exponent 2: 561.02 -> 56102). Negative for credits or adjustments.","type":"integer","x-datashift-money":"minor","x-order":16},"netAmount":{"description":"Integer amount in ISO 4217 minor units (e.g. AUD in cents, exponent 2: 561.02 -> 56102). Negative for credits or adjustments.","type":"integer","x-datashift-money":"minor","x-order":17},"currency":{"title":"Currency Enumeration","description":"ISO 4217 currency code for this line.","type":"string","enum":["AUD"],"x-order":18},"manufacturerPartId":{"type":"string","description":"Manufacturer's part number","x-order":19},"manufacturerName":{"type":"string","description":"Manufacturer name","x-order":20},"countryOfOrigin":{"type":"string","enum":["AU"],"description":"Country where item was manufactured","x-order":21},"serialNumbers":{"type":"array","items":{"type":"string"},"description":"Serial numbers for serialized items","x-order":22},"batchId":{"type":"string","description":"Lot/batch ID","x-order":23},"classification":{"type":"array","description":"Product classification codes","items":{"type":"object","properties":{"domain":{"type":"string","enum":["UNSPSC","HS","commodity"],"description":"Classification scheme","x-order":1},"code":{"type":"string","x-order":2}},"additionalProperties":false},"x-order":24},"comments":{"type":"string","maxLength":500,"description":"Line-level comments","x-order":25}},"additionalProperties":false},"description":"Invoice lines. DataShift manages uniqueLineKey correlation back to PO and ASN lines where needed.","x-order":23},"invoiceSummary":{"type":"object","required":["taxAmount","dueAmount","currency"],"description":"Invoice totals, tax, discounts, and amount due.","properties":{"shippingAmount":{"description":"Integer amount in ISO 4217 minor units (e.g. AUD in cents, exponent 2: 561.02 -> 56102). Negative for credits or adjustments.","type":"integer","x-datashift-money":"minor","x-order":1},"specialHandlingAmount":{"description":"Integer amount in ISO 4217 minor units (e.g. AUD in cents, exponent 2: 561.02 -> 56102). Negative for credits or adjustments.","type":"integer","x-datashift-money":"minor","x-order":2},"taxAmount":{"description":"Integer amount in ISO 4217 minor units (e.g. AUD in cents, exponent 2: 561.02 -> 56102). Negative for credits or adjustments.","type":"integer","x-datashift-money":"minor","x-order":3},"taxBreakdown":{"type":"array","description":"Tax breakdown by type/jurisdiction","items":{"type":"object","properties":{"taxType":{"type":"string","enum":["GST","VAT","salesTax","excise","other"],"description":"Type of tax","x-order":1},"taxRate":{"type":"number","multipleOf":0.01,"description":"Tax rate as percentage","x-order":2},"taxableAmount":{"description":"Integer amount in ISO 4217 minor units (e.g. AUD in cents, exponent 2: 561.02 -> 56102). Negative for credits or adjustments.","type":"integer","x-datashift-money":"minor","x-order":3},"taxAmount":{"description":"Integer amount in ISO 4217 minor units (e.g. AUD in cents, exponent 2: 561.02 -> 56102). Negative for credits or adjustments.","type":"integer","x-datashift-money":"minor","x-order":4},"jurisdiction":{"type":"string","description":"Tax jurisdiction (e.g., state, country)","x-order":5},"description":{"type":"string","x-order":6}},"additionalProperties":false},"x-order":4},"discountAmount":{"description":"Integer amount in ISO 4217 minor units (e.g. AUD in cents, exponent 2: 561.02 -> 56102). Negative for credits or adjustments.","type":"integer","x-datashift-money":"minor","x-order":5},"grossAmount":{"description":"Integer amount in ISO 4217 minor units (e.g. AUD in cents, exponent 2: 561.02 -> 56102). Negative for credits or adjustments.","type":"integer","x-datashift-money":"minor","x-order":6},"netAmount":{"description":"Integer amount in ISO 4217 minor units (e.g. AUD in cents, exponent 2: 561.02 -> 56102). Negative for credits or adjustments.","type":"integer","x-datashift-money":"minor","x-order":7},"depositAmount":{"description":"Integer amount in ISO 4217 minor units (e.g. AUD in cents, exponent 2: 561.02 -> 56102). Negative for credits or adjustments.","type":"integer","x-datashift-money":"minor","x-order":8},"dueAmount":{"description":"Integer amount in ISO 4217 minor units (e.g. AUD in cents, exponent 2: 561.02 -> 56102). Negative for credits or adjustments.","type":"integer","x-datashift-money":"minor","x-order":9},"currency":{"title":"Currency Enumeration","description":"ISO 4217 currency codes supported by DataShift canonical schemas","type":"string","enum":["AUD"],"x-order":10}},"additionalProperties":false,"x-order":24},"extrinsics":{"type":"object","description":"Partner-specific extension fields that are not part of the canonical core contract.","additionalProperties":{"x-additionalPropertiesName":"extensionField","description":"Partner-specific extension value."},"x-order":25}},"additionalProperties":false,"description":"Business payload for the invoice.","x-order":5}},"additionalProperties":false,"examples":[{"docType":"INV","correlationId":"43e7580b-e592-46bb-a3d0-dbf8997758d9","timestamp":"2026-05-16T04:00:00Z","metadata":{"sourceLanguage":"cxml","sourceVersion":"1.0.12","payloadId":"inv-example-10001","userAgent":"DataShift Edge v1"},"data":{"invoiceNumber":"INV-10001","poNumber":"PO-10001","invoiceDate":"2026-05-16T04:00:00Z","dueDate":"2026-06-15T00:00:00Z","purpose":"standard","poReferences":[{"poNumber":"PO-10001","poVersion":"1"}],"supplier":{"id":"SUPPLIER-AU","name":"Example Supplier Pty Ltd","taxRegistrations":{"type":"ABN","value":"98765432109"},"address":{"addressee":"Example Supplier Pty Ltd","street1":"20 Supplier Street","city":"Adelaide","state":"SA","postalCode":"5000","country":"AU"}},"billTo":{"addressee":"Example Buyer Accounts","street1":"1 Market Street","city":"Sydney","state":"NSW","postalCode":"2000","country":"AU"},"lineItems":[{"invoiceLineNumber":1,"uniqueLineKey":"PO-10001-1","poLineReference":1,"supplierItemId":"SUP-001","buyerItemId":"BUY-001","description":"Example product","quantity":10,"unitOfMeasure":"EA","unitPrice":1500000,"subtotal":150000,"taxAmount":15000,"currency":"AUD"}],"invoiceSummary":{"taxAmount":15000,"grossAmount":165000,"netAmount":165000,"dueAmount":165000,"currency":"AUD"},"extrinsics":{"accountsReference":"AP-10001"}}}]}