question

greg avatar image
greg asked ·

Get order details, line items and modifications for multiple orders with few REST API calls

I am trying to find the optimal way to fetch let's say 20 orders at the same time. I can call

https://apisandbox.dev.clover.com/v3/merchants/mId/orders?expand=lineItems

but then I am still missing the modifications.

AFAIK one can get the modifications only by calling

https://apisandbox.dev.clover.com/v3/merchants/mId/orders/orderId/line_items?expand=modifications

That would mean I have to make 21 API calls to get the full information for 20 orders (get orderIds by means of the first call). Is there not a more efficient way? I think an additional expand on the first call would be perfect, but it seems this is not supported. The export API is not an option, since it is only available at certain times.

Edit: It would be strange, if getting the total price of 20 orders would require 21 calls!!

REST API
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

Jacob Abrams avatar image
Jacob Abrams answered ·

Looks like our documentation is missing some things... This will get line items with their modifications

v3/merchants/{mId}/orders?expand=lineItems&expand=lineItems.modifications

Just checking, you are using this from a web app and not a Clover android app? Apps running on clover devices should use the clover-android-sdk and not Clover REST endpoints.

When getting orders here is the list of expansions we support:

"employee", "payments", "refunds", "credits", "voids", "payment.tender", "payment.cardTransaction", "lineItems", "customers", "refunds", "serviceCharge", "discounts", "orderType", "lineItems.discounts", "lineItems.modifications"
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.

I am going to ping our doc folks and see if we can get this added.

1 Like 1 · ·

That is exactly what I needed, thanks a lot, Jacob.

0 Likes 0 · ·

Welcome to the
Clover Developer Community