Upsert version mismatch?

Hi all,

I’ve seen a number of mentions of checking version info when storing, but I’m literally downloading all the items, then trying to update a single one (changing location availability) using the python client. I’m downloading the object directly, then just changing the availability attributes, not changing the version, copying the item_data over, and it’s giving me a version error. I’m not sure how that can be, given that it was literally just downloaded? All the advice on the forum seems to suggest making sure you have the right version, but that’s obviously covered.

Note that I have tried both setting and removing the versions on the main item and the variations embedded in the item data, and am still getting the same error. Validated that the removal is, in fact working.

What’s your application ID and the catalog_object_id your getting the error with? :slightly_smiling_face:

app id: sq0idp-3q9Wt-i56xgBt03VoTU_Hw
catalog_object_id: ZHFLBRJFZWNXKINUSCB6G4IC

It looks like your getting this error cause you didn’t include the top level version. You’ll need to include both the top level ITEM and the nested ITEM_VARIATION version.

{
    "object": {
        "type": "ITEM",
        "id": "ZHFLBRJFZWNXKINUSCB6G4IC",
        "updated_at": "2023-11-08T00:16:07.794Z",
        "created_at": "2021-12-07T03:24:48.935Z",
        "version": 1699402567794,
        "is_deleted": false,
        "present_at_all_locations": true,
        "item_data": {
            "name": "Biscuit",
            "description": "Homemade buttermilk biscuit",
            "is_taxable": false,
            "visibility": "PRIVATE",
            "tax_ids": [
                "6NEJCE5HQEIOCAWPBBYLDU3S",
                "B2AGR5HPJFRAMDPMJMZWQTUO"
            ],
            "modifier_list_info": [
                {
                    "modifier_list_id": "IX6EOSLYG7MVSM3XKZPIQ6RZ",
                    "min_selected_modifiers": -1,
                    "max_selected_modifiers": -1,
                    "enabled": true
                },
                {
                    "modifier_list_id": "QORUKUOHO6I4VMEJPPKPUXGH",
                    "min_selected_modifiers": -1,
                    "max_selected_modifiers": -1,
                    "enabled": true
                }
            ],
            "variations": [
                {
                    "type": "ITEM_VARIATION",
                    "id": "YBPEQJRRHABTCAZ4IQ5PWSCG",
                    "updated_at": "2023-11-08T00:16:07.794Z",
                    "created_at": "2021-12-07T03:24:48.935Z",
                    "version": 1699402567794,
                    "is_deleted": false,
                    "present_at_all_locations": true,
                    "item_variation_data": {
                        "item_id": "ZHFLBRJFZWNXKINUSCB6G4IC",
                        "name": "Biscuit",
                        "ordinal": 0,
                        "pricing_type": "FIXED_PRICING",
                        "price_money": {
                            "amount": 400,
                            "currency": "USD"
                        },
                        "track_inventory": false,
                        "inventory_alert_type": "NONE",
                        "sellable": true,
                        "stockable": true,
                        "channels": [
                            "CH_IkAYz9jC0d7MBT6OQgdkC9zwPDgeuSULZrpfYRlQuYC",
                            "CH_S3fzrFaXwFtHF8MbEgdkC9zwPDgeuSULZrpfYRlQuYC",
                            "CH_sml4GJXcs9fkGLlRBgdkC9zwPDgeuSULZrpfYRlQuYC"
                        ]
                    }
                }
            ],
            "product_type": "REGULAR",
            "skip_modifier_screen": false,
            "ecom_available": false,
            "ecom_visibility": "UNAVAILABLE",
            "pickup_fulfillment_preferences_id": "fprefs_127djr28bioh6rci9g9cojcqp",
            "delivery_fulfillment_preferences_id": "fprefs_127djr28auvsp4w9awob4uzi9",
            "description_html": "<p>Homemade buttermilk biscuit</p>",
            "description_plaintext": "Homemade buttermilk biscuit",
            "channels": [
                "CH_sml4GJXcs9fkGLlRBgdkC9zwPDgeuSULZrpfYRlQuYC",
                "CH_S3fzrFaXwFtHF8MbEgdkC9zwPDgeuSULZrpfYRlQuYC",
                "CH_IkAYz9jC0d7MBT6OQgdkC9zwPDgeuSULZrpfYRlQuYC"
            ],
            "is_archived": false
        }
    }
}

:slightly_smiling_face:

Yup that was it. Cheers!