Four ways to experience the XeroAPI without writing any code

Riley James
4 min readAug 11, 2021

Sometimes there’s a gap between reading the docs and writing your integration. The gap between confirming a use case, verifying the api works as you expect (based on your reading of the docs) and actually writing some code to prove your assumptions correct. You don’t want to (or maybe you can’t) go all the way to downloading & running one the Xero SDKs.

While this may sound strange to a gun slinging, bare metal, “I don’t always push to production, but..” kind of dev, yet at larger enterprises many non-dev’s won’t have all the access required (or permission) to setup dev accounts of this nature. Beyond that, those responsible for scoping the business case for partnership or feasibility of an integration are unlikely to later pick the tools and build it themselves. So the more empowered a non-technical user is to verify what the api does and how it works, the more likely their work will represent reality and enable a dev to turn their vision into reality.

So let’s look at the options!

Xero API Explorer

The Xero API explorer is an awesome way to get started with the API directly in your browser, all you’ll need is a free xero developer account (self sign up via: developer.xero.com)

Xero API Explorer

Xero API explorer is a full http client in the browser, built by the Xero dev team specifically for Xero’s API. You can make API requests to all the Xero Product API’s: Accounting, Payroll, Files, Assets & Projects.

Xero API Explorer Request
Xero API Explorer Responses

Insomnia

Understand HTTP clients, but want to get out of the browser, you’ve got options. Insomnia is the slimmer, open source alternative to postman. My personal preference of the gui http client options (postman has become overkill for shooting off a couple of api requests).

Developer Evangelist Chris Knight has written a great guide on using Insomnia with the Xero API. It’s made super simple with the Insomnia collection that’s been written by the Xero team.

Download insomnia, clone (or download) the insomnia collection repo, import and you’re good to go. Check Chris’s guide for a step by step walkthrough of the whole process.

Prefer a youtube tutorial walkthrough, Chris has you covered there too: https://www.youtube.com/watch?v=H_k8Z8Zq99s

Postman

The most popular http client, that now has every tool in the API toolshed available within it. A little overkill for sending a few http requests to the api. Tho if you’re looking to mock an integration and test if your end to end use cases are going to be supported, Postman has all the tools you’d need.

To help you along your journey, the Xero API team have put together a Postman collection: https://github.com/XeroAPI/xero-postman-oauth2

The read me has all the details you’ll need to get started, but if you’d prefer to see how it’s done step by step, there’s a video walkthrough available.

Sample Apps

Sample apps are fully fledged applications built using Xero’s own SDKs. While they don’t require you to write any code, you will need to be comfortable and familiar with the underlying programming language in order to install & use them.

That said, it’s a great way to experience the API as it’s as close as you’ll get to experiencing what building an integration with the Xero API will look like without writing a single line of code.

In addition, if you are comfortable wrangling a few lines of code, you could get an example use case for your integration running extremely quickly by forking a sample project and customising it for your needs.

PHP

.Net

Java

Node

Ruby

Python

Some languages have multiple sample apps available, for most integrations you’re going to looking for the starter or full app, both of which are built for OAuth 2. You may also want look at Custom Connections, if you’re building an internal integration for your own business.

If you setup the full app (OAuth 2) you’ll be presented with something similar to this:

Xero Sample App Full App for Ruby (rails)

They contain all the authentication features, multiple orgs, refresh, change orgs. And then each endpoint is setup to make requests back and forth.

So to customise it for your own use case, just start setting up some additional endpoints to cover your needs. You’ll be impressed how far you can get with a little copy and paste!

Enjoy!

--

--