Discussing APIs and development related to customers, discounts, and order management.
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
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
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
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
We need this field in the Variant too, we have a reporting system that will benefit from lowering the calls to the API.
+1 as well to have this included in the Variant data instead of having to make an additional call to the Metafields endpoint.
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. 🙂
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. 😇
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.
Also, I would like to add, that when getting meta fields for a product without variants, it will not give back the tariff code 😞
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.
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