Using Xero from a Developer's Perspective

Posted

Experience

Sign-up

Initial signup, have to create a fake company/business before you can access the Demo Company

What is Xero

Business, Accounting, Payroll

Demo Notes


Technical Notes

Rate Limits

See here

There are limits to the number of API calls that your application can make against a particular tenant (organisation, account or practice):

There is also a limit to the number of API calls your app can make per minute across all tenants.

Each API response you receive will include the X-DayLimit-Remaining, X-MinLimit-Remaining and X-AppMinLimit-Remaining headers telling you the number of remaining against each limit.

Exceeding a rate limit will result in an HTTP 429 (too many requests) response. It will include an X-Rate-Limit-Problem header telling you which limit you have reached.

If you have exceed the minute or daily limit you will also receive a Retry-After http header that tells you how many seconds to wait before making another request. Requests are counted against a fixed window which will reset at different times for each tenant. It is important to use the Retry-After header to know when you can start making calls again.

Auth

https://developer.xero.com/documentation/guides/oauth2/overview/

Note: Something about Certification and uncertified limits

  1. Code Flow - free Requires user interaction
  2. PKCE - free Requires user interaction
  3. Custom Connection - AU$10/mo

Code Flow

The standard flow is the most well known OAuth 2.0 flow and typically used by web server applications. It requires your app to securely use and store a client secret.

Not the right auth type, requires a user to consent.
We could store this code and use it globally but the access_token has a 30 minute life, and the refresh_token has a 60 day life

Custom Connection

Xero’s Custom Connections leverage the client_credentials grant type and are designed to make it easier to build bespoke integrations. Custom connections require less technical knowledge to build because Xero provides the authorisation flow. This means they’re also quicker to integrate and are easier to manage over time.

Webhooks

On Payment Entered

Create App

https://developer.xero.com/app/manage

Invoice

XERO allows you to enter in a payment


Technical Integration

Requirements

Payroll

Invoices

More posts

My Thesis Journey

Wrapping up my final years of engineering at UNSW

Posted

SWEC Weekend Away 2022 | Production Notes

Bringing arguably more stuff from my house than from storage

Posted