5 things you need to know before you integrate with the Xero API
Expert engineers share their top insights to help you understand Xero’s API, avoid common pitfalls, and optimize your build.
Xero is often one of the first integrations developers take on when building their app’s accounting connections. As one of the most popular accounting platforms on the market, Xero enjoys wide global coverage. This is especially true in Australia, where it’s the package of choice for ~47% of SMBs. In the U.K., where the accounting software market is particularly fragmented, Xero covers a relatively high share of SMBs at 8%.
Even if Xero isn’t your first accounting integration, there are several things that set its API apart from the ones you’ve encountered before. There are some unique attributes you should keep in mind to make the integration process as smooth as possible.
Below, the engineers who put our Xero integration together share five tips and insights they wish they’d known before they started their build.
1. A basic Xero developer account is simple to set up, but you’ll need to jump through some hoops to connect more than 25 companies 🦘
With Xero, your regular user account also serves as your developer account, so it’s easy to get started. All you need to do is sign up for a free Xero account and you’ll get instant access to their demo company data. To create a test app, navigate to ‘My apps’ in the developer portal. There, you can generate a client ID and client secret that you can use for your integration, and you’re ready to move into production.
We highly recommend playing around with Xero’s demo company in their sandbox environment before going live. It works just like any actual company, allowing you to test most of the components you’ll need in production, including authorization flows and accessing/modifying data. Xero offers a detailed guide to their demo company, which introduces you to Xero’s basic features.
From day one of signing up to an account, you can go live in production with up to 25 companies. If you plan to connect more than 25 companies, you’ll need to become a Xero App Partner. This involves a number of extra steps and at least eight certification checkpoints.
Becoming a Xero App Partner not only enables unlimited company connections; it earns your app a published spot in the Xero App Store (more on that below!)
It usually takes a number of weeks to become an approved Xero App Partner. Typically, a call or two is needed with a Xero Partnerships Manager which needs to be scheduled in advance. And if your app deals with financial services like banking, payments, lending, or insurance, you’ll need to contact Xero and establish a financial services partnership before you can apply. Typically, that involves meeting several criteria like maintaining at least three active customer connections within a 30-day period.
Becoming a financial services partner involves a more lengthy contractual process and discussion. Depending on your business model, you may not be eligible at all so it’s definitely worth checking with Xero before you invest resources into the build. This process involves a set of specific technical requirements like the lending write-back. Codat clients benefit from a Postman collection (technical guide) that fully supports you through the process of building out this requirement.
From there, you can fill out an App Partner application form in the Xero Developer Center and submit it to Xero for review. You can find a more detailed overview of the process here.
Codat keeps a full, updated list of the requirements and certification checkpoints Xero requires for App Partner status in our client support center. We’re always happy to walk our clients through the application process.
We also handle a number of technical requirements on our clients’ behalf, like documenting connection management policies and detailed error messaging.
2. Xero features 11 distinct APIs and they can behave differently⚡
Xero offers different APIs for accounting, assets, bank feeds, payroll, and other use cases. In total, they have 11 distinct APIs with over 100 distinct endpoints.
By default, your app will only have access to the Accounting API. If you want to access other APIs and endpoints, you’ll need to secure Xero’s separate pre-approval. For instance, to access Xero’s Finance or Bank Feeds API, you’ll need to sign additional contractual terms and have a conversation with Xero to make your case.
As you expand your product offerings, you may want to integrate with more than one of Xero’s APIs. It’s important to recognize going in that Xero’s APIs can behave differently.
For example, the function of POST and PUT can vary depending on the API in question. Outside of Xero, POST typically means pushing data to a platform. PUT means updating that data. Some of Xero’s APIs reverse these requests (i.e., asking for a PUT call to push data and a POST call to update it), while others don’t. This can be confusing for developers unaccustomed to working exclusively in Xero, and it’s not a fun irregularity to discover in the moment. We recommend reviewing how requests are structured in a particular API before jumping in.
It’s also worth noting that each of Xero’s APIs is updated independently. That means, in addition to building to multiple APIs with varying structures and restrictions, you may need to invest significant time and resources into their maintenance.
Instead of building and maintaining integrations to different APIs with vastly different behaviors, constraints, and demands, consider building just once to a universal API like Codat. That way, you gain standardized access to many data sources simultaneously.
3. Xero’s data structure strays from that of other major accounting platforms 🤔
If you’ve integrated with other systems—like QuickBooks Online or MYOB AccountRight—you’ll notice that elements of Xero’s data model are structured quite differently. For example, in Xero, contacts can be customers or suppliers—and it’s not easy to tell the difference. While working in Xero, you’ll notice that a GET contacts request returns isCustomer and isSupplier, while a POST contacts request doesn’t accommodate these fields. Contacts only become customers or suppliers once an AP or AR transaction (like a bill or invoice) is applied to them, and Xero doesn’t send any webhook updates when they’re adjusted. Most other accounting systems allow you to distinguish between customers and suppliers right off the bat.
4. There are some inconsistencies in Xero’s web UI, API, and docs 💻
Xero’s accounting API is probably one of the most comprehensive, advanced, and well-documented out there. It’s an incredibly rich source of data that has been developed over time and like anything that has been added to over the years, there are a few inconsistencies to be mindful of.
For example, there are some cases where its web UI behaves differently from its API, which in turn may behave differently from what’s written in the documentation. This is not necessarily a bad thing, it can actually be incredibly handy depending on the behavior, but it’s definitely something to look out for. Ultimately, if you’re building this integration in-house, it requires upfront research and business analysis on the part of the development team.
Here’s one thing we noticed during our build: Xero doesn’t provide access to IDs for tracking categories. That means you can’t simply code to fetch category 1234 and copy its properties. Instead, you have to navigate a list of different categories that have to be matched one-to-one by name. Not only is that process incredibly time-consuming, it can impact your code’s performance. That includes making it vulnerable to untold errors, since it’s possible for tracking categories to have duplicate names. This anomaly isn’t represented in Xero’s docs, and you may only learn of it while solving edge cases in production.
Senior Software Engineer, Simon Skrabanek, explains more about this in the video below.
It can be beneficial to partner with an experienced third-party platform like Codat that has already discovered these quirks for you and pre-built solutions into a turnkey integration.
5. A Xero App Store listing comes with additional commercial & technical implications 🔨
As one of the largest accounting packages, Xero carries significant sway. So, featuring on their App Store can be a lucrative channel for customer acquisition, particularly for newly formed start-ups. However, it’s worth bearing in mind that in line with their new App Store Partner Program, Xero is entitled to 15% of all revenue referred via the channel.
As part of listing on the App Store, you’ll also need to build the ‘Sign Up with Xero’ flow so new customers can use their Xero login credentials to register for your app. This will make the sign-up process smoother for customers because they won’t need to re-enter information Xero already knows, but it will add to your development process and could potentially delay your launch if you haven’t factored it into your initial integration plan.
Xero encourages new App Partners to use their Billing API so that Xero can charge new customers on your behalf. This presents an interesting opportunity for new apps to simplify taking payment but can cause complications if you’ve already got a billing mechanism in place. It’s not suitable for all types of apps. Take for instance, a point-of-sale platform or a corporate card provider that makes revenue through transaction fees rather than charging customers a monthly subscription.
How Codat helps
The bottom line? It takes a lot of time, effort, and expertise to build and maintain an accounting integration with Xero—or any other accounting system—in-house. We’ve put together the following charts to give you an idea of the staffing and resources you’d need to build a successful integration to scale:
Building just once to Codat simplifies the process (and reduces the cost) dramatically. All you have to do to connect to Xero is enable the integration in your Codat settings and copy in the client ID and client secret from your Xero account.
From there, Codat takes over. Our universal API:
- Abstracts away the details and complexities of Xero’s data model
- Standardizes accounting data and categories into one intuitive package
- Handles every emerging update and edge case to keep your integration maintained and at peak performance
That’s not just true of Xero. It’s true of every major accounting system your SMB customers use. That means you never have to worry about or deal with the details and differences between accounting platforms, so you can build quickly and at your best.
Want to learn more about integrating with Xero?
Get in touch with Codat to chat with our expert team and get your questions answered.
You can also jump into our docs to review the details of our universal API for small business data—or check out our full guide to building best-in-class accounting integrations for your app.