PHP Point Of Sale can interact with other applications via webhooks. Webhook requests are configured in store config. We have web hooks available for many actions such as creating a customer.
Once you configure a URL in store config for a web hook. An http request is sent with all the data that was just created in the POS. Here is an example way to parse the web hook request
<?php
$jsonStr = file_get_contents("php://input");
$json = json_decode($jsonStr);
?>
Comments
7 comments
Are there any plans to add a security token on the web hooks?
It would be nice to have the peace of mind knowing that any updates to our transactions, customers etc. are valid updates and not a potential vulnerability.
I have some ideas on how to harden the security on my own, but an SHA256 hashed body payload matched to a secret unique user key would be nice too :)
No plans as of now, but I will put in feature requests
Is there a web hook for sale edit?
At this time we just have new_sale. I will put this on our roadmap for 17.2
Thank you Chirs! A modified date would also be helpful when editing sales.
I love this idea of web hooks and am slowly trying to figure out how to successfully utilize it with our scheduling program. Is there a decent tutorial out there that you would recommend that will show me how to get this operable? I consider myself a decent hobbyist to low intermediate coder who likes to learn so it would be fantastic if you could lead me in the right direction or were planning on creating a quick tutorial video about how web hooks can be used with PHPPos.
Webhooks are called when an event takes place in the system such as adding a new customer.
data is immediately sent to the url you specify and you can decide what to do with data
Please sign in to leave a comment.