Filtering by Date in Sale API not working

santshkm89santshkm89 Posts: 1Member
edited November 2018 in Development

3 comments

  • Adrian SamuelAdrian Samuel Posts: 322Moderator, Lightspeed Staff moderator
    hey @santshkm89 this timeStamp isn't in a valid format, it needs to follow the ISO 8601 standard. Plus, the completeTime hour and second value isn't provided so won't return any results. So try something like this:


    https://api.lightspeedapp.com/API/Account/{{AccountID}}/Sale.json?completeTime=><,2014-09-18T00:00:00,2018-09-19T00:00:00

    This will search between all sales completed between September 18th and September the 19th. 

    As we use UTC time, feel free to add an offset. You can read more about this in our documentation here: https://developers.lightspeedhq.com/retail/introduction/parameters/


  • agrohsagrohs Posts: 6Member
    I am trying to make a similar call to:

    /Customer.json?timeStamp><,2018-12-15T00:00:00-00:00,2018-12-16T00:00:00-00:00

    but it does not seem to respect the between operator and is returning all results. I can successfully run a greater than call to:

    /Customer.json?timeStamp=>,2018-12-15T00:00:00-00:00

    which seems to limit results properly. Any idea what's wrong?

  • Adrian SamuelAdrian Samuel Posts: 322Moderator, Lightspeed Staff moderator
    @agrohs you missed the "=" after the timestamp

    so your request should be:

    /Customer.json?timeStamp=><,2018-12-15T00:00:00-00:00,2018-12-16T00:00:00-00:00
Sign In or Register to comment.