Why two Item Shops for Each Product?

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.
14 comments
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
Software Developer
Lightspeed HQ
@Adrian Samuel,
I get you , thanks Adrian!
@Adrian Samuel Could you please provide further explanation?
I am trying to update stock quantities today and get this response:
Using the request body:
How do you mass update stock quantities?
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?
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.
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).
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.
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.
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.
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.
@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! 😀
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.
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.
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.