How to track new sale in Lightspeed

renjithmbrenjithmb Member Posts: 16

Is there is way to track new sale in Lightspeed through API. Please advice.

4 comments

  • Adrian SamuelAdrian Samuel Moderator, Lightspeed Staff Posts: 573 moderator

    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

    API Integrations Consultant - Strategic Solutions

    Lightspeed HQ

  • renjithmbrenjithmb Member Posts: 16
  • renjithmbrenjithmb Member Posts: 16

    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

  • Adrian SamuelAdrian Samuel Moderator, Lightspeed Staff Posts: 573 moderator

    Hey @renjithmb,

    What constitutes a valid saleline to you?

    Adrian Samuel

    API Integrations Consultant - Strategic Solutions

    Lightspeed HQ

Sign In or Register to comment.