Skip to content
All posts

Magento product import: from a supplier spreadsheet to a CSV that passes Check Data

A supplier’s spreadsheet lists a duvet cover once, with Sizes: Double/King in one cell. Magento’s importer wants a row per size, attribute codes for headings, values each attribute already lists and category paths that start at the root. Here are the Import page’s settings, what each behaviour does to products already in your store, the columns that matter, two places where Adobe’s own pages disagree, and one simple and one configurable product before and after.

BeforeSizes: Double/KingDBL, KING
Aftersku=LDC-GRY-D,size=Double|sku=LDC-GRY-K,size=King
configurable_variations

Have a supplier file like this? Send it exactly as it arrived and see the same products before and after.

What a Magento product import expects

A supplier’s spreadsheet lists a linen duvet cover on one row, with Sizes: Double/King in one cell and £69/£79 in the next. A Magento product import cannot take that row as it stands. It wants a row for each size, each a simple product with its own SKU, and a configurable product row that holds them together, with a configurable_variations cell reading sku=LDC-GRY-D,size=Double|sku=LDC-GRY-K,size=King.67

The import runs from one screen in Magento Open Source and Adobe Commerce alike: System > Data Transfer > Import, with Entity Type set to Products.111 It reads a CSV, or a ZIP holding one, and “Each column heading corresponds to the Attribute Code of the field”.3 In Adobe’s attribute reference, “the sku is the only required value”, and a file can carry “only the columns with changes”.2

A new product needs more. Validation checks that every attribute the store requires has a value, and Adobe’s walkthrough for a simple product asks for a product type, an attribute set, a Product Name, a SKU and a Price.410 In the file, those are product_type, attribute_set_code, name, sku and price.2

So the work is in the spreadsheet, not on the import screen. It is the Magento end of product data enrichment.

The Import page and what Check Data checks

Adobe’s steps run in order: set Entity Type to Products, click Download Sample File, choose the behaviour and what happens on an error, choose the file, click Check Data and, if the file is valid, Import.1

SettingDefault or choicesWhat it means for a supplier file
On an errorStop on Error or Skip error entriesSkip error entries leaves invalid rows out
Allowed Errors Count10Errors allowed before the import is cancelled
Multiple value separatorA commaSplits several values in one cell, such as category paths
Empty attribute value constantThe value the screen showsWritten in a cell, it empties that value12
FileCSV, or ZIP holding a CSV; 2 MB by defaultThe Import page shows the server’s own limit
The Import page’s main settings, from Adobe’s import page and its page on CSV files.13

Check Data is the step that matters. It checks that each heading matches an attribute, that each value meets its attribute’s data type (decimal, integer, varchar, text or datetime), that values for drop-down and multiple select attributes “exist in the defined set”, and that a new product has its required values.4

Adobe’s Import API reference, for a REST import exclusive to Adobe Commerce that it says mirrors the Admin’s, is plain about skipped errors: valid rows are imported, but once errors pass the allowed count, “the import is halted (even valid rows will not be processed)”.12 Import History, under the same menu, keeps each run with an error file to download.1

Add/Update, Replace and Delete

Rows are matched to products by SKU, and the behaviour decides what a match does.1

BehaviourA SKU already in the storeA SKU not in the storeWatch for
Add/UpdateUpdated; every field but sku can changeCreatedNew categories are created too
ReplaceDeleted, then created again from the rowAn errorAll references in the system are lost
DeleteDeletedAn errorEvery column but sku is ignored
What each import behaviour does, from Adobe’s import page.1

Add/Update is the one for a supplier file, with two habits to know. It creates what it does not recognise: “New product categories that are specified in the import file are created automatically”, and new SKUs are too.1 It also cannot take a value out of a field that holds several: “Multiple field values, such as websites or categories, cannot be removed using the Add/Update import behavior.”1 A product filed in the wrong category stays there after the next import.

Replace is not a stronger update: a matching product loses “all fields, including the SKU” and is created again from the row.1 On a large catalogue, leave categories and url_key out of any update that is not changing them, because either column makes the import regenerate URL rewrites “for every product in the file”.1

The columns that matter

In Adobe’s attribute reference, the sku “should be the first column, but the order of the rest of the attributes doesn’t matter”.2

ColumnWhat goes in itThe trap
skuThe product’s code, up to 64 charactersLonger codes make the import fail
attribute_set_codeAn attribute set the store has, such as DefaultCannot be changed by import later
product_typesimple, configurable, grouped, virtual or bundleSizes need configurable and simple rows
categoriesThe path from the root: Default Category/Bedding/PillowcasesAn unknown path becomes a new category1
product_websitesWebsite codes, such as baseSeveral take a comma and no space
nameThe product nameThe default url_key is made from it
priceA bare number, as Adobe’s sample file writes itNot £29.0013
weightA bare numberThe store’s Weight Unit is lbs or kgs9
product_online1 for enabled, 2 for disabledAdobe lists no other value
visibilityCatalog, Search; or Not Visible IndividuallyThe second keeps a product out of listings
additional_attributesPairs of code=value, separated by commasCodes, not labels; listed values for drop-downs
configurable_variationsEach simple product’s sku and valuesConfigurable rows only
base_image, small_image, thumbnail_image, additional_imagesA file name in the import folder, or a full URLThe file must be there when the import runs5
The columns a supplier row maps onto, from Adobe’s product attribute reference and its example of importing configurable products.26

