Xero API emulator – LocalStack extension
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file localstack_xero-0.1.1.tar.gz.
File metadata
- Download URL: localstack_xero-0.1.1.tar.gz
- Upload date:
- Size: 20.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6a8635289758cac3bd7c7a385afabf92ec47c432c76f5b84a0e2d1b8a567efc
|
|
| MD5 |
2e991d3e3a396ebb875f6afc73e896c6
|
|
| BLAKE2b-256 |
e46648486fa32aa88c84d491a0dc8e5c5b6ae1aedb243706f4af8ad00edf1875
|
File details
Details for the file localstack_xero-0.1.1-py3-none-any.whl.
File metadata
- Download URL: localstack_xero-0.1.1-py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9cd994aaf30454eca6268f1be2749e251a8f623f4dd3468548c2d9e4ac7ceacf
|
|
| MD5 |
12a78c75ac003a4be22b4624cbeb799e
|
|
| BLAKE2b-256 |
f7071c21e21d65d6f7223fa57da6066f7cc3b9ab93977959e623ad39411212b7
|