What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: Get HS Tariff Code from Product API

Get HS Tariff Code from Product API

Alexandru_Simio
Visitor
2 0 2

Hey,

I see that on a product variant's page there's a field for the HS Tariff Code. Is there a way to retrieve that code through the Product API? I didn't find anything in the API reference, but maybe I missed it.

Thank you,

Alex

Replies 11 (11)

Jordan
Shopify Staff
301 3 84

Hey Alexandru,

We haven't yet exposed that field in our API - though, if you care to touch on your current use case for reading this field, I can reach out to the right team to make a case for exposing it. 

 

- Jordan

Jordan | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Alexandru_Simio
Visitor
2 0 2

Thank you for your response!

I am working on a fulfillment service (bluedrone.com) that integrates with multiple ecommerce platforms. We use your API and webhooks to allow (both) our users to import the products and orders from Shopify into our system, where we take care of the shipping. For international orders, the users have to manually enter the HTS code into our system, even if it was already set in Shopify, which some of them complained about. Being able to retrieve that field through your API would further automate the process.

I think this will help both our services by providing a better integration. Hopefully, it will convince the API team to expose the HTS code for both Products and Order line items.

Thank you,

Alex

Jordan
Shopify Staff
301 3 84

Hey Alexandru,

As it turns out, a product variant's HS Tariff code is stored as a metafield, so in order to access it, you would have to use the Metafield endpoint (i.e /admin/products/{product_id}/variants/{variant_id}/metafields.json)

- Jordan

 

Jordan | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

menelaos_vergis
Shopify Partner
35 0 6

We need this field in the Variant too, we have a reporting system that will benefit from lowering the calls to the API.

Build Shopify Applications with the most simple UX possible
Jonathan-HA
Shopify Partner
336 26 107

+1 as well to have this included in the Variant data instead of having to make an additional call to the Metafields endpoint.

Co-Founder / Developer at Highview Apps
Our Shopify Apps: EZ Exporter | EZ Inventory | EZ Importer | EZ Notify | EZ Fulfill
Jonathan-HA
Shopify Partner
336 26 107

Just found out this field is also now available via the InventoryItem resource plus the "Country of Origin" and other related fields as well: https://developers.shopify.com/changelog/the-inventoryitem-resource-now-includes-hs-codes-country-co...

 

Would be nice to have them in the Variant resource as well to reduce the API calls, but this is still better than having to make a call to the Metafields endpoint per variant as with the InventoryItem endpoint we can at least specify 100 ids per request. 🙂

Co-Founder / Developer at Highview Apps
Our Shopify Apps: EZ Exporter | EZ Inventory | EZ Importer | EZ Notify | EZ Fulfill
blueberry-pay
Excursionist
14 0 12

Why so complicated with the APIs? I think the best way is if you just add the HSCode, ProductyType, Barcode, etc.. within line_items. Then you can close a lot of questions here in the community. People just need to make api request once. ðŸ˜‡

Thomas_Lang1
Shopify Partner
237 6 56

That works, which is great, although I think it would be better to add the tariff codes in the order's line_items, since for fulfilling the orders you need all the tarif codes for every line item, which now means if an order has 6 different products, I will need to fetch the metafields 6 times to get the tariff code.. then if you get hundreds of orders, shopify gets thousands of extra requests, it doesn't sound too efficiënt.

Software Developer | Owner of Tom IT - We build shopify apps
Marketplace Order Connector | Amazon bol.com & Walmart DSV
Order Related Documents | Print documents, Email document &Autoprint
Blog Product Spotlight | Add products to your blog articles!

Thomas_Lang1
Shopify Partner
237 6 56

Also, I would like to add, that when getting meta fields for a product without variants, it will not give back the tariff code 😞

Software Developer | Owner of Tom IT - We build shopify apps
Marketplace Order Connector | Amazon bol.com & Walmart DSV
Order Related Documents | Print documents, Email document &Autoprint
Blog Product Spotlight | Add products to your blog articles!

joose
Shopify Partner
26 1 12

I also would like to see tarif codes in the order information when fetching from Order API the order information. Helps to reduce traffic to the API and also make things work faster in the application side.

jimareexim
Visitor
1 0 0

In case, you wish to learn about value of imports or get to know about the top exporting countries that sell their products to India, going through the hs Codes chapter 01 to 98 would act as a great beginning. This is going to make it easy for any trader to learn about the trade basics in detail and thus decision taking later would become easy