question

brokenoval avatar image
brokenoval asked zgreathouse Deactivated answered

Filter API by time doesn't seem to be working correctly

I've noted a couple of previous questions related to this query:
https://community.clover.com/questions/2490/webapi...
and
https://community.clover.com/questions/2913/rest-a...

I'm trying to return orders greater than or equal to (>=) a specific time, but it doesn't seem to be working. Specifically, the equal to part doesn't work:
https://apisandbox.dev.clover.com/v3/merchants/:mId/payments?filter=createdTime>=1548437394000

I know there is an object that exists that looks something like this:
    {
      "id": "XXXXXXXXXX", 
      ...
      ...
      ...
      "createdTime": 1548437394000, 
      "clientCreatedTime": 1548437393000, 
      "modifiedTime": 1548437394000, 
      etc
    }

If I reduce the time by 1 sec and just do a greater than (>) call like this then I DO get my result:
https://apisandbox.dev.clover.com/v3/merchants/:mId/payments?filter=createdTime>=1548437393000

So it seems that putting the equals sign breaks the operation. Do I need to escape or convert the characters to url encoding manually to make this work?

Thanks in advance.
OrdersAPI Token
10 |2000

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

1 Answer

zgreathouse avatar image
zgreathouse Deactivated answered
I have not been able to reproduce this issue. I do know that you don't need to escape or convert the characters to url encoding manually.

I took the time of an existing payment on my test merchant and filtered the request to get back payments with a createdTime greater than or equal to said payment. I always get that payment and all that come after (expected behavior). I tested this on about a dozen different payments to verify.

If you are still experiencing this behavior, could you please send screenshots for verification?
10 |2000

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

Welcome to the
Clover Developer Community