Is this possible update catalog object which contains tax?

Hi

I want to update catalog object (type “item”) which already contains tax object. I want change name of existing catalog and used upsertcatalogobject endpoint. But in response i got updated catalog without tax object. Is this mean i should set tax object each time when i want update catalog?

Thanks

Yes, you’ll need to set all fields when upserting to the Catalog. If they aren’t included then they’ll be removed from the item. This is because the UpsertCatalogObject endpoint is used to create other catalog objects. :slightly_smiling_face:

according with catalog’s documentation

CatalogObject with type Item doesn’t support TaxObject field. i must to create Tax in separatelly request with using UpsertCatalogObject or BatchUpsertCatalogObjects. but it doesn’t clear to me how to bind CatalogItemVariation and Tax? UpsertCatalogObject just creates Tax and i don’t understand how to return this Tax from Squareup for my CatalogObject later if i don’t have his ID?

If your looking to have taxes automatically apply to orders when a specific item is added to the order you’ll use the pricing option to apply automatic taxes based on taxes preconfigured for the catalog items. :slightly_smiling_face:

Thank you for answer

Does its possible get tax which i created using BatchUpsertCatalogObjects endpoint (item+tax) if i know id of item only? I don’t have orders, but i have id of item.

If you created the pricing option and added that item to the rule you’ll get the array of tax_ids in the response when retrieving the object. For example:

{
    "object": {
        "type": "ITEM",
        "id": "IPFY5CUTXOYG3PBXHQGDKBXM",
        "updated_at": "2023-05-11T14:41:37.436Z",
        "created_at": "2019-12-26T17:13:27.337Z",
        "version": 1683816097436,
        "is_deleted": false,
        "present_at_all_locations": true,
        "item_data": {
            "name": "Hex Coffee",
            "description": "Hot Bean Juice",
            "label_color": "FBD6E4",
            "is_taxable": true,
            "visibility": "PRIVATE",
            "available_online": false,
            "available_for_pickup": false,
            "available_electronically": false,
            "category_id": "RU5WBWNYPWLERUQBCVSQQVEG",
            "ordinal": 0,
            "tax_ids": [
                "P2WTZJKP633HECJMGYHVWUU4",
                "QZR25LKZ23SLVOPWFLJ4J3MS",
                "ZPTKVRGA2UDO2OZWL6ULID3H"
            ],
            "modifier_list_info": [
                {
                    "modifier_list_id": "M2JDAVYQCJEK2KAUTVJAYRTK",
                    "min_selected_modifiers": -1,
                    "max_selected_modifiers": -1,
                    "enabled": true
                },
                {
                    "modifier_list_id": "NEQACTCWKO4HVDJIF7R5GU4I",
                    "min_selected_modifiers": -1,
                    "max_selected_modifiers": -1,
                    "enabled": true
                }
            ],
            "variations": [
                {
                    "type": "ITEM_VARIATION",
                    "id": "UXTWXOHG5HBKM65MLIBUKMQF",
                    "updated_at": "2023-01-22T21:16:24.19Z",
                    "created_at": "2019-12-26T17:13:27.337Z",
                    "version": 1674422184190,
                    "is_deleted": false,
                    "present_at_all_locations": true,
                    "item_variation_data": {
                        "item_id": "IPFY5CUTXOYG3PBXHQGDKBXM",
                        "name": "Regular",
                        "sku": "12348",
                        "ordinal": 1,
                        "pricing_type": "FIXED_PRICING",
                        "price_money": {
                            "amount": 280,
                            "currency": "USD"
                        },
                        "location_overrides": [
                            {
                                "location_id": "3Z4V4WHQK64X9",
                                "track_inventory": false
                            }
                        ],
                        "sellable": true,
                        "stockable": true
                    }
                },
                {
                    "type": "ITEM_VARIATION",
                    "id": "MDTZQGRYTEAV5F5ZA3QWRSOX",
                    "updated_at": "2023-01-22T21:16:24.19Z",
                    "created_at": "2019-12-26T17:13:27.337Z",
                    "version": 1674422184190,
                    "is_deleted": false,
                    "present_at_all_locations": true,
                    "item_variation_data": {
                        "item_id": "IPFY5CUTXOYG3PBXHQGDKBXM",
                        "name": "Large",
                        "sku": "09876",
                        "ordinal": 2,
                        "pricing_type": "FIXED_PRICING",
                        "price_money": {
                            "amount": 350,
                            "currency": "USD"
                        },
                        "location_overrides": [
                            {
                                "location_id": "3Z4V4WHQK64X9",
                                "track_inventory": false
                            }
                        ],
                        "sellable": true,
                        "stockable": true
                    }
                }
            ],
            "product_type": "REGULAR",
            "skip_modifier_screen": true,
            "ecom_available": true,
            "ecom_visibility": "HIDDEN",
            "pickup_fulfillment_preferences_id": "fprefs_127djg37q08dwyf33ihh4q39x",
            "delivery_fulfillment_preferences_id": "fprefs_127djg37pbjevxpdk6ue90r9x",
            "description_html": "<p>Hot Bean Juice</p>",
            "description_plaintext": "Hot Bean Juice"
        }
    }
}

:slightly_smiling_face:

1 Like

Thank you for your helping.