Multiple Barcodes per Variant: What Shopify Developers and Merchants Need to Know

Shopify now lets each product variant store up to 20 barcodes (UPC, EAN, ISBN, GTIN, ASIN). Learn how this change affects you, what API updates to use, and how to migrate without breaking existing integrations.

Multiple Barcodes per Variant: What Shopify Developers and Merchants Need to Know
6 sections

Shopify’s latest developer changelog introduces a game‑changing feature: product variants can now hold multiple barcodes. If you’ve ever struggled to fit a UPC, an EAN, an ISBN, or a marketplace ASIN into a single barcode field, this update finally gives you the flexibility you need. In this post we’ll break down exactly what changed, who it impacts, and the concrete steps you should take today to start leveraging multiple barcodes without breaking existing workflows.

What Changed: From a Single Barcode to a Full Barcode Set

  • New `barcodes` connection on the ProductVariant object. It returns an array of ProductVariantBarcode objects, each with a value and an optional type (UPC, EAN, ISBN, GTIN, or ASIN).
  • Write operations now accept a barcodes input on the productSet, productVariantsBulkCreate, and productVariantsBulkUpdate mutations. You can send up to 20 barcodes per variant, each up to 255 characters.
  • The legacy ProductVariant.barcode field is deprecated but still functional. Reading it returns the first barcode in the new set; writing it updates only the first entry.
  • Who Is Affected?

    Developers – Any app, custom integration, or theme that reads or writes variant barcodes must be updated to use the new barcodes connection. If you rely on the old barcode field for bulk imports, syncs to ERPs, or marketplace listings, you’ll need to adjust your GraphQL queries and mutations.

    Merchants – Store owners who manually edit barcodes in the admin UI won’t see any immediate change; the UI still shows a single “Barcode” field (which now mirrors the first entry). However, merchants who need multiple identifiers for marketplaces, POS, or inventory systems will benefit from the expanded capability once their apps expose it.

    How to Implement the New Barcodes API

    Below are the most common mutation patterns you’ll need.

    Create a variant with multiple barcodes

    graphql

    mutation CreateVariantWithBarcodes($productId: ID!) {

    productVariantsBulkCreate(productId: $productId, variants: [

    {

    sku: "SKU-123",

    barcodes: [

    { value: "012345678905", type: UPC },

    { value: "4006381333931", type: EAN },

    { value: "9780306406157", type: ISBN }

    ]

    }

    ]) {

    productVariants {

    id

    barcodes {

    value

    type

    }

    }

    userErrors { field message }

    }

    }

    Update an existing variant’s barcode set

    graphql

    mutation UpdateVariantBarcodes($variantId: ID!) {

    productVariantsBulkUpdate(variants: [

    {

    id: $variantId,

    barcodes: [

    { value: "012345678905", type: UPC }, // keep UPC as first

    { value: "4006381333931", type: EAN } // add EAN

    ]

    }

    ]) {

    productVariants {

    id

    barcodes { value type }

    }

    userErrors { field message }

    }

    }

    Reading barcodes – The query now supports a filter that matches any barcode on the variant:

    graphql

    query VariantsByBarcode($search: String!) {

    productVariants(first: 20, query: $search) {

    edges {

    node {

    id

    sku

    barcodes {

    value

    type

    }

    }

    }

    }

    }

    Migration Checklist

  • Audit current barcode usage – Identify all places (apps, scripts, custom apps, POS integrations) that read or write ProductVariant.barcode.
  • Add the `barcodes` field to your queries – Even if you only need the first barcode, pulling the connection future‑proofs your code.
  • Switch writes to `barcodes` input – Replace any mutation that sets barcode with one that sends an array. Remember that sending barcodes overwrites the entire set, so include all values you want to keep.
  • Handle deprecation gracefully – Continue to support the legacy barcode field for a transition period. If you receive a blank barcode value, the API will shift the next barcode into the first slot automatically.
  • Test edge cases
  • Variants with more than one barcode – ensure downstream systems read the barcodes connection, not just barcode.
  • Validation – when you declare a type, Shopify validates length, prefix, and check‑digit. Verify your data conforms, or send the value without a type to keep legacy behaviour.
  • Monitor for truncation warnings – If a third‑party integration still reads only barcode, it will see only the first entry and silently ignore the rest. Communicate the change to partners and update any sync jobs.
  • Potential Pitfalls & Tips

  • Silent truncation – As noted in the changelog, an app that only reads the old field won’t know other barcodes exist. Flag this in your logs and consider adding a fallback warning.
  • Maximum of 20 barcodes – Exceeding this limit triggers a validation error. Consolidate duplicate identifiers before sending.
  • Ordering matters – The first barcode in the array is what Shopify returns in the deprecated barcode field and what external channels (like Google Shopping) may still expect. Keep your primary identifier (usually the UPC) at index 0.
  • Versioning – Shopify will announce a removal date for ProductVariant.barcode. Keep an eye on future API version release notes and plan to retire any remaining usage before the field is removed.
  • Conclusion & Next Steps

    The ability to store multiple barcodes per variant removes a long‑standing friction point for merchants selling across channels and for developers building inventory or marketplace integrations. By updating your GraphQL queries and mutations today, you’ll unlock richer product data, reduce reliance on metafields, and future‑proof your store ahead of the eventual removal of the single barcode field.

    Ready to get started? Review the official Shopify docs for ProductVariant, ProductVariantBarcode, BarcodeInput, and BarcodeType, then run the sample mutations above in your app’s GraphQL playground. If you have questions or need help with a migration plan, drop a comment or reach out to our Shopify developer community for guidance.

    Tags
    Sources

    Related Articles

    Multi‑Currency Payouts Roll Out to Australia and France – What Shopify Merchants Need to Know
    Platform Updates

    Multi‑Currency Payouts Roll Out to Australia and France – What Shopify Merchants Need to Know

    Shopify expands Multi‑Currency Payouts to Australia and France, letting Advanced and Plus merchants receive payouts in dozens of currencies. Learn who’s impacted, how to enable the feature, and the steps developers should take.

    September 11, 20263 min
    Capture WhatsApp Opt‑Ins Directly at Checkout
    Platform Updates

    Capture WhatsApp Opt‑Ins Directly at Checkout

    Shopify now lets merchants gather WhatsApp marketing consent right at checkout, turning every purchase into a lead‑generation opportunity. Learn how to enable the feature, what developers need to know, and best practices for turning opt‑ins into revenue.

    September 10, 20264 min
    Discounts Allocator Function API Preview Ends – Immediate Actions for Developers
    Platform Updates

    Discounts Allocator Function API Preview Ends – Immediate Actions for Developers

    The Discounts Allocator Function API preview is over and the API has been removed. Learn what changed, who is impacted, and how to update your app configuration to keep deployments running smoothly.

    September 10, 20263 min
    Create and Delete Dev Stores Directly from Shopify CLI 4.8
    Platform Updates

    Create and Delete Dev Stores Directly from Shopify CLI 4.8

    Shopify CLI 4.8 introduces terminal commands to create, list, inspect, and delete development stores, giving developers full control over their Dev Dashboard environments. Learn what changed, who it impacts, and how to automate store cleanup before hitting the new 250‑store limit.

    September 9, 20264 min