question

foggyfrog avatar image
foggyfrog asked David Marginian Deactivated answered

Calling Inventory giving diffrent type of responses

I have 3 clover POS machines that i acquire over 3 years of time. 2 of them are old and one of POS system i got within last 3 months.


when i call inventory API I'm getting 2 type of response for 3 location.

this is the Response Clover website getting when i check the specific item (i copied this one from browser developer tools)

"elements": [
        {
            "id": "FYS6C43CDZFFT",
            "hidden": false,
            "available": true,
            "autoManage": false,
            "options": {
                "elements": [
                ]
            },
            "name": "3chi Black Raspberry 400mg",
            "alternateName": "",
            "code": "850005759256",
            "sku": "",
            "price": 3999,
            "priceType": "FIXED",
            "defaultTaxRates": true,
            "unitName": "",
            "cost": 0,
            "isRevenue": true,
            "stockCount": 0,
            "taxRates": {
                "elements": [
                    {
                        "id": "NCKDMJ8RJ6QSY",
                        "name": "Sales Tax",
                        "rate": 600000,
                        "isDefault": true
                    }
                ]
            },
            "modifierGroups": {
                "elements": [
                ]
            },
            "categories": {
                "elements": [
                    {
                        "id": "5D0YYX1CX7JT6",
                        "name": "wellness",
                        "sortOrder": 4
                    }
                ]
            },
            "tags": {
                "elements": [
                ]
            },
            "itemStock": {
                "item": {
                    "id": "FYS6C43CDZFFT"
                },
                "stockCount": 1,
                "quantity": 1.0,
                "modifiedTime": 1635377961000
            },
            "modifiedTime": 1635377960000
        }
    ],
    "href": "http://api.clover.com/v3/merchants/HCHW6CEMFT2W1/items?find=name%20LIKE%20%25FYS6C43CDZFFT%25&find=alternateName%20LIKE%20%25FYS6C43CDZFFT%25&find=sku%20LIKE%20%25FYS6C43CDZFFT%25&find=id%20LIKE%20%25FYS6C43CDZFFT%25&find=itemCode%20LIKE%20%25FYS6C43CDZFFT%25&order_by=name&limit=26"
}

but when i call Inventory api using post man i'm getting No response to below link . this giving me 204 error saying no content available. ( I used correct Token )

http://api.clover.com/v3/merchants/HCHW6CEMFT2W1/items?find=name%20LIKE%20%25FYS6C43CDZFFT%25&find=alternateName%20LIKE%20%25FYS6C43CDZFFT%25&find=sku%20LIKE%20%25FYS6C43CDZFFT%25&find=id%20LIKE%20%25FYS6C43CDZFFT%25&find=itemCode%20LIKE%20%25FYS6C43CDZFFT%25&order_by=name&limit=26


Then same item when i call from my API backend I'm getting below response


  elements: [
    {
      id: 'FYS6C43CDZFFT',
      hidden: false,
      available: true,
      autoManage: false,
      name: '3chi Black Raspberry 400mg',
      alternateName: '',
      code: '850005759256',
      sku: '',
      price: 3999,
      priceType: 'FIXED',
      defaultTaxRates: true,
      unitName: '',
      cost: 0,
      isRevenue: true,
      stockCount: 0,
      modifiedTime: 1635377960000
    }
  ],
  href: 'http://api.clover.com/v3/merchants/HCHW6CEMFT2W1/items?find=itemCode%20LIKE%20%25850005759256%25&find=name%20LIKE%20%25850005759256%25&find=alternateName%20LIKE%20%25850005759256%25&find=id%20LIKE%20%25850005759256%25&limit=100'
}

so my question is here i get stock count as 0. but actual stock is 1. why i'm getting different JSON models for each time for same item in same location. and other 2 locations using same call i can get direct stock count.this problem only occurred for new location..!


how can i get all locations inventory in same JSON data model


REST APIInventory
10 |2000

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

David Marginian avatar image
David Marginian Deactivated answered David Marginian Deactivated edited

All of your requests are different, which is why you are getting different responses. You are missing an s in your Postman request, it is https not http. stock count is deprecated, to obtain the item stock see - https://community.clover.com/questions/35707/api-results-for-stockcount-are-not-consistent-with.html

10 |2000

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

foggyfrog avatar image
foggyfrog answered David Marginian Deactivated edited

Please consider below 3 locations. and the link i'm calling and the response.can you please explain me why location 1 response different from other 2 locations ..?

@

Location 1

Link from post man

https://api.clover.com/v3/merchants/HCHW6CEMFT2W1/items?find=itemCode+LIKE%25811960038428%25&expand=%2CitemStock

response

