Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webhook VS Rest endpoint? There is a difference?

They have told us about the possibility of using webhook in a project in which a certain system needs to notify when an action occurs. At first we had proposed it as a batch that would consult the existence of data, then the webhook issue seemed acceptable to us.

Now, looking for information about webhooks, I can't find the difference between a lifelong rest API and webhooks. What is the difference between them? The system can call both as soon as the event occurs. What functionality would this additional webhook offer to the system calling the REST endpoint directly with the solution to be executed without further ado? Apart from the fact that the webhook must be public

I understand webhook as a publishing system that can be attacked as a POST, but this is precisely what I understand of a POST-type rest endpoint. I intend to create the webhook as a JAVA project, is there any point to take into account when building it that differentiates it from a normal REST endpoint?

Thanks

All the best

like image 455
Mishel Uchuari Avatar asked Feb 13 '26 23:02

Mishel Uchuari


1 Answers

A webhook is an API endpoint. What makes it unique is that it is an endpoint in the "client" application.

For example, let's say your application uses a payment processing API. It makes GET and POST requests to that payment processor's API. But payments take time to be approved, so you set up a "payment approved" endpoint on your end and register it with the payment processor. Once the payment is approved, the payment processor will POST to your endpoint and your application reacts accordingly. We call this endpoint a webhook.

Here's the documentation for one such payment provider's webhook system: https://stripe.com/docs/webhooks.

like image 163
Luciano Avatar answered Feb 16 '26 13:02

Luciano



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!