Goal: Manage every barcode of your Shopify variants in bulk. A Shopify variant can have up to 20 barcodes, for example the manufacturer's UPC, your own EAN, and an Amazon ASIN. In the Shopify admin you add them one variant at a time. With Altera you export your products, edit the barcodes in a spreadsheet, and import the file again.
Video walkthrough: Watch the step-by-step video
Prerequisites:
You have Altera installed on your Shopify store
The products and variants already exist in your store
A spreadsheet app, such as Excel or Google Sheets
Optional: a supplier sheet with barcodes in separate columns (for example UPC, EAN, and ASIN)
Step 1 - Export the products
In Altera, click New export and select Products. To export only some products, click Filters > Add filter and filter by Vendor, Tag, SKU, or another field.
The Inventory / Variants field group is selected by default. It includes the Variant Barcodes and Variant Barcodes Command columns. To make the file smaller, you can clear the other field groups and keep General for the product identifiers.
Click Start export and download the file when it's ready.
Step 2 - Learn the Variant Barcodes format
Open the file. The Variant Barcodes column has every barcode of the variant in one cell:
Barcodes are separated by a semicolon and a space:
upc:745125100012; ean:4012345200010; asin:B0CJ4KL7M2An optional type and a colon go in front of the value:
upc,ean,isbn,gtin,asin, orns_pidA value without a type is a custom barcode:
SUP-4471The first barcode in the cell is the primary barcode. Themes, feeds, and apps that read only one barcode use this one.
Shopify validates a typed barcode against its standard, for example the length and the check digit of an EAN. A value without a type is stored as written. For all the rules, see the Variant Barcodes reference.
Step 3 - Set the Variant Barcodes Command
The Variant Barcodes Command column tells the import what to do with the barcodes in the cell on the same row:
MERGE adds the barcodes in the cell to the variant's barcodes. Barcodes that the variant already has stay where they are, so the primary barcode doesn't change. This is the default when the column is missing or the cell is blank.
REPLACE makes the cell the complete set of barcodes, in that order. Use it to change the primary barcode or to remove barcodes that you leave out of the cell. A blank cell removes every barcode of the variant.
DELETE removes the barcodes in the cell from the variant. The other barcodes stay.
An export writes REPLACE on every row, because the exported cell has the complete set of barcodes. If you only add barcodes, change the command to MERGE and keep only the new barcodes in the cell.
Step 4 - Edit the barcodes
Change the Variant Barcodes cells. For example:
To add an ASIN with
MERGE, write only the new value:asin:B0CJ4KL7M2To make the EAN the primary barcode with
REPLACE, move it to the front of the cell:ean:4012345200010; upc:745125100012To remove one barcode with
DELETE, write only that value:upc:745125100012To remove every barcode with
REPLACE, leave the cell blank
Delete the rows of variants that you don't want to change.
Step 5 - Fill the barcodes from a supplier sheet (optional)
Suppliers often send barcodes in separate columns. You can join them into one Variant Barcodes cell with a formula.
On the supplier sheet, add a column that joins the barcode columns with their type and skips blank cells. In this example, the SKU is in column A, the UPC in column D, the EAN in column E, and the ASIN in column F:
=TEXTJOIN("; ", TRUE, IF(D2<>"", "upc:"&D2, ""), IF(E2<>"", "ean:"&E2, ""), IF(F2<>"", "asin:"&F2, ""))
Fill the formula down. Then, in the Variant Barcodes column of your export, look up the result by SKU. In this example, the joined barcodes are in column H of a sheet named supplier, and the Variant SKU of the export is in column G:
=XLOOKUP(G2, supplier!$A:$A, supplier!$H:$H, "")
Copy the column and paste it as values, so that the file has the barcodes and not the formulas. Set Variant Barcodes Command to REPLACE if the supplier sheet has the complete set of barcodes, or to MERGE if you want to keep the barcodes that the variants already have.
Tip: When you open a CSV file, Excel can show a 12-digit UPC as 7.45125E+11. Before you use the formula, format the barcode columns as Number with 0 decimal places. The digits are not lost.
Step 6 - Import the file
To make the import update only existing products, keep the identifier columns (ID, Handle, Variant ID, and Variant SKU), Variant Barcodes, and Variant Barcodes Command. Delete the other columns. Add a Command column with the value UPDATE on every row, so that the import never creates a product.
Save the file as CSV or Excel. In Altera, click New import, click Upload file, and select the file. Check the preview, then click Start import.
Step 7 - Check the results
When the import is complete, open the results on the job page. Every row shows whether it was updated.
If a typed barcode isn't valid, for example an EAN with a wrong check digit, Shopify rejects the whole product. Every row of that product fails with the same message, and none of its variants change. Correct the value and import the file again.
To check a variant, open the product in your Shopify admin, select the variant, and look at its Barcodes section.
Outcome
Each variant has the barcodes and types from your file. The first barcode in the cell is the primary barcode. Shopify keeps the primary barcode first and lists the other barcodes sorted by value, so their order in the admin can be different from the order in your file.
Example - Add an ASIN to two variants
This file adds an ASIN to two variants and keeps their current barcodes. The [ID] suffix tells Altera to find each product and variant by its SKU, so the file needs no other identifier column:
Variant SKU [ID] | Command | Variant Barcodes | Variant Barcodes Command |
| UPDATE |
| MERGE |
| UPDATE |
| MERGE |
To try the format on a test store, download the sample file with multiple barcodes.
Next Steps
See the Variant Barcodes Command reference for blank cells, the 20-barcode limit, and error codes
Learn how to bulk update Shopify products by SKU
Read the import best practices before a large import
