Jump to content

Creating module that uses external webhooks


neuhs

Recommended Posts

Hi,

I am creating a module that integrates with an online POS system which uses API and webhooks. Whenever there is an event (e.g.: change in product quantity), the request will be automatically via webhook from the external POS.

But, I am unsure how I can create the Prestashop module that interacts with the external webhook (i.e.: how do I know that a request has been pushed via webhook to perform certain actions on Prestashop)? Anyone have any idea how I can go about doing this?

Thanks in advance! 

Link to comment
Share on other sites

I do not understand it.
What does POS mean?
Do you have a cash register or touch screen?
In the cash register system you have the same products uploaded as in the eshop and the PLU code in the POS system is the same as the SKU of the product in Prestashop?

Please write all the information in more detail.
Please write down your idea in detail with explanatory points.

Edited by Guest (see edit history)
Link to comment
Share on other sites

Okay, the module I created integrates Prestashop with an online POS (Point-of-sale) system. The online POS has a webhook that pushes JSON data whenever the "inventory update" event happens in that online POS. What I would want to do is to update the inventory accordingly for these products that have an update in their inventory.

Initially, I couldn't figure what functions and classes that I have to create within the Prestashop module for the webhook to work.

But, now I figured out that I can create a front controller within my module. So as of now, when the an inventory update happens my function in the front controller will be able to run successfully.

However, I'm stuck with not knowing how to take and process the JSON data that will be sent to the postProcess() function in my front controller.

Any one have an idea on how I can go about doing this?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...