webhooks with nextjs
Unanswered
Elite posted this in #help-forum
EliteOP
So we’re using the PayPal api for a part of our website, collecting payments. We would like to do certain actions on when invoices on PayPal are paid by the user. Is it possible to have a webhook server working in nextjs 14 api routes? I understand it’s server less, so would I need an actual server to do this?
4 Replies
Burmese
If you want to do certain actions when invoices are paid through PayPal then I would assume you would have to set up a webhook through PayPal. The webhook can simply be a HTTP request to one of your next.js api routes and there you could set up your logic on what you want to do when a user has paid
@Burmese If you want to do certain actions when invoices are paid through PayPal then I would assume you would have to set up a webhook through PayPal. The webhook can simply be a HTTP request to one of your next.js api routes and there you could set up your logic on what you want to do when a user has paid
EliteOP
Alr so I don’t need like a server running. PayPal would just send a post request to my api endpoint and I return certain things based on PayPal’s request?
Wb security and verifying that the request came from PayPal itself? Is that automatic or do I gotta do extra stuff
Burmese
You would have to take of security yourself but luckily there are services that you can use to help you out with that. Here's one of my recommendations to use - https://www.svix.com/