Callum
Callum

Reputation: 1165

Xero testing webhooks on localhost

So I am running a PHP application on localhost and I want to test an incoming web hook. Is there a recommended way to test the local development for this?

Is there an example web hook invoice-paid POST request I could just test with something like postman on my localhost?

Upvotes: 1

Views: 1165

Answers (3)

gaga
gaga

Reputation: 63

You can use ngrok for test webhook in your local machine. Here is an additional detail to @sidney.maestre answer, You only have to use Xero demo company in developer console for once, then you can use the "Replay" button to use exact request every time in ngrok's dashboard.

Upvotes: 0

sidney.maestre
sidney.maestre

Reputation: 186

I wrote a blog post on the topic

https://devblog.xero.com/lets-play-web-hooky-with-php-34a141dcac0a

Upvotes: 2

Tinus Guichelaar
Tinus Guichelaar

Reputation: 541

You can use a tool like ngrok or Pagekite to expose your local server. You download and run a program on your machine and provide it the port of a network service, usually a web server.

It connects to the ngrok cloud service which accepts traffic on a public address and relays that traffic through to the ngrok process running on your machine and then on to the local address you specified.

Upvotes: 3

Related Questions