Connecting application billing to Xero
Connecting organisations, invoices and payments to an external accounting system, with recovery jobs for unsynchronised records.
The context
An existing aviation maintenance application needed its billing records represented in Xero. The work crossed authentication, application models, accounting data and background processing.
What I worked on
- Implemented a Xero Custom Connection client using OAuth client credentials, token caching and request error handling.
- Built the service layer mapping organisations, invoice lines and payments to Xero records, with persisted external identifiers.
- Handled GST and account mappings and added bounded Celery jobs to retry unsynchronised records.
- Added database migrations and passed integration configuration through the application and worker containers.
Lessons learned
An integration has to fit the application’s existing lifecycle. This work included both the immediate billing path and a background path for recovering unsuccessful synchronisation attempts.