How to optimize retrieving data from Lightspeed

fanaticfanatic Member Posts: 3

Hello,


we are accessing to LS to get data from all products. In order to avoid reading all products, how could we only retrieve products starting from a certain date? It would be great to retrieve all products that have been updated since the last time that we requested it.

Is there an optimal way to retrieve updated products?


Thank you

1 comment

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

    Hey @fanatic,

    There certainly is! You can use a date filter:

    GET /API/Account/{accountID}/Item.json?timeStamp=><,{lastRecordedTimeStamp},{currentTimeStamp}

    Where lastRecordedTimeStamp and currentTimeStamp are ISO 8601 formatted dates. Pay attention also to the offset since Lightspeed returns all dates in UTC, you may have to set an offset to query the correct timezone for your shops location.

    You can find out more how to use query parameters here:

    Hope this helps!

    Adrian Samuel

    API Integrations Consultant - Strategic Solutions

    Lightspeed HQ

Sign In or Register to comment.