Following Brexit, Shipping to the EU requires HS codes to be 8 characters in length.
However the Rest API returns a maximum of 6 characters. Additionally, the country_harmonized_system_codes array is always empty.
The Shopify admin shows that these characters have more characters so why won't the API return them?
Here is an example response:
[id] => 34136354586707 [sku] => SN01MCHDBZ203XL [created_at] => 2020-12-30T12:49:40+00:00 [updated_at] => 2020-12-30T12:50:54+00:00 [requires_shipping] => 1 [cost] => [country_code_of_origin] => PK [province_code_of_origin] => [harmonized_system_code] => 611020 [tracked] => 1 [country_harmonized_system_codes] => Array ( ) [admin_graphql_api_id] => gid://shopify/InventoryItem/34136354586707
Can you confirm where you're seeing the 8 digit code in the admin? I checked that product, but the HS code and origin country I see match the response you provided exactly:
The country HS code array is for country-specific HS codes which can only be set through the InventoryItem API. If these haven't been set though the API, an empty array is expected in the response.
You are right. The client (of this store) told me they entered the full code in the admin but when I checked a couple of days ago I could only view and enter a maximum of 6 characters.
When I tried this a few months ago though, I'm sure I was able to enter more than 6 characters.
This is a huge problem as 8 characters are required to send goods across Europe. According to DPD, orders will be rejected at the border if the commodity codes only contain 6 characters after Brexit.
As a workaround for our fulfilment app, I have had to manually add the remaining 2 characters to every product and save them in our database. This is not a permanent solution as the merchants using the app will need to add more products.
What is the reason the Shopify admin now only limits the HS codes to a maximum of 6 characters and are there any plans to increase the limit?
At the moment it is not fit for purpose for international trade.
The admin currently only allows users to add 6 digit HS codes, as these are the digits required for tax and duty calculation.
Codes longer than 6 digits can be added through the API, and need to be specified per country. Using the inventoryItem API, you can add codes to the
country_harmonized_system_codes array and that code will be used for orders shipping to the specified country. Just make sure to have the base 6-digit code and country of origin set before attempting to add country specific codes.
Sure, the base HS code is 6 characters but to import and export goods in the EU the 2 character CN code is also required.
And sure, an app could have the functionality to update the codes - but why? The functionality to add codes is already in the admin. It does not necessarily need to validate the codes. It only needs to allow a maximum length of 10 characters. Why not just validate the first 6 and if more or entered, just allow it anyway? Then have the API just return whatever the full value is in harmonized_system_code or a new property in a future API version.
I'm certain that merchants are not happy about adding HS codes for thousands of products in the admin and then having to duplicate the process for every product in every fulfillment app they are using.
I get now that the array can be used to extend the basic functionality of a single country to specific countries only using the API. However, for merchants that are only sending EU to EU (and there are a lot of them), they should be allowed to enter the correct commodity codes within their admin.
I hope you can consider implementing this in the admin and next API release candidate?
This functionality was added to the admin back in February, codes added in the admin can now be up to 13 characters in length.
Thanks for resolving the issue @_JB.
@andyhobday, I could be wrong, but I'm sure the decimal places do not come through from the API. And if they do, it will be simple to remove them with some simple string manipulation.
Are you a merchant using a third party app? You could try reaching out to them to ask them to look at the issue.
HS codes are 6 characters but you can now manually enter the country specific codes so this eliminates data duplication in apps and makes it simpler for merchants to manage. This was the main issue with this form field.