Possible to add a push API on POS when completing sale?

siggisiggi Posts: 1Member
We want to add a button to the POS where the retailer can select a purchase as a tax-free purchase. When the purchase is then completed, 2 things need to happen:
- An API call to a web service is made to save the purchase data
- When printing the receipt, extra information is added. Information that is returned from the web service.

Is this possible using the API. Any pointers would be welcomed.

Answers

  • Adrian SamuelAdrian Samuel Posts: 357Moderator, Lightspeed Staff moderator
    Hey @siggi, you could just embed some Javascript in the print template of the receipt. The script could just check the status of the sale, whether it was complete or incomplete. The only thing would be that your credentials would be stored within the template to authenticate this. Maybe you could add some headers onto your AJAX request but it wouldn't be ideal.

    I would suggest you use our custom buttons feature to embed a URL. https://retail-support.lightspeedhq.com/hc/en-us/articles/229518207-A-detailed-overview-of-custom-menus

    This webhook would receive the SaleID, implement whatever logic it has including a poll to find out the status of a sale. When the sale is moved into the "completed" stage, your Javascript inside the template could dynamically add data there based on the status of some public URL that your app pushed.
Sign In or Register to comment.