question

georgi avatar image
georgi asked georgi commented

Get multiple orders details

Is there a way to get all details for an array of orders in a single request? For these 2 order ids: Z7565SHPTC344, Z7565SHPTC344 And this merchant id: NJSN3NEHPQDD0

How should the query be like?

api.clover.com:443/v3/merchants/NJSN3NEHPQDD0/orders?filter=id=Z7565SHPTC344,Z7565SHPTC344&expand=refunds,discounts -> this is not working

Orders
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

Mike M avatar image
Mike M answered georgi commented

Unfortunately, it currently is not possible to do OR queries via the API (get orders with id1 OR id2) . You will need to do 2 separate queries in this case.

That being said, you posted the same order ID twice so that could be an issue, however I'm assuming that's just a typo.

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.

georgi avatar image georgi commented ·

Thanks, Mike! It was a typo. :) And just to clarify: it is not OR, it is AND. I want id1 AND id2. :)

0 Likes 0 ·
Mike M avatar image Mike M commented ·

Sorry, just to clarify what I meant. The API supports AND already; so one possible filter combo could be filter=timestamp>1454306400000&filter=timestamp<1456812000000. Querying for id1 and id2 in this current manner would be the equivalent of trying to find "all orders that have both id1 and id2"

Anyways, for the time being, fetching two different orders will be best done by two separate API /order/{orderId} queries. Unless there is some other identifiable attribute you can filter both orders by of course.

0 Likes 0 ·

Welcome to the
Clover Developer Community