DataContractGate

Cloud Free needs no credit card

Sign inSign up
← Catalog
Accounting

Xero — data contract (compatible with Xero’s documented schema; not affiliated with Xero)

Xero Invoice — core fields from the Accounting API Invoices endpoint. Compatible with Xero's documented Invoice object; not affiliated with Xero. Date and DueDate match the raw JSON API (/Date(milliseconds+offset)/), not YYYY-MM-DD.

Validate a client's Xero export at ingest into your warehouse, or with POST /egress before sending the same shape to a partner, reverse ETL, or an AI agent.

Download YAML

Also available: ODCS v3.1.0 YAML. “Use this contract” forks it into your org, then opens the validation playground so you can upload the client file.

Fields

NameTypeRequiredRuleDescription
InvoiceIDstringoptionalpattern /^[0-9a-fA-F-]{36}$/—
InvoiceNumberstringoptional——
Typestringrequiredone of: ACCREC, ACCPAYInvoice type: ACCREC (accounts receivable / sales) or ACCPAY (accounts payable / bills).
Contactobjectrequired—The contact the invoice is issued to or from.
Datestringoptionalpattern /^/Date\(-?[0-9]+([+-][0-9]{4})?\)/$/Invoice date as the Accounting API returns it: /Date(milliseconds+offset)/, for example /Date(1768003200000+0000)/ for 2026-01-10 UTC. This is not a YYYY-MM-DD string. The API does not emit ISO dates in this field.
DueDatestringoptionalpattern /^/Date\(-?[0-9]+([+-][0-9]{4})?\)/$/Due date in the same /Date(milliseconds+offset)/ form as Date. Not YYYY-MM-DD.
Statusstringoptionalone of: DRAFT, SUBMITTED, AUTHORISED, PAID, VOIDED, DELETEDInvoice status in Xero.
LineAmountTypesstringoptionalone of: Exclusive, Inclusive, NoTax—
CurrencyCodestringoptionalpattern /^[A-Z]{3}$/—
SubTotalnumberoptional≥ 0—
TotalTaxnumberoptional≥ 0—
Totalnumberoptional≥ 0—
AmountDuenumberoptional≥ 0—
AmountPaidnumberoptional≥ 0—

Sample rows

Three synthetic rows we wrote. They validate against this contract with zero violations. No real customer data.

[
  {
    "AmountDue": 1080,
    "AmountPaid": 0,
    "Contact": {
      "ContactID": "00000000-0000-4000-8000-0000000000c1",
      "Name": "Example Client Co"
    },
    "CurrencyCode": "USD",
    "Date": "/Date(1768003200000+0000)/",
    "DueDate": "/Date(1770595200000+0000)/",
    "InvoiceID": "00000000-0000-4000-8000-000000000001",
    "InvoiceNumber": "INV-1001",
    "LineAmountTypes": "Exclusive",
    "Status": "AUTHORISED",
    "SubTotal": 1000,
    "Total": 1080,
    "TotalTax": 80,
    "Type": "ACCREC"
  },
  {
    "AmountDue": 0,
    "AmountPaid": 486,
    "Contact": {
      "Name": "Acme Test LLC"
    },
    "CurrencyCode": "USD",
    "Date": "/Date(1768176000000+0000)/",
    "DueDate": "/Date(1769385600000+0000)/",
    "InvoiceID": "00000000-0000-4000-8000-000000000002",
    "InvoiceNumber": "INV-1002",
    "Status": "PAID",
    "SubTotal": 450,
    "Total": 486,
    "TotalTax": 36,
    "Type": "ACCREC"
  },
  {
    "AmountDue": 220,
    "Contact": {
      "Name": "Sample Supplier Ltd"
    },
    "CurrencyCode": "GBP",
    "Date": "/Date(1768435200000+0000)/",
    "InvoiceNumber": "BILL-5001",
    "Status": "SUBMITTED",
    "Total": 220,
    "Type": "ACCPAY"
  }
]

Provenance

Checked
2026-11-06
Version
v1.0
Author
DataContractGate
License
MIT

Spotted a mismatch with the vendor’s current schema? Report an issue.

Stripe, Shopify, QuickBooks, Xero, HubSpot, Salesforce, Google Analytics and Square are trademarks of their respective owners. DataContractGate is not affiliated with or endorsed by them. These contracts describe data shaped like these vendors’ documented schemas; they are not official and are not certified by any vendor.