One rule there depends on which Adobe page you read. For a product in several categories, the attribute reference says to “separate each path with a pipe”.2 The CSV page, the Import API reference and the Import page’s own default split them with the multiple value separator, a comma, and Magento’s sample import file writes “Default Category/Gear,Default Category/Gear/Fitness Equipment”.312113 Export a product in two categories and copy what your store writes.

Where supplier files break it

These faults all arrive in the supplier’s spreadsheet, and Check Data names most of them.

Headings in the supplier’s words. Product Name, Colour, RRP. Each heading is read as an attribute code, and codes are created “in lowercase characters and without spaces”: name, color, price.38 A heading that matches nothing loses its column: the attribute “is not created and its values are not imported”, and “Imported attribute %attribute name% does not exist in the system.” is among Adobe’s validation messages.14 Supplier data onboarding sets out the map.

Category paths from the supplier’s tree. Bed Linen > Pillowcases. The path Magento wants “includes the root category, followed by a forward slash (/) between each level”: Default Category/Bedding/Pillowcases.3 Under Add/Update an unknown path is created rather than refused, so a misspelt Beding becomes a new branch of your tree.1

Sprawl is quicker to build than to undo: our own first pass spread one bathroom retailer’s 62 wall panels over 15 categories, sofas among them, before we brought them into one range. Mapping supplier categories comes before the path syntax.

Values the attribute does not list. The store’s color attribute lists Grey; the supplier writes Gray, Gry and Grey/Charcoal. Values for drop-down and multiple select attributes are checked against the attribute’s list, and “Value is not allowed. Attribute value does not exist in the system.” is among the messages.4 Fold spellings onto the store’s values first, as normalising attribute values describes, and add any genuinely new value to the attribute, under Stores > Attributes > Product, before the import.6

Symbols and units in number columns. £29.00 in price, 450g in weight. Each value is tested against its attribute’s data type, and Adobe’s sample file writes price and weight as bare numbers, 14 and 1.23.413 The unit is not in the file, so convert every weight to the store’s Weight Unit, lbs or kgs, before the unit comes off.9

Images the import cannot reach. A thumbnail, a dead link, or a file name with no file behind it. An image on the server has to be in var/import/images, or a subfolder of it, before the import; one elsewhere is written as a full URL.5 Each failure has its own message: “Imported resource (image) could not be downloaded from external resource due to timeout or access permissions.” and “Imported resource (image) does not exist in the local media storage.”4

Codes the spreadsheet has changed. Excel “automatically removes leading zeros”, and Microsoft names product codes among the values it does it to.14 Because Add/Update matches on SKU and creates any SKU it does not know, a supplier’s 004512 saved as 4512 comes in as a new product instead of updating yours.1 Adobe also warns that Excel “inserts additional characters into the column header of the CSV file”.3

Before and after: one simple product, one configurable

First, a pillowcase pair from the same file, a product with no sizes.

Magento columnSupplier sentMagento row
skuFEN-LPC-GRYFEN-LPC-GRY
attribute_set_codenot suppliedDefault
product_typenot suppliedsimple
categoriesBed Linen > PillowcasesDefault Category/Bedding/Pillowcases
product_websitesnot suppliedbase
namePILLOWCASE PAIR LINEN GREYFenwald Linen Pillowcase Pair, Grey
price£29.0029.00
weight450g0.45
product_onlineLive1
visibilitynot suppliedCatalog, Search
qtyIn stockno number given
additional_attributesColour: GREY / Fabric: 100% linencolor=Grey,material=Linen
base_imageFEN-LPC-GRY_thumb.jpgfull URL of the full-size original
A pillowcase pair as sent and as a Magento row. Attribute set, website and visibility follow Adobe’s sample file; the weight assumes a store set to kgs, and additional_attributes a store whose color and material attributes list Grey and Linen.132

In stock is the one cell that needs a person: it is not a quantity, and no rule makes it one.

The duvet cover changes shape. The supplier sent one row, LDC-GRY, with Sizes: Double/King and £69/£79; Magento wants “a separate row for each simple product variation, and one row for the configurable product”.6

skuproduct_typenamevisibilitypriceadditional_attributes
LDC-GRY-DsimpleFenwald Linen Duvet Cover, Grey, DoubleNot Visible Individually69.00color=Grey,size=Double
LDC-GRY-KsimpleFenwald Linen Duvet Cover, Grey, KingNot Visible Individually79.00color=Grey,size=King
LDC-GRYconfigurableFenwald Linen Duvet Cover, GreyCatalog, Search69.00none
One supplier row as two simple products and a configurable one. The configurable row’s price is overridden by the simple products’ prices.7

