question

xtiansimon avatar image
xtiansimon asked parquet76 answered

Clover REST Order API -- Getting a Line Item's accurate Category

Need help constructing the call to the Clover REST API to get (Part 1) accurate and stable line item categories and (Part 2) distribute taxable/non-taxable sales within categories.

Currently we are using the Order API to collect individual orders within a single date, then aggregating this detail we finally determine a daily accounting record (EG. sales, sales tax, payments, tips, etc.)

Part 1

1) The Order API does not provide the appropriate item category for each order's Line Items ("lineItems" > "elements"). (See Code Example 1 below).

1.1) Is there a property in the Orders API – something we may be overlooking—which determines the relevant Category for each Line Item in the Order?

Otherwise, we have to use the Items API to get the Category. It's there, but not ideal, because Item records allow multiple Categories. The Clover GUI says, under Reports > Item Sales, "Items assigned to multiple categories are reported in just one category (the one created first)."

1.2) When a Inventory Item returns multiple categories is the order always maintained? (EG. Ordered List?)

CODE EXAMPLE 1 - Single order from the Orders API

 {
                 
"href": "https://www.clover.com/v3/merchants/XXXXXXXXXX/orders/X87EZTY4P965T",
             "id": "X87EZTY4P965T",
             "currency": "USD",
             "employee": {
                 "id": "N9ZE2YBM5AMT0"
             },
             "total": 302,
             "paymentState": "PAID",
             "title": "134",
             "orderType": {
                 "id": "N79N4721H4JER"
             },
             "taxRemoved": false,
             "isVat": false,
             "state": "locked",
             "manualTransaction": false,
             "groupLineItems": true,
             "testMode": false,
             "payType": "FULL",
             "createdTime": 1709674466000,
             "clientCreatedTime": 1709674465000,
             "modifiedTime": 1709674483000,
             "lineItems": {
                 "elements": [
                     {
                         "id": "3B0GHM10392VM",
                         "orderRef": {
                             "id": "X87EZTY4P965T"
                         },
                         "item": {
                          "id": "TWEVYAAD31Q7A"
                         },
                         "name": "PLAIN CREAM CHEESE",
                         "alternateName": "",
                         "price": 261,
                         "itemCode": "",
                         "printed": false,
                         "createdTime": 1709674466000,
                         "orderClientCreatedTime": 1709674465000,
                         "exchanged": false,
                         "refunded": false,
                         "isRevenue": true,
                         "isOrderFee": false
                     }, 
                     [...]
                 ]
             },
             "payments": { [...]
             },
             "device": { [...]
             }
         },


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

·
parquet76 avatar image
parquet76 answered
10 |2000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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