Unable to Update InventoryItem HS Codes

Solved
coryatdm
New Member
1 0 0

Trying to update the HS codes for our products and I keep getting a 422 return code at each submission.

{
	"inventory_item": {
		"country_harmonized_system_codes": [
			{
				"country_code": "CN",
				"harmonized_system_code": "123456"
			}
		]
	}
}

and I am

PUT'ing this to

/admin/api/2019-04/inventory_items/1234567.json


Sample Request ID

f664fd3d-f5f0-43d5-b9fb-4e131e4daef4
0 Likes
Ryan
Shopify Staff
Shopify Staff
486 42 109

This is an accepted solution.

Hi @coryatdm ,

 

The technical reason why this call doesn't work is you need to include the harmonized_system_code parameter as well, and the country_harmonized_system_code has to include those 6 digits to begin it.

 

For example

 

 

{
    "inventory_item": {
        "id": 123456789098,
        "sku": "123ABC",
        "requires_shipping": true,
        "cost": "5.00",
        "country_code_of_origin": "CA",
        "province_code_of_origin": null,
        "harmonized_system_code": "111111",
        "country_harmonized_system_codes": [
            {
                "harmonized_system_code": "1111112222",
                "country_code": "CA"
            },
            {
                "harmonized_system_code": "1111113333",
                "country_code": "US"
            }
        ]
    }
}

The line validation accepts the two country specific codes here since they begin with the same 6 digits as the HSC.  Most products usually don't actually need the country specific HSC (last 4 digits), so I would double check that part too.  If you don't require the last 4 digits you should just use the top level property instead of the array.

 

 

22-18-4yy3e-x48l2

Developer Experience @ Shopify
KevinHarish
New Member
3 0 0

Hello, can you post in real time example. 

 

lets say you have HSC 2342.44.5778.

 

how can you define the first 6 digits ? since it has dot/point

"harmonized_system_code": "2342.44", or should remove dot as shown example like plain 
"harmonized_system_code": "111111",

Thanks

 

0 Likes