HS code Order Printer

Add HSN or HS code to Shopify invoices

Generate item-level Liquid for printing HS or HSN codes from product or variant metafields in Shopify Order Printer templates.

HS or HSN code on Shopify invoices Place item-level HS or HSN code beside title, quantity, origin, and customs description inside the line item loop.

Quick answer

Add HSN or HS code to Shopify invoices for Shopify Order Printer

Generate the HS code metafield block, choose product or variant storage, and place it inside the line item table before testing real orders. Start in a duplicate Shopify Order Printer template, paste the Liquid in the right placement area, and preview with real orders before saving.

  1. Create or confirm a metafield such as custom.hs_code on products or variants.
  2. Use product metafields when the HS code is identical across every variant of the product.
  3. Use variant metafields when material, bundle contents, size, or manufacturing setup changes the classification.

Copy-ready example

Starter Liquid pattern

Use this as a visible pattern, then use the generator below to adjust the exact field, fallback text, layout, and test notes.

{% for line_item in line_items %}
  <p>
    {{ line_item.title }} -
    HS {{ line_item.product.metafields.custom.hs_code.value | default: "Missing HS code" }},
    {{ line_item.product.metafields.custom.country_of_origin.value | default: "Missing origin" }}
  </p>
{% endfor %}

Next template fixes

Check the adjacent field problem before rewriting the whole template.

If this snippet does not match the real Shopify order data, the next issue is usually a metafield owner, a line item property, or a starter template placement problem.

Commercial invoice fields

Shopify commercial invoice template with HS code and origin

Best for cross-border merchants preparing Shopify invoice or commercial invoice templates that need item-level HS/HSN code, origin, and customs data in a printable layout.

Open this fix

Country of origin invoice

Add country of origin to a Shopify invoice

Best for merchants whose commercial invoice or customs document needs origin printed per line item, especially when variants can have different origins.

Open this fix

Metafield Liquid generator

Add metafields to Shopify Order Printer

Best for merchants adding product specs, HS codes, country of origin, VAT notes, wholesale fields, or customer fields to printed documents.

Open this fix

Free first, fix when needed

Use the generator for the first safe test.

Generate the HS code metafield block, choose product or variant storage, and place it inside the line item table before testing real orders. If the snippet works alone but your real Shopify Order Printer template has custom loops, tables, print CSS, app fields, or compliance-sensitive wording, send the current template for a scoped fix.

Ask for a fix when variants need different codes or the existing commercial invoice table is already custom.

HS code Order Printer

Add HSN or HS code to Shopify invoices

Generate the HS code metafield block, choose product or variant storage, and place it inside the line item table before testing real orders.

Standard order with one clear product row.
Need customs fields aligned with item rows?

Commercial invoice fields are safest when HS code, origin, description, quantity, and item title stay together in the item table.

Add customs fields to my item table
Validate a commercial invoice starter pack

Use this when you need a focused commercial invoice starter with item-level HS code, origin, and description fields.

Request commercial invoice pack

Need more than code snippets?

Generated Liquid

Copy-paste code

{% for line_item in line_items %}
  <div class="opk-customs-row">
    <strong>{{ line_item.title }}</strong>
    <ul>
      <li><strong>HS code:</strong> {{ line_item.product.metafields.custom.hs_code.value | default: "Missing HS code" }}</li>
      <li><strong>Country of origin:</strong> {{ line_item.product.metafields.custom.country_of_origin.value | default: "Missing origin" }}</li>
      <li><strong>Customs description:</strong> {{ line_item.product.metafields.custom.customs_description.value | default: line_item.title }}</li>
    </ul>
  </div>
{% endfor %}

Install wizard

Place the snippet before testing output.

1
Template area

Commercial invoice item table

2
Paste target

Paste inside the item loop or commercial-invoice item table so each line gets its own customs data.

3
Test order

Cross-border order with HS code, origin, and missing-field cases

Paste location

Paste inside the item loop or commercial-invoice item table so each line gets its own customs data.

Test checklist

  • Duplicate the Shopify Order Printer template before editing the live one.
  • Preview with the regular order.
  • Use an order whose product, variant, customer, or order data has the field filled in.
  • Print or save one test preview before using the template in production.

Common failure

  • The HS code block is pasted outside the line item loop.
  • A product metafield is used even though different variants need different classifications.
  • The metafield definition exists, but some products or variants have blank HS code values.

Mock preview

#1048Standard order with one clear product row.
  • HS code: 6912.00
  • Country of origin: United States
  • Customs description: Blue ceramic mug

Use case

When to use this tool

Best for cross-border merchants who need an HS code or HSN code column on a Shopify invoice, commercial invoice, customs packing slip, or export document built in Order Printer.

Targets the exact HS code field instead of treating customs as one generic page.

Covers HSN code wording for merchants whose invoice language uses HSN instead of HS code.

Explains product metafields versus variant metafields for classifications that change by material, kit, size, or country.

Keeps HS code output inside the line item loop so every purchased item can print its own value.

Pairs HS code with customs description, country of origin, quantity, and destination checks.

Keeps customs language cautious and points merchants to carrier, broker, or internal compliance review before shipment.

Free tool fit

Use the snippet when the edit is narrow.

Generate the HS code metafield block, choose product or variant storage, and place it inside the line item table before testing real orders.

  • You know which Shopify Order Printer template you want to edit.
  • You can test in a duplicate template before touching the live one.
  • The field or layout change maps to the Liquid objects listed on this page.

Manual fix fit