{
    "elements": [
        {
            "id": "921A0FXBFJSC0",
            "hidden": false,
            "available": true,
            "autoManage": true,
            "name": "Effex Hydro HHC Cart Cherry Pie",
            "code": "811960038428",
            "price": 4999,
            "priceType": "FIXED",
            "defaultTaxRates": true,
            "cost": 0,
            "isRevenue": true,
            "modifiedTime": 1638832616000
        },
        {
            "id": "73FSZWQ15RQ3E",
            "hidden": false,
            "available": true,
            "autoManage": false,
            "name": "Effex Hydro HHC Cart Blue Widow",
            "code": "811960038428",
            "price": 4999,
            "priceType": "FIXED",
            "defaultTaxRates": true,
            "cost": 0,
            "isRevenue": true,
            "modifiedTime": 1637366535000
        }
    ],
    "href": "http://api.clover.com/v3/merchants/HCHW6CEMFT2W1/items?find=itemCode%20LIKE%20%25811960038428%25&limit=100"
}

.....................................................................................................................................................

Location 2

Link from post man

https://api.clover.com/v3/merchants/31C96381HKVG1/items?find=itemCode+LIKE%25811960038428%25&expand=%2CitemStock

response

{
    "elements": [
        {
            "id": "B4HPVMT9BPNX2",
            "hidden": false,
            "available": true,
            "autoManage": false,
            "name": "Effex Hydro HHC Cart Cherry Pie",
            "code": "811960038428",
            "sku": "",
            "price": 4999,
            "priceType": "FIXED",
            "defaultTaxRates": false,
            "unitName": "",
            "cost": 0,
            "isRevenue": true,
            "stockCount": 0,
            "itemStock": {
                "item": {
                    "id": "B4HPVMT9BPNX2"
                },
                "stockCount": 0,
                "quantity": 0.0,
                "modifiedTime": 1638143606000
            },
            "modifiedTime": 1638143605000
        },
        {
            "id": "37KHWKH2C74P4",
            "hidden": false,
            "available": true,
            "autoManage": false,
            "name": "Effex Hydro HHC Cart Blue Widow",
            "code": "811960038428",
            "sku": "",
            "price": 4999,
            "priceType": "FIXED",
            "defaultTaxRates": false,
            "unitName": "",
            "cost": 0,
            "isRevenue": true,
            "stockCount": 0,
            "itemStock": {
                "item": {
                    "id": "37KHWKH2C74P4"
                },
                "stockCount": 0,
                "quantity": 0.0,
                "modifiedTime": 1638143606000
            },
            "modifiedTime": 1638143605000
        }
    ],
    "href": "http://api.clover.com/v3/merchants/31C96381HKVG1/items?find=itemCode%20LIKE%20%25811960038428%25&limit=100"
}


.....................................................................................................................................................

Location 3

Link from post man

https://api.clover.com/v3/merchants/K7C4TCHN910B1/items?find=itemCode+LIKE%25811960038428%25&expand=%2CitemStock

response

{
    "elements": [
        {
            "id": "WM3FKWMPBXYT8",
            "hidden": false,
            "available": true,
            "autoManage": false,
            "name": "Effex Hydro HHC Cart Cherry Pie",
            "alternateName": "",
            "code": "811960038428",
            "sku": "",
            "price": 4999,
            "priceType": "FIXED",
            "defaultTaxRates": true,
            "unitName": "",
            "cost": 0,
            "isRevenue": true,
            "stockCount": 9,
            "itemStock": {
                "item": {
                    "id": "WM3FKWMPBXYT8"
                },
                "stockCount": 9,
                "quantity": 9.0,
                "modifiedTime": 1638314459000
            },
            "modifiedTime": 1638314459000,
            "priceWithoutVat": 0
        },
        {
            "id": "SPCRHTGDCYZSM",
            "hidden": false,
            "available": true,
            "autoManage": false,
            "name": "Effex Hydro HHC Cart Blue Widow",
            "alternateName": "",
            "code": "811960038428",
            "sku": "",
            "price": 4999,
            "priceType": "FIXED",
            "defaultTaxRates": true,
            "unitName": "",
            "cost": 0,
            "isRevenue": true,
            "stockCount": 9,
            "itemStock": {
                "item": {
                    "id": "SPCRHTGDCYZSM"
                },
                "stockCount": 9,
                "quantity": 9.0,
                "modifiedTime": 1637335515000
            },
            "modifiedTime": 1637335515000,
            "priceWithoutVat": 0
        }
    ],
    "href": "http://api.clover.com/v3/merchants/K7C4TCHN910B1/items?find=itemCode%20LIKE%20%25811960038428%25&limit=100"
}




1 comment
10 |2000

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

David Marginian avatar image David Marginian ♦♦ commented ·

Is location 1 your old location? I am guessing that inventory item was created before itemStock was introduced and it is simply not being returned because it was never created. Can you tryadjusting that items stock to 1 and the back to 0?

0 Likes 0 ·
foggyfrog avatar image
foggyfrog answered David Marginian Deactivated commented

You mean from excel sheet import and export..?

Setting quantity for 1 then again for zero..? Im

Not clear.and location 1 is one of the newest devices

10 |2000

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

David Marginian avatar image
David Marginian Deactivated answered

I think this is because for the items for the first merchant (921.....SC0 and 73F....Q3E) are set for automatic inventory management (can be done via the dashboard, item details -> item tracking) and the stock count is 0. For the other locations/items all of the returned items are not set for automatic inventory management (note the autoManage: false in the response).

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