Through Pathfix Automation, you can enable user webhook listening for all your user that have connected their Xero account via Pathfix OAuth.
The following documentation will guide you on how you can setup your Xero account and setup Xero Webhook listening for all your connected users.
Before proceeding, make sure you have setup your Xero integration in Pathfix OAuth and have added the Connect button for your users to be able to connect their Xero accounts.
- Configure your Xero integration in Pathfix OAuth
- Add the script tag in your application to allow your users to authenticate their Xero accounts (Detailed documentation for Pathfix OAuth can be found here)
- Create a blank automation by clicking on Design and selecting New Design
- Give your first task a name to save the automation (autosave)
- Click on the Test and Publish tab and click on Test to run a test on the automation
- On successful completion, click on Publish to Live
- Click on Endpoints and copy the endpoint url for use in the Webhook setup
- Live Endpoint is for Live environments and Dev endpoint is for testing/development
- Click on Webhooks from the top navigation and click on Create New
- Select Xero from the list of provider webhooks
- Paste the endpoint URL copied from the automation into the Callback URL section
- Generate and paste the Webhooks Key received from Xero developer
- Click on the Pathfix OAuth tab and enter your Pathfix OAuth Public Key and Private Key
- Generate your Webhook URI by clicking on the Webhook URI section. Copy the generated URI for use in Xero later
- Click on Save and save the settings
- On the Webhooks page, click on Activate against Xero to activate your webhook
- The webhook activation will take a few minutes and will happen in the background (click on Refresh on the top navigation to refresh the page)
- Once activated, the webhook status will turn Green
In order to complete your Xero Webhook setup, you will need to add the Callback URL generated by the Pathfix Automation webhook.
- Login to your Xero Developer account, select your app name and click on Webhooks
- Under Delivery URL enter the Webhook URL that was generated in the Pathfix Automation Webhook window
- Click on Send Intent to Receive button and copy the Webhooks Key generated
- Paste the Webhooks Keys in Pathfix Automation Webhook for Xero
- If the Intent status returns an error, make sure you have activated the Webhook in Pathfix Automation, come back here and click on Send Intent to Receive button once again
We recommend running a test on your webhook setup to make sure the setup is right. To do this:
- Go to your Pathfix OAuth account and click on Test Connection for Xero
- Click on Connect/Re-Connect and connect a Xero account
- On successful connection, the Automation will start listening for changes in Xero for the connected user
- You will see the webhook user count increase (if it doesnt increase at first, click on Refresh on the top navigation)
- Go to your Xero app and create a test entry
- Go to your Pathfix Automation account and click on Monitor
- You should see the test event created would have triggered a webhook call
Your Test is successful.
Now that your webhook has been setup successfully, you will need to copy the payload sent by Xero and captured by Pathfix Automation and create your Automation.
Here are the few initial steps to get you going:
- Copy the Request received from our test event
- Go to the Automation created and paste the Request into the Call data (JSON) section of the first task
- From here, you can call an API, run a condition or process the data as you please through the Automation
Few points to note on the JSON:
- The pathfix_user_id is the same user Id that is sent via the Pathfix OAuth system. This generally is the Current Users Unique Id
- the data section of the JSON is the exact data that is sent by Google
Need help? Reach out to our support via email@example.com or live chat through your Pathfix dashboard