question

rmgas avatar image
rmgas asked rmgas commented

REST API filter orders on createTime

I'm trying to pull orders between two createTime(s) so my logic is filtering on createTime >= (TIME AS LONG) and createTime <= (TIME AS LONG).

So far, I'm finding it'll let me filter on one or the other but not both so I can pull orders with a createTime > TIME OR createTime < TIME.

Has anyone else ran across this and if so, how'd you get around it?

Thanks in advance!

10 |2000

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

Jeffrey Blattman avatar image
Jeffrey Blattman answered rmgas commented

No, you can't do an OR. This page describes what's possible: https://docs.clover.com/build/web-api...

In short, you can provide multiple conditions, but they are ANDed together (only).

2 comments
10 |2000

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

rmgas avatar image rmgas commented ·

I wasn't ever attempting to do an OR. My goal is to pull orders where createTime >= CUSTOMTIME AND createTime <= CUSTOMTIME2

/orders?filter=createdTime<=2000000000000&filter=createdTime>=1000000000000

Is this syntax not correct? Ignore the values I'm comparing against.

0 Likes 0 ·
rmgas avatar image rmgas commented ·

Appears to be working fine now. Thanks so much!

0 Likes 0 ·
Mark Mullan avatar image
Mark Mullan Deactivated answered

Hi rmgas,

Your syntax looks correct. Have you tried making this request from a REST API client like Postman, or are you just using our API docs reference?

I made identical requests in Postman and our Docs, but only Postman returned back the proper response. It looks like this issue could be on our end. Thanks for reaching out, and I'll have our dev team look into this.

Best,

Mark

10 |2000

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

rmgas avatar image
rmgas answered

I didn't find a solution, was apparently a bug.

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