Why two Item Shops for Each Product?

darryl_ssdarryl_ss Member Posts: 63

Hi,

How come there are there 2x "ItemShops" for each product all with different ID's, surely there should be one item shop with 1 ID for all products, per shop? (We have one shop, 1 account)

This surely makes it unnecessarily difficult to update each product?

I don't understand this sorry.

Tags:

14 comments

  • Adrian SamuelAdrian Samuel Moderator, Lightspeed Staff Posts: 609 moderator

    Hey @Darryl,

    One ItemShop object is shopID 0 which contains the aggregate of all quantities across all the shops. You don't use this when updating a product

    Adrian Samuel

    Integrations & Solutions Developer - Strategic Solutions

    Lightspeed HQ

  • darryl_ssdarryl_ss Member Posts: 63
    edited June 18

    @Adrian Samuel,

    I get you , thanks Adrian!

    Post edited by darryl_ss on
  • darryl_ssdarryl_ss Member Posts: 63
    edited June 24

    @Adrian Samuel Could you please provide further explanation?

    I am trying to update stock quantities today and get this response:

    {
      "httpCode": "400",
      "httpMessage": "Bad Request",
      "message": "Item not Update. The ItemShop record with shopID 0 cannot have its qoh field changed.",
      "errorClass": "Exception"
    }
    

    Using the request body:

    { "ItemShops": { "ItemShop": [{ "itemShopID": 0, "qoh": 39 }]}}
    

    How do you mass update stock quantities?

  • gregaricangregarican Member Posts: 469 

    I'd assume that if you update on-hands for the "real" shops then this would automatically update ItemShopID 0, which is a calculated sum of things?

  • darryl_ssdarryl_ss Member Posts: 63

    Hi @gregarican

    There is only 1x physical shop, so I'm not really getting why each item has 2x shops, which all have unique ID's across 5000 products, that's 10,000 unique ID's.

    Maybe it's because this is my first real project, but I would expect to see 1x Shop ID across all items as there is only 1x shop.

    If anybody could explain that, I'd be grateful.

    I have figured how to update my stock quantities.

  • gregaricangregarican Member Posts: 469 

    Please read four posts up from your most recent one in this thread...you basically ignore Shop 0 unless you are looking for sum on-hands for that one item across all shops (if you had more than a single shop).

  • darryl_ssdarryl_ss Member Posts: 63

    Hi,

    I was simply trying to understand why 1x physical shop would have 10,000 unique shop ID's on their products, indicating that there are 10,000 shops?

    I was questioning this as I wanted to ensure that there has not been an issue created on import of my products.

    Thanks


    My ItemShops do not show an ItemShop 0.

    "ItemShops": {
          "ItemShop": [
            {
              "itemShopID": "197",
              "qoh": "0",
              "sellable": "0",
              "backorder": "0",
              "componentQoh": "0",
              "componentBackorder": "0",
              "reorderPoint": "0",
              "reorderLevel": "0",
              "timeStamp": "2020-06-19T13:33:22+00:00",
              "itemID": "66",
              "shopID": "1",
              "m": {
                "layaways": "0",
                "specialorders": "0",
                "workorders": "0"
              }
            },
            {
              "itemShopID": "196",
              "qoh": "0",
              "sellable": "0",
              "backorder": "0",
              "componentQoh": "0",
              "componentBackorder": "0",
              "reorderPoint": "0",
              "reorderLevel": "0",
              "timeStamp": "2020-03-24T13:43:13+00:00",
              "itemID": "66",
              "shopID": "0",
              "m": {
                "layaways": "0",
                "specialorders": "0",
                "workorders": "0"
              }
            }
          ]
        },
    
  • darryl_ssdarryl_ss Member Posts: 63

    Hi @gregarican

    There is only 1x physical shop, so I'm not really getting why each item has 2x ItemShops, which all have unique itemShopID's across 5000 products, that's 10,000 unique ID's.

    Maybe it's because this is my first real project, but I would expect to see 1x Shop ID across all items as there is only 1x shop.

    If anybody could explain that, I'd be grateful.

    I have figured how to update my stock quantities now.

    "ItemShops": {
          "ItemShop": [
            {
              "itemShopID": "197",
              "qoh": "0",
              "sellable": "0",
              "backorder": "0",
              "componentQoh": "0",
              "componentBackorder": "0",
              "reorderPoint": "0",
              "reorderLevel": "0",
              "timeStamp": "2020-06-19T13:33:22+00:00",
              "itemID": "66",
              "shopID": "1",
              "m": {
                "layaways": "0",
                "specialorders": "0",
                "workorders": "0"
              }
            },
            {
              "itemShopID": "196",
              "qoh": "0",
              "sellable": "0",
              "backorder": "0",
              "componentQoh": "0",
              "componentBackorder": "0",
              "reorderPoint": "0",
              "reorderLevel": "0",
              "timeStamp": "2020-03-24T13:43:13+00:00",
              "itemID": "66",
              "shopID": "0",
              "m": {
                "layaways": "0",
                "specialorders": "0",
                "workorders": "0"
              }
            }
          ]
        },
    


  • darryl_ssdarryl_ss Member Posts: 63

    Hi @gregarican

    There is only 1x physical shop, so I'm not really getting why each item has 2x shops, which all have unique ID's across 5000 products, that's 10,000 unique ID's.

    Maybe it's because this is my first real project, but I would expect to see 1x Shop ID across all items as there is only 1x shop.

    If anybody could explain that, I'd be grateful.

    I have figured how to update my stock quantities now.

    "ItemShops": {
          "ItemShop": [
            {
              "itemShopID": "197",
              "qoh": "0",
              "sellable": "0",
              "backorder": "0",
              "componentQoh": "0",
              "componentBackorder": "0",
              "reorderPoint": "0",
              "reorderLevel": "0",
              "timeStamp": "2020-06-19T13:33:22+00:00",
              "itemID": "66",
              "shopID": "1",
              "m": {
                "layaways": "0",
                "specialorders": "0",
                "workorders": "0"
              }
            },
            {
              "itemShopID": "196",
              "qoh": "0",
              "sellable": "0",
              "backorder": "0",
              "componentQoh": "0",
              "componentBackorder": "0",
              "reorderPoint": "0",
              "reorderLevel": "0",
              "timeStamp": "2020-03-24T13:43:13+00:00",
              "itemID": "66",
              "shopID": "0",
              "m": {
                "layaways": "0",
                "specialorders": "0",
                "workorders": "0"
              }
            }
          ]
        },
    


  • darryl_ssdarryl_ss Member Posts: 63

    Hi @gregarican

    There is only 1x physical shop, so I'm not really getting why each item has 2x shops, which all have unique ID's across 5000 products, that's 10,000 unique ID's.

    Maybe it's because this is my first real project, but I would expect to see 1x Shop ID across all items as there is only 1x shop.

    If anybody could explain that, I'd be grateful.

    I have figured how to update my stock quantities now.

    "ItemShops": {
          "ItemShop": [
            {
              "itemShopID": "197",
              "qoh": "0",
              "sellable": "0",
              "backorder": "0",
              "componentQoh": "0",
              "componentBackorder": "0",
              "reorderPoint": "0",
              "reorderLevel": "0",
              "timeStamp": "2020-06-19T13:33:22+00:00",
              "itemID": "66",
              "shopID": "1",
              "m": {
                "layaways": "0",
                "specialorders": "0",
                "workorders": "0"
              }
            },
            {
              "itemShopID": "196",
              "qoh": "0",
              "sellable": "0",
              "backorder": "0",
              "componentQoh": "0",
              "componentBackorder": "0",
              "reorderPoint": "0",
              "reorderLevel": "0",
              "timeStamp": "2020-03-24T13:43:13+00:00",
              "itemID": "66",
              "shopID": "0",
              "m": {
                "layaways": "0",
                "specialorders": "0",
                "workorders": "0"
              }
            }
          ]
        },
    


  • gregaricangregarican Member Posts: 469 

    @Adrian Samuel already explained this. Shop 0 represents an aggregate of all on-hands for any/all "real" shops you might have. You ignore this shop when updating on-hands, as it's a calculated read-only entity. As for the "why," it really doesn't matter. Just work with the API as he has already explained! 😀

  • darryl_ssdarryl_ss Member Posts: 63

    It just doesn't make sense to me to have 10,000 unique shop ID's but hey-ho. As I was saying, I just wanted to make sure that this was as designed rather than an issue created by the import.

  • rhinestone66rhinestone66 Member Posts: 3

    Well, allow me to ask this question: what is the definition of an item shop? Since the explanation of an ItemShopID is:

    'itemShopID(integer) The unique number identifier for the item shop.'

    So what is an item shop? Since I misunderstood the word item shop being .... a shop. With an ID.

  • VintageWineGuyVintageWineGuy Member Posts: 97 ✭

    ItemShopID is just the primary key for an ItemShop table.

    You have a Shop table, and a shopID key. One shopID per store, and an extra 0 key that aggregates all stores.

    You have an Item table, and an itemID key.

    You have a ItemShop table, and an itemShopID primary key with the foreign keys itemID and shopID.

    Why? Because they built it that way.

Sign In or Register to comment.