The configurable row also carries configurable_variations: sku=LDC-GRY-D,size=Double|sku=LDC-GRY-K,size=King. “Each SKU is separated by a pipe symbol (|), and attributes are separated by a comma”, each written as its code, size, “rather than the attribute label”.6 Not Visible Individually keeps a simple product out of listings, “although it might be available as a variation of another product”.2

Three things decide whether the rows join up. Two are in the attribute. The varying attribute “must have a global scope”, must require shoppers to choose a value, must be a Dropdown, Visual Swatch or Text Swatch, and must be in the product’s attribute set.7 Double and King must already be on its list.4

The third is names. Give each simple product one of its own: the default url_key is made from the name, “URL key for specified store already exists” is among Adobe’s messages, and Adobe’s example changes sku, name, url_key and additional_attributes on every new variation.246 Variants: size and colour covers what counts as a variation.

Preparing the file, step by step

  1. Export before you build. Export a few of your own products, a configurable one among them, and keep the header row: Adobe’s advice is to “first export the data from your store as a CSV file”.3
  2. Open the supplier’s file without letting Excel convert it. Load it through Data > From Text/CSV and set the code columns to Text, as Microsoft describes.14
  3. Map every heading to an attribute code, or to nothing, and create any missing attribute, with its options, first: the import cannot add one.38
  4. Give every row the basics that Adobe’s sample file gives its simple products: sku, attribute_set_code, product_type, product_websites, name, price, product_online and visibility.13
  5. Rewrite the values. Categories become whole paths from the root, values are folded onto each attribute’s list, compound cells such as Colour: GREY / Fabric: 100% linen are split, and weights are converted to the store’s Weight Unit before symbols and units come off.349
  6. Lay sizes out as simple rows and one configurable row, with configurable_variations naming every simple product.6
  7. Put images where the import can reach them. Server files go into var/import/images and arrive in a second file that “must include only the sku column and the related image columns”; images elsewhere go in as full URLs.5
  8. Save as UTF-8 and run Check Data on a few products first. Adobe supports UTF-8 and Windows-1252, and warns that a UTF-8 file with a byte order mark may not be recognised. After configurable products, refresh the invalid caches under Cache Management.416

What to do next

Part of that work is what RefynData’s product data enrichment service does with a supplier file: each SKU or barcode is matched to the real product, every item is filed into your own category tree, compound cells are split, spellings are folded onto one value, measures are converted to one unit and the full-size original is found behind each thumbnail, with every value linked to its source. We prepare supplier spreadsheets for Magento: the file comes back laid out for Magento’s own importer, and nothing goes live without your sign-off.

Export a product of each kind first and build on its header row. Run Check Data on a handful of products before the rest, and keep the map from the supplier’s headings to your attribute codes: the next delivery will bring the same headings and the same Sizes: Double/King.

Questions

What fields are required for a Magento 2 product import?

To update products, you only need sku plus the columns that change. A new product also needs every attribute the store requires: Adobe’s walkthrough for a simple product asks for a product type, an attribute set, a name, a SKU and a price, which in the file are product_type, attribute_set_code, name, sku and price.

Where can I get a sample CSV for a Magento product import?

On the Import page, set Entity Type to Products and click Download Sample File. A better template is an export of a few of your own products, configurable ones included, because it carries your store’s own attribute codes, attribute sets and category paths.

How do I import product images with a Magento 2 CSV?

Upload the files to var/import/images on the server and write each file name in base_image, small_image, thumbnail_image or additional_images, with commas between additional images. Adobe says that file must hold only sku and the image columns. Images on another server go in the same columns as full URLs.

How do I import configurable products in Magento 2?

Give each size or colour its own simple product row, set to Not Visible Individually, and add one configurable row whose configurable_variations cell lists each simple product’s sku and values, with a pipe between products. The attributes that vary must be global, required, a drop-down or swatch type and in the product’s attribute set.

Does a Magento import overwrite existing products?

Add/Update changes every field the file carries for a matching SKU except the SKU itself, and creates any new SKU or category. Replace deletes a matching product and creates it again from the row. Adobe’s pages disagree on whether an empty cell clears a value, so send only the columns you mean to change.

Sources

  1. Adobe Experience League. Import data.
  2. Adobe Experience League. Product data attributes reference.
  3. Adobe Experience League. CSV data files.
  4. Adobe Experience League. Data transfers.
  5. Adobe Experience League. Product image import.
  6. Adobe Experience League. Import configurable products.
  7. Adobe Experience League. Configurable product.
  8. Adobe Experience League. Create and delete product attributes.
  9. Adobe Experience League. General > General (Configuration Reference).
  10. Adobe Experience League. Simple product.
  11. Adobe Experience League. Adobe Commerce Admin User Guides.
  12. Adobe Developer. Import API.
  13. Magento Open Source on GitHub. catalog_product.csv, the sample product import file in Magento Open Source 2.4.9.
  14. Microsoft Support. Keeping leading zeros and large numbers.

Try it on a fileyour supplier sent

Nothing goes live without your sign-offEvery value keeps its sourceYour data is never shared

Send one supplier spreadsheet exactly as it arrived. We will show you the same products before and after, with a source on every value we add.

One email with the upload link. Nothing else lands in your inbox.