Skip to content

JRising-Xero/Xero-NetStandard-Webhooks-Receiver

 
 

Repository files navigation

Xero Webhook Reciever - NetStandard

This is application demostrates how to recieve webhooks from Xero.

Application Features

  1. Accept a POST request from Xero
  2. Verify payload signature
  3. Store payload to a queue
  4. Return correct HTTP status code
  5. Background worker for asynchronous processing of payload queue

Running Application

Prerequisites

  • 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

From Source

  1. Clone this repository
  2. Open solution in a compatible IDE (e.g. Visual Studio Code)
  3. Update appsettings.json with your app webhook key
  4. Build and run solution, note, no front-end changes have been made, so, site will be default MVC home view
  5. Make server accessible to Xero using ngrok

Making your server accessible from Xero (Ngrok)

  1. Download ngrok using this guide
  2. Set you app's webhook delivery URL to {negrok_address}/webhooks (e.g. https://daaf38b6.ngrok.io/webhooks) in the developer portal
  3. 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

Solution Structure

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 92.5%
  • HTML 6.3%
  • Other 1.2%