Catalog, Category, Item, Variation and Modifier Versions

I had a question about version in terms of items, categories etc.

Will a version of an item update when a variation it has is updated? Or will the category version update when one of the items update?

Are versions like a tree or does it only pertain to that object directly? I suspect the former because the catalog version may update insinuating that a child of the entire catalog has been updated

Hi @rickypanzer, welcome to the forums!

Yep, your suspicions are correct! If you update an item variation, then the version of the parent item will also update (I believe, theoretically, the versions of all variations and parent item should be the same at all times).

However, if you update a category, it will not update the item’s version. Likewise, updating an item will not update the category’s version.

1 Like

Thanks @sjosey, this is good to know

to confirm:
Item <–> Item Variation

could you go over what other models would be linked with each other in terms of version?

The models I’m looking at are:

Overall Catalog, Category, Item, Discount, Tax, Item Variation, Modifier List, Modifier

Another question is, when subscribing to the Overall Catalog Version change webhook, what related model changes could update the overall catalog version number?

Basically any object that gets inlined on another catalog object will update the parent’s version when it gets modified. I think the main ones will be the variation -> item, and then modifiers -> modifier lists.

1 Like

Thanks @sjosey, I have a related question:

If I added or removed a modifier list from an item. Would the item’s version number update in that case?

Similarly, if an item was added or removed from a category, would the category’s version update?

I think I’ll try answering my question:

Item has modifier_list_info, so an item’s version would update if a modifier list was added or removed from an item.

On the other hand, Item has a category_id, so a category’s version would not update if an item was added or removed from a category - the item’s version would update instead

Is this correct?

Sorry for the delay. As far as I know, removing a modifier list from an item would not trigger an update on the item version. However, if you remove a modifier from a modifier list, it would update the modifier list version.