question

apacedg avatar image
apacedg asked zgreathouse Deactivated answered

Get Line Items with orders by merchant ID

How do I get all line items along with all orders from a merchant?

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

The API docs says that it is returned as an optional field. How do I specify the API to return all line items along with all orders?

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

zgreathouse avatar image
zgreathouse Deactivated answered
When fetching orders you may notice that lineItems is a hidden field. In order to fetch all Orders with lineItems you must expand the field. In other words: you do not get the lineItems with the order unless you explicitly query for it, as there are many circumstances where you don't necessarily need the lineItems when fetching Orders.

Endpoint to fetch all Orders with lineItems:
GET ' https://apisandbox.dev.clover.com/v3/merchants/mId/orders?expand=lineItems'

See docs below (updated docs):
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