Request help when placement is risky.

Send your commercial invoice template when HS codes need to be merged into an existing item table with quantity, origin, description, and tax notes.

  • Your current template already has custom loops, tables, CSS, or app-specific fields.
  • The snippet works in isolation but prints blank, repeats, or breaks layout in your real template.
  • The document is customer-facing, B2B, VAT, customs, or warehouse-critical and needs careful test notes.

Install steps

Copy into Shopify Order Printer carefully.

The preview uses sample data. Always test the template with real orders before using it for fulfillment, accounting, customs, or customer-facing documents.

  1. Step Create or confirm a metafield such as custom.hs_code on products or variants.
  2. Step Use product metafields when the HS code is identical across every variant of the product.
  3. Step Use variant metafields when material, bundle contents, size, or manufacturing setup changes the classification.
  4. Step Generate the HS code Liquid block and paste it inside the commercial invoice item loop.
  5. Step Place the HS code near customs description, country of origin, quantity, and item title.
  6. Step Preview a multi-item order with one filled HS code, one missing HS code, and one variant-specific HS code.
  7. Step Have the merchant, carrier, broker, or compliance workflow verify classifications before production use.

Problem diagnosis

Match the symptom before changing Liquid.

Use these checks to decide whether the issue is field data, snippet placement, print settings, or a template merge problem.

HS code prints blank for some items.

Likely cause
The selected product or variant metafield is empty on those items, or the snippet is outside the item loop.
Fix
Fill the HS code metafield on every product or variant used in the test order, then paste the snippet inside the line item loop.

Every variant prints the same HS code.

Likely cause
The template reads a product metafield even though variants need separate classification values.
Fix
Store HS code on variant metafields and switch the path to line_item.variant.metafields.custom.hs_code.value.

The customs table is hard to audit.

Likely cause
HS code is printed without nearby item title, customs description, origin, or quantity.
Fix
Place HS code in the item table next to title, customs description, country of origin, and quantity.

HSN code wording is needed on a Shopify invoice.

Likely cause
The store may use HSN as the invoice label while the actual metafield key is custom.hs_code, custom.hsn_code, or a store-specific key.
Fix
Use the invoice label your team needs, but keep the Liquid path matched to the source metafield key in Shopify admin.

FAQ

Common Shopify Order Printer issues

Where should HS codes be stored for Order Printer?

A simple first setup is a product or variant metafield such as custom.hs_code, then print that value inside the line item loop.

Should HS code be a product metafield or variant metafield?

Use product metafields when every variant shares one classification. Use variant metafields when material, kit contents, size, or origin can change the HS code.

Can OrderPrintKit tell me the correct HS code?

No. It helps print the value you store in Shopify. Classification decisions should be verified by the merchant, carrier, broker, or advisor.

Can I add HS code to a packing slip instead of a commercial invoice?

Technically yes if the field is available, but customs documents usually need more context than a normal warehouse packing slip.

Can I print HSN code instead of HS code?

Yes. Use HSN as the visible label if that matches the invoice workflow, but make sure the Liquid path reads the actual metafield key where the value is stored.

Related exact fixes

Follow the next likely Order Printer problem.

These links connect adjacent search intents, such as blank metafields, item-level customs fields, B2B invoice data, and one-off template fixes.

Commercial invoice fields

Shopify commercial invoice template with HS code and origin

Best for cross-border merchants preparing Shopify invoice or commercial invoice templates that need item-level HS/HSN code, origin, and customs data in a printable layout.

Shopify commercial invoice template with HS code and origin

Country of origin invoice

Add country of origin to a Shopify invoice

Best for merchants whose commercial invoice or customs document needs origin printed per line item, especially when variants can have different origins.

Add country of origin to a Shopify invoice

Metafield Liquid generator

Add metafields to Shopify Order Printer

Best for merchants adding product specs, HS codes, country of origin, VAT notes, wholesale fields, or customer fields to printed documents.

Add metafields to Shopify Order Printer

Packing slip metafield

Add product metafields to a Shopify packing slip

Best for merchants adding HS codes, country of origin, pick notes, wholesale fields, or product specs to warehouse documents.

Add product metafields to a Shopify packing slip

Line item properties

print Shopify line item properties

Show gift options, personalization, and bundle details without private fields.

print Shopify line item properties

Common Order Printer fixes

Keep editing the same Shopify template.

These are the highest-signal internal paths for merchants who need template code, packing slip layout, barcodes, metafields, or 4x6 print fixes.

Liquid objects

Fields this page usually touches

  • line_item.product.metafields.custom.hs_code.value
  • line_item.variant.metafields.custom.hs_code.value
  • line_item.product.metafields.custom.customs_description.value
  • line_item.variant.metafields.custom.country_of_origin.value
  • line_item.quantity
  • shipping_address.country

Common errors

Watch these before saving

  • The HS code block is pasted outside the line item loop.
  • A product metafield is used even though different variants need different classifications.
  • The metafield definition exists, but some products or variants have blank HS code values.
  • The page prints HS codes without a customs description or country of origin column, making the document hard to review.
  • The merchant assumes template code validates HS classifications.
  • The invoice label says HSN code while the Liquid path points to a different metafield key.

Limits

What this does not replace

  • This is template code help, not HS classification or customs advice.
  • The generator does not validate tariff codes, destination rules, carrier requirements, or product eligibility.
  • Kits, regulated goods, and multi-origin products may need manual document logic.
  • Carrier-generated customs forms may still be required even when an Order Printer document includes HS codes.