xero-local
A lightweight local emulator for the Xero Accounting API, designed for development and testing without hitting the real Xero service.
Can be used standalone (Python or Docker) or as a LocalStack extension that starts automatically alongside LocalStack.
Supported endpoints
| Resource | Operations |
|---|---|
Contacts |
list, get, create, update |
Invoices |
list, get, create, update |
Payments |
list, get, create, delete |
CreditNotes |
list, get, create, update |
Connections |
list (Identity API) |
| OAuth2 token | issue (any credentials accepted) |
All data is stored in memory and reset on restart. A POST /_xero/reset endpoint is available to clear state between tests.
Quickstart
Python
pip install localstack-xero
xero-local # starts on http://localhost:5001
Docker
docker run --rm -p 5001:5001 localstack/xero-local
Point your Xero client at http://localhost:5001 instead of https://api.xero.com.
LocalStack extension
localstack extensions install xero
localstack start
The emulator starts automatically with LocalStack and is reachable at http://xero.localhost.localstack.cloud:4566.
Set XERO_PORT (default 5001) or XERO_HOST to change the bind address.
Development
make install-dev # install with test/lint deps
make test # run the test suite (42 tests)
make run # start the emulator locally
make lint # ruff check
make format # ruff format + autofix
Docker
make docker-build # build image for host platform
make docker-run # run on port 5001
make docker-buildx # build and push multi-arch (amd64 + arm64)
Configuration
| Variable | Default | Description |
|---|---|---|
XERO_PORT |
5001 |
Port the emulator listens on |
XERO_HOST |
0.0.0.0 |
Bind address |
CI
Pushes to main and semver tags (v*.*.*) trigger a GitHub Actions workflow that runs the test suite (Python 3.9 and 3.11) and builds and pushes a multi-arch image (linux/amd64, linux/arm64) to Docker Hub. Required secrets: DOCKERHUB_USERNAME, DOCKERHUB_TOKEN.
Release files for localstack-xero 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| localstack_xero-0.1.2.tar.gz | 19.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| localstack_xero-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 32.5 kB
Release files / localstack_xero-0.1.2.tar.gz
| Download URL | localstack_xero-0.1.2.tar.gz |
|---|---|
| Size | 19.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
785effa52c3ad0773d371211cc7903fde2cadfe296a3176f9841152b841e3378
|
|
BLAKE2b-256 checksum How to use checksums |
cb9f4f9bc8caf353d39f377fdc86a3fd53b8bf14eee1b12ba6a6de115531c128
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / localstack_xero-0.1.2-py3-none-any.whl
| Download URL | localstack_xero-0.1.2-py3-none-any.whl |
|---|---|
| Size | 12.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
799f528af0a31ebb64d5803a6e0bb1779ed74231c59de9414f761ecc3b47dcef
|
|
BLAKE2b-256 checksum How to use checksums |
8b0c73216f3fccf7c5c63290086fde33b70a84c8f354b673de625b28fd45b7b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|