💬 RevOps Discussions


XERO Webhook Workflow Examples?

Hi all,


for purpose of data integrity, I would like to be able to create the following workflow:



Deal stage becomes closed won.



webhook and initialize a XERO Invoice, then immediately send back the XERO Invoice_ID and **add** it into a HubSpot multiline field.

It will also send back a repeating Invoice_ID into HubSpot as a separate field for subscriptions and **add** it into a HubSpot multiline field.


A second workflow will always run and will trigger when either:

XERO Invoice_ID, or repeating Invoice_ID is added or updated on any deal by only a workflow.

Then a webhook would find that Invoice_ID in XERO and push the associated HubSpot Deal_ID into the notes field of the invoice. 


I have extensive javascript experience but I've never worked with APIs. 


Where would I begin here? 

1 Reply 1
HubSpot Employee
HubSpot Employee

XERO Webhook Workflow Examples?

At a basic level you would create a custom code workflow action in your workflow to interface with the XERO API and create an invoice. You may have to first also grab some data from HubSpot to send to XERO. Some might be avaialable in the workflow, but some you might have to interfafce with HubSpot's API. I would assume the response to that creation would be the ID of the invoice.


You probably don't need a second workflow. As a second action in the first workflow, you could do your other step which is to add the deal data to the notes. You could even do it in a single action, but I'd do it in two different actions so it's easier to test.


When you define an action, you can configure which properties from the deal should be available in the workflow and how you want them named. You can also configure "secrets" which would be your XERO API keys so they aren't visible in the action code. Lastly you can configure data you want returned out of the action using the callback in case you want to use that data in other actions.


Example you might want to return out the invoice ID so then you can use the set property action to set a deal property to the value of that invoice ID.


Hopefully that is enough to get your started.