Adrian SamuelModerator, Lightspeed StaffPosts: 654moderator
Hey @renjithmb, we the best thing would be to run a cron-job to check for new sales every X minute(s). If you persist the data of the count, you can use that to compare new sales.
It would go something like this:
Every 60 Seconds:
Make a request to the Retail API, check the ["@attributes"].count value and store it in a database.
In the next iteration (i.e.) in the next 60 seconds, check to see if the count is greater than the previously stored count value, and then grab the details from the difference.
4 comments
Hey @renjithmb, we the best thing would be to run a cron-job to check for new sales every X minute(s). If you persist the data of the count, you can use that to compare new sales.
It would go something like this:
Every 60 Seconds:
Make a request to the Retail API, check the ["@attributes"].count value and store it in a database.
In the next iteration (i.e.) in the next 60 seconds, check to see if the count is greater than the previously stored count value, and then grab the details from the difference.
Hope this helps!
Adrian Samuel
Software Developer
Lightspeed HQ
Thanks @Adrian Samuel
Hi @Adrian Samuel , How to retrieve each valid saleline one by one. Please advise.
We are having issues of in progress or paused sales line with saleline API
Hey @renjithmb,
What constitutes a valid saleline to you?
Adrian Samuel
Software Developer
Lightspeed HQ