Xero integration¶
Fiscalize Xero invoices and credit notes automatically and write the result back to Xero.
Setup¶
- Connect with Xero in the Tax-Bridge console (OAuth2). Only encrypted tokens are stored; they refresh automatically.
- Subscribe to both webhooks in the Xero Developer Portal app: Invoices and Credit Notes. Credit notes have their own event category — without this second subscription, refunds are never fiscalized.
- Map tax codes — match each Xero tax rate to its VSMS label (e.g.
D= 15%). - Map your shop — pick the Tax-Bridge shop whose certificate signs these invoices.
Flow¶
- A Xero invoice is authorised → Xero fires an
Invoicewebhook. A credit note being authorised fires a separateCredit Notewebhook. - Tax-Bridge fetches the document, line items, contact and payments and maps them to the canonical invoice.
- The document is fiscalized via the V-SDC —
SALEfor an invoice,REFUNDfor a credit note. A credit note is only fiscalized once the sale invoice it credits has itself been fiscalized (that's where the refund's reference number comes from). - The verification URL and SDC invoice number are written back to the Xero invoice as a history note. (Credit notes have no history-note endpoint in Xero's API, so only invoices get this write-back.)
Note
The Xero app carries its own Xero App Store certification, separate from tax-authority accreditation.
The complete, step-by-step procedure — connecting, webhook subscriptions, tax
and shop mapping, and troubleshooting — is the Xero Setup Guide
(docs/xero-setup-guide.md).