Hi. Are there any available Webhooks for when a Sale is done in Lightspeed Retail?
There are no webhooks in Lightspeed Retail, however there are alternative approaches that can be taken to accomplish what you are looking for.
Doing a fetch on a regular basis - a scheduled fetch - can be used to regularly pull all new data to ensure that it is synched.
To do this as optimally as possible, I invite you to look into the "Avoid High Offsets when Paginating" section in our Best Practices documentation.
Specifying high offsets when querying the data should be avoided as much as possible, since it will pull all the data and only then filter the data to the high offsets, which is highly inefficient.
To avoid this issue, the best way to query specific data is to store an ID of the lastSaleID that was fetched and query all data that is above that ID. Using this approach only fetches the data that is desired rather than fetching all data and returning a subset of it.
Here's an example call that would do this using the efficient approach:
This call fetches all sales that are greater than the last storedlastSaleID placeholder.
In order for this to be similar to a webhook, this API call must be done as regularly as needed following a schedule.
Let me know if this makes sense and if you have any further questions.
To anyone is interested, I'm working on an application that can solve this problem! It's primarily a reporting platform, but one of the core features is webhooks! If you're interested, check out https://spectraretail.com and sign up for beta access. People who sign up will get the full version for free during the beta period, and a lifetime discount after! Feel free to direct message me if with any questions!