@officedesk/plugin-xero
v0.0.10
Published
Xero accounting integration plugin for officedesk-ai
Readme
@officedesk/plugin-xero
Xero accounting integration plugin for OfficeDesk AI. Manages contacts, invoices, bills, accounts, bank transactions, and reconciliation via the Xero API.
Installation
npm install -g @officedesk/plugin-xeroSetup
Sign in to Xero via the browser OAuth flow:
officedesk-plugin-xero loginIf you need exact statement-line reconciliation, also capture the browser-authenticated Xero session:
officedesk-plugin-xero browser-loginIf Playwright is installed but Chromium is missing:
npx playwright install chromiumCLI reference
officedesk-plugin-xero <command> [options]login
Authenticate with Xero via the browser OAuth flow.
officedesk-plugin-xero loginbrowser-login
Capture a browser-authenticated Xero session for bank reconciliation.
officedesk-plugin-xero browser-loginget-accounts
officedesk-plugin-xero get-accountsget-contacts / get-contact / create-contact / update-contact
officedesk-plugin-xero get-contacts
officedesk-plugin-xero get-contact --id=CONTACT_ID
officedesk-plugin-xero create-contact --name="Acme Ltd" --email="[email protected]"
officedesk-plugin-xero update-contact --id=CONTACT_ID --name="Acme Pte Ltd"get-tax-rates
officedesk-plugin-xero get-tax-ratesget-branding-themes
officedesk-plugin-xero get-branding-themesdraft-invoice / update-invoice / authorise-invoice / send-invoice / delete-invoice
officedesk-plugin-xero draft-invoice --contact-id=CONTACT_ID --amount=150.00
officedesk-plugin-xero update-invoice --id=INVOICE_ID --amount=200.00
officedesk-plugin-xero authorise-invoice --id=INVOICE_ID
officedesk-plugin-xero send-invoice --id=INVOICE_ID
officedesk-plugin-xero delete-invoice --id=INVOICE_IDlist-invoice-attachments / download-invoice-pdf / download-invoice-attachment
officedesk-plugin-xero list-invoice-attachments --id=INVOICE_ID
officedesk-plugin-xero download-invoice-pdf --id=INVOICE_ID
officedesk-plugin-xero download-invoice-attachment --id=INVOICE_ID --attachment-id=ATTACHMENT_IDdraft-bill / get-bills / update-bill / submit-bill / authorise-bill / pay-bill / void-bill / delete-bill / attach-to-bill
officedesk-plugin-xero get-bills
officedesk-plugin-xero draft-bill --contact-id=CONTACT_ID --amount=500.00
officedesk-plugin-xero authorise-bill --id=BILL_ID
officedesk-plugin-xero pay-bill --id=BILL_ID --account-id=ACCOUNT_ID --date=2026-04-14 --amount=500.00
officedesk-plugin-xero attach-to-bill --id=BILL_ID --file=./invoice.pdfget-bank-statement-lines
Retrieve imported bank statement lines with statementLineId, bankStatementId, and bankAccountId.
officedesk-plugin-xero get-bank-statement-lines --bankAccountId=<BANK_ACCOUNT_ID>Options
| Flag | Description |
|---|---|
| --bankAccountId=ID | (Required) Bank account ID |
| --tenantId=ID | Tenant ID override |
| --status=STATUS | Line status (default: unreconciled) |
| --limit=N | Maximum results (default: 50) |
| --offset=N | Pagination offset (default: 0) |
| --output=PATH | Override the cache output path |
After you capture the browser session once, get-bank-statement-lines reuses the saved Xero auth data and does not launch a browser for each fetch.
reconcile
Reconcile a bank transaction against a specific statement line.
officedesk-plugin-xero reconcile \
--type=SPEND \
--contactId=<CONTACT_ID> \
--accountCode=<ACCOUNT_CODE> \
--taxType=<TAX_TYPE> \
--date=2026-04-14 \
--amount=600.00 \
--description="Director loan repayment" \
--statementLineId=<STATEMENT_LINE_ID> \
--bankAccountId=<BANK_ACCOUNT_ID> \
--bankStatementId=<BANK_STATEMENT_ID>If the saved browser session is missing, the reconcile flow can prompt for browser-login or run it automatically with --auto-login.
Exact reconciliation flow
- Create or identify the bank transaction you want to reconcile.
- Run
get-bank-statement-linesto find the matchingstatementLineIdandbankStatementId. - Run
reconcileagainst that exact line.
Environment variables
| Variable | Description |
|---|---|
| OFFICEDESK_HOME | Base directory for tokens and config (default: ~/.officedesk/) |
License
This project is licensed under a proprietary End User License Agreement (EULA). See the LICENSE file for details.
