Filtering by Date in Sale API not working

santshkm89santshkm89 Member Posts: 1
edited November 2018 in Development

3 comments

  • Adrian SamuelAdrian Samuel Moderator, Lightspeed Staff Posts: 643 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=&gt;&lt;,2014-09-18T00:00:00,2018-09-19T00:00:00<br>

    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/


    Adrian Samuel

    Software Developer

    Lightspeed HQ

  • agrohsagrohs Member Posts: 6
    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 Moderator, Lightspeed Staff Posts: 643 moderator
    @agrohs you missed the "=" after the timestamp

    so your request should be:

    <p>/Customer.json?timeStamp=&gt;&lt;,2018-12-15T00:00:00-00:00,2018-12-16T00:00:00-00:00</p>

    Adrian Samuel

    Software Developer

    Lightspeed HQ

Sign In or Register to comment.