How to add HS Tariff Codes & Country of Origin to an invoice template?

Topic summary

Users need to display HS Tariff Codes and Country of Origin on invoice templates for international shipping compliance (particularly post-Brexit for GB). The core issue is that while Shopify’s product database stores these fields, they are not available in the Liquid variable reference list for invoice templates.

Current Status:

  • No native solution exists; the required variables are missing from Shopify’s Liquid documentation
  • One user describes this as a potential bug/oversight that should be fixed
  • Manual processing is the current workaround for some merchants

Proposed Workaround:
Create variant-level metafields and copy HS codes there, then reference them in templates using:
{{ line_item.variant.metafields.harmonized_system_code.value }}

Outcome:
The discussion remains unresolved with no official Shopify response. The metafield workaround is the only technical solution offered, though it requires additional setup and data duplication.

Summarized with AI on October 24. AI used: claude-sonnet-4-5-20250929.

Hi

This might be a quick one but I am trying to add HS Tariff Codes & Country of Origin to the invoice template.

It is not shown as an option in the liquid variable reference list.

Can anybody help please.
As GB has now left the European Market we are required to quote this information on packets sent around the world.

Thanks in advance for your help.

Dan

Hi @Dan_Redhead ,

Welcome to the Shopify forums!

We suggest you see this thread for assistance, should you need a more hands-on approach do let us know! We’ll try to help as much as possible.

Cheers!

Did you get a workaround on this? The other article you were referred to didn’t look like much help?

IF you have difficulty to classification HS code, I will help you to support your business. ALL of apparel Product HS code, Textile, Toys, Garment etc

Please open this link : https://www.linkedin.com/in/specialty-coffee-arabica-1a5929200

I also can be your dropship partner. Open to discuss.

Hi

Sorry no updates.

Just processing manually which is a shame as the database holds the code.

I have the exact same question. The variables country of origin and customs code can be added to the products in shopify. But the fields are useless if these fields are not in the Liquid variables list and there is no information anywhere on the code needed to add this variable to the invoice template. The liquid variables list in shopify should be updated to add these 2 variables, there is no reason for it not to be on the list as it is a standard variable. It just seems like these 2 variables missing on the Liquid variables list is a bug/error in Shopify that should be fixed

What I had done is Add a variant level metafield and then copy over the HS code to that metafield

can then reference that using something like

{{ line_item.variant.metafields.harmonized_system_code.value }}