question

jeff-davies avatar image
jeff-davies asked ·

Looks like a bug in the Clover API V3 docs

This is related to a question I had a few days ago. If you look at the docs for a merchant's orders for a date range, the URL that is generated by the V3 API docs is incorrect when you specify a date range. Here is a link to the specific method in the docs:

https://www.clover.com/api_docs#resource_orders

Add 2 filter params for the clientCreateDate. Here are valid dates for the start and end of Jan 17th:

Jan 17, 2017 at midnight: 1484640000000
Jan 17, 2017 1 sec before midnight of the next day: 1484726399999

The API generated by the V3 docs is as follows:

https://api.clover.com:443/v3/merchants/{my merchant id}/orders?filter=clientCreatedTime>=1484640000000&filter=clientCreatedTime<=1484726399999

Which is what lead me to originally believe that you used the filter query param multiple times. However, as a dev here corrected me, the filter param is used only once, even with compound filter expressions. The correct version of the URL is:

https://api.clover.com/v3/merchants/{my merchant id}/orders?access_token={redacted}&limit=1000&expand=lineItems&filter=clientCreatedTime%3E=1484640000000&clientCreatedTime%3C=1484726399999

Although, I have issues with that statement also, because when I run the above "correct" query, what I actually get back is all orders since the start date up to the present date, but I'll bug that separately.

Orders
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

sam avatar image
sam answered ·

Your query should look something like this:

You should test on REST client like Postman, as our API Docs will not work with this query at the moment.

https://apisandbox.dev.clover.com/v3/merchants/{mid}/orders?limit=1000&expand=lineItems&filter=clientCreatedTime>= 1484640000000&filter=clientCreatedTime<= 1484726399999

2 comments Share
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Any chance of fixing the docs to reflect the reality of the API? Amending the docs should be pretty quick when compared to implementing a feature or fixing the bug. Thanks Sam!

0 Likes 0 · ·

@Jeff Davies we'll work on improving our docs, we appreciate your help pointing them out.

0 Likes 0 · ·

Welcome to the
Clover Developer Community