apizapierxero-apioauth-1.0a

Zapier - Xero: Custom Integration


Has anyone managed to create a custom integration between Zapier and Xero by using the 'Webhooks by Zapier' option and a private connection on the Xero side?

At the moment Xero uses Oauth-1a to create sessions and I can't figure out how to even approach this.

I know Zapier has a normal integration with Xero, however I am interested in doing something which isn't available in their integration (create manual journals) and for this I need to figure out how to do the connection manually.

Thanks


Solution

  • Have you taken a look at Xero's Private Application Auth documentation? The private key you create becomes your Consumer Key for API calls. Unfortunately, from there, you do need to do a little coding to support Oauth1 in Zapier.

    You have two options:

    1. You could use a serverless function platform like Google Cloud Funtions or AWS Lambda to host your code and use one of Xero's SDKs (like pyxero). You then use a webhook step in Zapier to call the function.
      • This option is the most robust since and avoids Zapier code limits
    2. You can use a Zapier code step to place the call. In order to do this, you will need to create your own Oauth1 header for your call. You can look at the post HERE by Eliot Muir. You'll see on lines 32-34 of his example output the headers that need to be included. He has done the hard work of crafting them so you would just need to pull the relevant code and strategy.
      • This is the most streamlined solution, but you do have to deal with Zapier's lack of 3rd-party packages and a 10-second timeout