A complete, production-grade Elixir client for all 13 Xero APIs.

Supported APIs

ModuleAPI
Xero.Accounting.*Accounting API (invoices, contacts, payments, reports, …)
Xero.AssetsFixed asset management
Xero.BankFeedsPush bank statement data
Xero.FilesDocument and attachment management
Xero.FinanceFinancial statements for lending
Xero.ProjectsProject time and cost tracking
Xero.Payroll.AUAustralian payroll
Xero.Payroll.NZNew Zealand payroll
Xero.Payroll.UKUK payroll and HMRC
Xero.PracticeManagerAccounting practice management
Xero.AppStoreSubscription and billing management
Xero.EInvoicingPEPPOL-compliant e-invoicing

Quick Start

# 1. Configure
config :xero,
  client_id: System.fetch_env!("XERO_CLIENT_ID"),
  client_secret: System.fetch_env!("XERO_CLIENT_SECRET"),
  redirect_uri: "https://yourapp.com/oauth/callback",
  scopes: ~w(openid profile email offline_access accounting.transactions accounting.contacts)

# 2. Generate the auth URL
{:ok, url, state} = Xero.Auth.authorize_url()

# 3. Exchange the callback code for tokens
{:ok, tokens} = Xero.Auth.fetch_token(code)

# 4. List connected tenants
{:ok, [tenant | _]} = Xero.Auth.connections(tokens)

# 5. Make API calls
{:ok, result} = Xero.Accounting.Invoices.list(tokens, tenant.tenant_id, page: 1)

Summary

Functions

Returns the library version.

Functions

version()

@spec version() :: String.t()

Returns the library version.