Get HS Tariff Code from Product API

Alexandru_Simio
New Member
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

Jordan
Shopify Staff
Shopify Staff
295 3 66

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

0 Likes
Alexandru_Simio
New Member
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
Shopify Staff
295 3 66

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

 

Thomas_Lang1
Shopify Partner
156 4 31

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.

Thomas_Lang1
Shopify Partner
156 4 31

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

joose
Shopify Partner
14 0 3

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.

menelaos_vergis
Shopify Partner
30 0 10

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

+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

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
0 Likes