I’m wondering about the real benefits of catalog item versioning. It seems to create more work, for no particular benefit.
At the moment, the version is required in order to update any object. This means that the version must be retrieved and stored for every item as it’s created. The problem is that for nested items there’s no easy way to retrieve this version.
For example, creating a product with nested variations means that we need to use the id_mapping to map our client object id to the system generated id for each variation. We then need to use the generated id to trawl through the response data to find the matching variation and then extract the version from that before it can be saved.
If a version is going to be required for every update, why can’t the version be returned in the id_mappings structure to make it easy to find, since we need to save both the system id and the version?
An improvement would be to define a version of “0” which means just update the latest version because we don’t care about versioning. In some scenarios, the data is being synced from a database to the Square catalog, and the catalog should never be updated independently. In this case, we always want to just update the latest version.
As a work around, we’ve just resorted to retrieving the item from the catalog every time to get the version before updating it, so there’s no need to store the version. However, this all creates an extra load on the system and slows things down, so it would be nice if there were an easier way to do this.