Shopify Functions & APIs

Shopify Variant Barcodes: Move From barcode to barcodes

By CartStack Team4 min read

Shopify variant barcodes now support more than one value per variant. The Admin GraphQL API adds a barcodes connection on ProductVariant and deprecates the single barcode field. Nothing breaks today, but an integration that still reads barcode will quietly see only one value once a second barcode exists. This guide covers what changed, how to read and write the new field, and how to find the integrations that need attention. Checked against Shopify’s September 8, 2026 changelog and API reference for version 2026-10.

Cover graphic for Shopify variant barcodes
One variant, several identifiers. Read them all.

What Changed in Shopify Variant Barcodes

Merchants often sell a variant under several identifiers: a manufacturer UPC next to a private-label EAN, a GTIN, a reissued ISBN, or an ASIN for a marketplace listing. A variant used to hold one value, so the extras ended up in metafields, tags or outside Shopify. According to Shopify’s changelog, you can now read the full set from the barcodes connection and write it with a barcodes input on productSet, productVariantsBulkCreate and productVariantsBulkUpdate.

Each barcode can declare a type: UPC, EAN, ISBN, GTIN or ASIN. Shopify validates a typed value against that standard’s character, length, prefix and check-digit rules. If you declare no type, the value is stored exactly as sent, so untyped data keeps working.

Rules to Remember

  • A variant accepts up to 20 barcodes, each up to 255 characters.
  • The first barcode you send is what the old barcode field returns, and it sorts first in the connection.
  • One variant input cannot set both barcode and barcodes.
  • Sending barcodes replaces the variant’s entire set, so include every barcode you want to keep.
  • The barcode filter on the products and productVariants queries now matches any barcode on a variant.

Read All Variant Barcodes

Each entry has a value and a type. A null type means none was provided on write.

query VariantBarcodes($id: ID!) {
  productVariant(id: $id) {
    id
    barcode
    barcodes(first: 20) {
      nodes {
        value
        type
      }
    }
  }
}

Write Variant Barcodes

This update sets a variant’s complete list. Anything not in the array is removed.

mutation SetBarcodes($productId: ID!, $variants: [ProductVariantsBulkInput!]!) {
  productVariantsBulkUpdate(productId: $productId, variants: $variants) {
    productVariants {
      id
    }
    userErrors {
      field
      message
    }
  }
}

# variables
{
  "productId": "gid://shopify/Product/1",
  "variants": [{
    "id": "gid://shopify/ProductVariant/2",
    "barcodes": [
      { "value": "9780262033848", "type": "ISBN" },
      { "value": "B000EXAMPLE", "type": "ASIN" }
    ]
  }]
}

The identifiers above are placeholders. If a typed value fails its standard’s check-digit rules, expect a validation error in userErrors, so keep the type off values you cannot verify.

Compatibility With the Old Field

ProductVariant.barcode is deprecated, and Shopify says it keeps working for now. Reading it returns the first entry in barcodes. Writing it updates the first barcode and leaves the others untouched. A blank value clears the first barcode and promotes the next one, until none remain. Shopify says it will announce a removal date in a future post, with a full API version of notice before the field goes away.

Our Analysis: Find the Silent Truncation

The risk is silent, not loud. Shopify warns that once a second barcode exists, an integration that reads only barcode sees one value with no sign that others exist. Nothing errors. A marketplace feed, an ERP sync or a POS lookup just uses the first one.

Audit by destination. List every system that receives variant identifiers from Shopify, then check which field each one reads. Prioritize feeds where the second identifier is the one the destination needs, such as a marketplace that matches on ASIN or GTIN.

Control the first slot. Shopify notes that putting the barcode you rely on in the first position keeps unmigrated surfaces working while you move to the full set. If you cannot migrate a consumer yet, make sure its identifier stays first.

Do not write both fields. A single variant input cannot set barcode and barcodes. Pick one per code path, and prefer barcodes for anything new.

Bulk edits are destructive by design. Because barcodes replaces the set, a partial list wipes the rest. For catalog-wide updates, read first, merge, then write. For paging through large catalogs, see Shopify GraphQL Pagination, and for safe retries on writes, Shopify Idempotency Keys.

Mind your API version. The change is tied to version 2026-10. If you pin an older version, check the reference for that version before assuming the field exists.

FAQ about Shopify Variant Barcodes

Is the barcode field being removed? It is deprecated, not removed. Shopify says it will announce a removal date later, with a full API version of notice.

How many barcodes can a variant hold? Up to 20, each up to 255 characters.

Do I have to declare a type? No. Without a type, Shopify stores the value as entered. With a type, it validates against that standard.