Fatch Data between two dates
Hi,
how can we access API end point between two date ranges.
e.g. Sale end point /API/Account/{accountID}/Sale.json gives me all the records of sales but i need to get for today only?
Hi,
how can we access API end point between two date ranges.
e.g. Sale end point /API/Account/{accountID}/Sale.json gives me all the records of sales but i need to get for today only?
4 comments
You can include the timeStamp as a query parameter. Here's an example URL below. In my example I am asking for any sales that aren't archived, are completed, and aren't voided. Between Jan-01-2019 00:00:01 ET and Jan-31-2019 23:59:59 ET.
You can read more about query parameters here --> https://developers.lightspeedhq.com/retail/introduction/parameters/.
Hope this helps!
https://api.merchantos.com/API/Account/{AccountId}/Sale.json?archived=false&voided=false&completed=true&offset=0&limit=100&timeStamp=><,2019-01-01T00:00:01-5:00,2019-01-31T23:59:59-5:00
thank you for your reply.
i have tried the same but unfortunatly did not succeeded. below is the e.g
https://api.lightspeedapp.com/API/Account/{AccountID}/Sale.json&timeStamp=><,2019-01-01T00:00:01-5:00,2019-01-31T23:59:59-5:00
above query showing all the records. not filtering by date.
sorry my mistake. i fixed it :)
need to put ? instead of & before timeStamp
Glad it's working!