question

tg avatar image
tg asked sam Deactivated answered

How do you get a list of orders that have exchanged line items?

I am not seeing a clear way to query the API to get a list of orders that have exchanged line items, is this possible?

Alternatively is there a way to get a list of exchanged line items?

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

sam avatar image
sam Deactivated answered

Use the below to get all orders with expanded lineitems to find the lineItems that have "exchanged": true and filter out all the corresponding orders.

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

...     
"lineItems": {
            "elements": [
              {
                "id": "SPTE5T1K030F0",
                "orderRef": {
                  "id": "4K92N359V32V6"
                },
                "item": {
                  "id": "WPNTPSH8TANW4"
                },
                "name": "ball",
                "price": 3757,
                "printed": false,
                "exchangedLineItem": {
                  "id": "4F15YYTNRD4HP"
                },
                "createdTime": 1478106021000,
                "orderClientCreatedTime": 1478106021000,
           --> "exchanged": true,
                "refunded": false,
                "isRevenue": true
              },
...
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