This is application demostrates how to recieve webhooks from Xero.
Application Features
- Accept a POST request from Xero
- Verify payload signature
- Store payload to a queue
- Return correct HTTP status code
- Background worker for asynchronous processing of payload queue
- A private or partner app connected to at least one Xero Organisation, to generate webhook events, if you don't have a xero app you can create one for free at the developer portal
- Ngrok, to tunnel network traffic to localhost
- Clone this repository
- Open solution in a compatible IDE (e.g. Visual Studio Code)
- Update
appsettings.json
with your app webhook key - Build and run solution, note, no front-end changes have been made, so, site will be default MVC home view
- Make server accessible to Xero using ngrok
- Download ngrok using this guide
- Set you app's webhook delivery URL to {negrok_address}/webhooks (e.g. https://daaf38b6.ngrok.io/webhooks) in the developer portal
- Create or modify any contact or invoice in a Xero Organistatino connected to your app and wait for the event to arrive, solution will display info in console
Directory | Description |
---|---|
DTO |
'Data-Transfer-Object', holds classes that model a Xero webhook payload |
Config |
Holds a class that the models webhook settings from appsettings.json |