Solved

Add Variant HS Tariff Codes to REST API

Bjorn_Forsberg_
Shopify Partner
303 4 70

Hey Shopify team,

 

Currently the "HS Tariff Codes" property assigned to a Variant, are not available when using the REST API. I can see that it is available on the GraphQL API, but my use case requires use of the REST API.

 

Can you please add the property to the REST API too, so we can get that important info.

 

For reference, it's called "harmonisedSystemCode" on the GraphQL API: https://help.shopify.com/en/api/graphql-admin-api/reference/object/productvariant#harmonizedsystemco...

 

Thanks for your consideration!

 

Ps. Bonus points if we can also get the "Country of origin" property of Variants exposed on the APIs too 🙂

 

Bjorn

Bjorn Forsberg | FORSBERG+two | Award-winning Shopify Apps since 2011
Accepted Solutions (2)

Jonathan-HA
Shopify Partner
316 24 99

This is an accepted solution.

It looks like they pushed an update on Feb. 15 to include the HS code and Country Code of Origin to the InventoryItem endpoint: https://developers.shopify.com/changelog/the-inventoryitem-resource-now-includes-hs-codes-country-co...

 

The HS Tariff code is also currently available in the Product Variant Metafield under the key "harmonized_system_code" but it looks like it will be deprecated in the next few months.

Co-Founder / Developer at Highview Apps
Our Shopify Apps: EZ Exporter | EZ Inventory | EZ Importer | EZ Notify | EZ Fulfill

View solution in original post

Bjorn_Forsberg_
Shopify Partner
303 4 70

This is an accepted solution.

@Nik_Avvakumov Yeah, seems unnecessary.. BUT the more I think about it the more it makes sense. Depending on the Location of the goods, they may have been manufactured at a different factory.. and have different cost base due to import duties, different taxes etc.

 

For example: Tesla are setting up manufacturing in China, they also manufacture in California. If you buy a Tesla in China, it will eventually have the Country of Origin as China, as it will be cheaper to sell you one that was made locally. The cost on that Tesla will be different to one manufactured in California, hence it makes sense to have those details attached to each Inventory Item (which is linked to a location), instead of the overall Variant.

 

Guess I'll just have to either skip supporting that info, or make more API calls.. sigh 😬

Bjorn Forsberg | FORSBERG+two | Award-winning Shopify Apps since 2011

View solution in original post

Replies 12 (12)

Nik_Avvakumov
Shopify Partner
4 0 2

"country_code_of_origin", "province_code_of_origin", "harmonized_system_code" & "country_harmonized_system_codes" are attached to inventory items in the REST API, if that helps.

Bjorn_Forsberg_
Shopify Partner
303 4 70

Thanks, but that's a lot more API calls needed for something that "should" be the same on all inventory items (same SKU).

Bjorn Forsberg | FORSBERG+two | Award-winning Shopify Apps since 2011
Nik_Avvakumov
Shopify Partner
4 0 2

@Bjorn_Forsberg_ wrote:

Thanks, but that's a lot more API calls needed for something that "should" be the same on all inventory items (same SKU).



Agreed. It's the same approach Shopify took a while ago with "cost per item", turning it into a `cost` field on InventoryItem rather than attaching it to Variant directly. Since Variant & InventoryItem have a 1:1 relationship, splitting information like that does not seem to offer any benefit but comes with the cost of having to make additional API calls to get all the data.

 

Perhaps someone from Shopify can explain the rationale behind this?

Bjorn_Forsberg_
Shopify Partner
303 4 70

This is an accepted solution.

@Nik_Avvakumov Yeah, seems unnecessary.. BUT the more I think about it the more it makes sense. Depending on the Location of the goods, they may have been manufactured at a different factory.. and have different cost base due to import duties, different taxes etc.

 

For example: Tesla are setting up manufacturing in China, they also manufacture in California. If you buy a Tesla in China, it will eventually have the Country of Origin as China, as it will be cheaper to sell you one that was made locally. The cost on that Tesla will be different to one manufactured in California, hence it makes sense to have those details attached to each Inventory Item (which is linked to a location), instead of the overall Variant.

 

Guess I'll just have to either skip supporting that info, or make more API calls.. sigh 😬

Bjorn Forsberg | FORSBERG+two | Award-winning Shopify Apps since 2011

Jonathan-HA
Shopify Partner
316 24 99

This is an accepted solution.

It looks like they pushed an update on Feb. 15 to include the HS code and Country Code of Origin to the InventoryItem endpoint: https://developers.shopify.com/changelog/the-inventoryitem-resource-now-includes-hs-codes-country-co...

 

The HS Tariff code is also currently available in the Product Variant Metafield under the key "harmonized_system_code" but it looks like it will be deprecated in the next few months.

Co-Founder / Developer at Highview Apps
Our Shopify Apps: EZ Exporter | EZ Inventory | EZ Importer | EZ Notify | EZ Fulfill
Bjorn_Forsberg_
Shopify Partner
303 4 70

@Jonathan-HA Ah, thanks for the heads up.. didn't spot that one 🙂

Bjorn Forsberg | FORSBERG+two | Award-winning Shopify Apps since 2011
Derek_Morin
Shopify Expert
216 1 34

It looks like they pushed an update on Feb. 15 to include the HS code and Country Code of Origin to the InventoryItem endpoint: https://developers.shopify.com/changelog/the-inventoryitem-resource-now-includes-hs-codes-country-co...

 

Throws a 404 error

ClementBR
Shopify Partner
153 2 44

@Bjorn_Forsberg_  I don't quite follow your reasoning since InventoryItem are NOT attached to a location directly.

It's only InventoryLevel that attaches a location.

 

Bjorn_Forsberg_
Shopify Partner
303 4 70

location was maybe the wrong word to use.. Country of Origin would be better.

Bjorn Forsberg | FORSBERG+two | Award-winning Shopify Apps since 2011
ClementBR
Shopify Partner
153 2 44

Right,

But even if you had multiple countries where an item can be made, you would still have to create a separate variant for each, since there is a 1 to 1 mapping between variant and inventory item.

Hence I don't understand why inventory item was created as a separate object. It seems to me they could have merged it in the variant object.

Bjorn_Forsberg_
Shopify Partner
303 4 70

You are totally right, I missed the 1-1 relationship.. must be for performance/cost reasons only then 😞

Bjorn Forsberg | FORSBERG+two | Award-winning Shopify Apps since 2011
ClementBR
Shopify Partner
153 2 44

ok, thanks!