What is the Minimum Set of Required Fields for Importing Products, Customers, and Orders?

Table of Content

what-is-the-minimum-set-of-required-fields-for-importing-products-customers-and-orders
0 comments

You can import any type of data into Magento, but in order to create a new record in the database, you need to provide certain information. The import file must contain a minimum set of mandatory fields. For example, it’s impossible to import orders without specifying products or import customers without their names. 

Today, we'll talk about the minimum set of Magento 2 product import required fields as well as other mandatory fields you'll need to import customers and orders.

To get a better understanding of how it works, here are the sample files you can fill out as you read the guide:

Import Orders →
Import Products →
Import Customers → 

What does the required data range depend on? 

There are several types of import behavior in Magento — Add/Update, Replace, Delete (using our extension you can also choose Only Add / Only Update). If you want to update data in already existing records (for example, you have a file with new prices, and you want to import this file, because it’s too time-consuming to update each product manually), the number of required fields will be much lower as the record already exists. If you choose the Add  behavior (you want to create a new file), then you will have to specify much more information. 

It also depends a lot on what exactly you are importing. Importing orders requires its own unique set of fields, different from importing products. 

How does it work in the Amasty Import/Export extension?

This extension has a tree structure: you select the main entity and its fields, and then include smaller sub-entities, depending on what data from the file you need to import into Magento.

magento import export structure

There is a special setting in our extension that automatically activates the necessary sections and fields for importing so that you can understand which blocks must be filled in. 

Let's see how this works using an example of importing products:

1. go to Import ProfilesAdd New ProfileImport Settings 

2. and select the Import Behavior here:

magento 2 autofill

  • Add/Update — the extension will compare product IDs from the import file with the already existing products in your Magento instance. If a product ID is unique, a new product will be created. The extension will change/add the data specified in the import file if there is already a product with this ID.
  • Only Add — the extension will import products with new IDs and skip existing ones.
  • Only Update — the extension will update the information in the existing products and skip non-existing ones.
  • Delete — the extension will delete the products specified in the import file from Magento.

3. Move the toggle to Yes in the Enable Autofill for Typical Use Cases option.

This option adds all required fields to the Fields Configuration tab. Note that this functionality is available only when creating a new profile. 

Finally, make sure that the fields that were added are in the file. If everything is okay, set up field mapping and validate.

Set of entities and fields

Importing consists of several steps for each of which you need to specify various data. 

Let's review the main entities, what mandatory fields they have, and what data should be stored in each of them. 

Import Orders →

Import Customers → 

Import Products →

Order

You will need to specify the following blocks of fields:

  • Order (root entity)
  • Order Item
  • Order Payment
  • Order Shipping Address 
  • Order Billing Address

magento orders

Each block has its own set of minimum required fields. Here’s what you need to specify in each of them:

Magento field to enableData to Specify
store_idThis is a foreign key that links to the store table, specifying which Magento store view is associated with the order.
increment_idUnique identifier for referring to the order, commonly known as the order_id. Most often used for connecting with external sources, such as Google Ecommerce.
sales_order_item.order_idThe unique identifier for the order associated with the order item.
sales_order_item.qty_orderedThe number of units of the product that are included in this specific order.
sales_order_item.priceThe price of a single unit of the order item.
sales_order_item.base_priceThe price of an individual unit of a product at the time of sale after catalog price rules, tiered discounts, and special pricing is applied and before any taxes, shipping, or cart discounts are applied, featured in the base currency of the store.
sales_order_item.row_totalThe total value of the order item, calculated with this formula: Row Total = ((ordered item price * ordered item Qty) + Tax) - Discount
sales_order_item.base_row_totalRow total specified in the base currency.
sales_order_shipping_address.parent_idThe identifier of the original order in case it has been edited from the backend.
sales_order_shipping_address.region_idIdentifies the region (usually state or province) associated with the shipping address for the order.
sales_order_shipping_address.address_typeIndicates the address is used for shipping purposes.
sales_order_shipping_address.emailThe email address associated with the shipping address for the order.
sales_order_billing_address.parent_idThe identifier of the original order in case it has been edited from the backend.
sales_order_billing_address.region_idIdentifies the region (usually state or province) associated with the billing address for the order.
sales_order_billing_address.address_typeIndicates that the address is used for billing purposes.
sales_order_billing_address.emailThe email address associated with the customer's billing address for the order.
sales_order_payment.parent_idRefers to the identifier of the original order if the payment details were modified or updated in the backend.
sales_order_payment.methodSpecifies the payment method used for the order.

Customer

When importing customers, you only need to specify the root entity for the correct import. The others are optional. 

magento customers

Customer (root entity)

Magento field to enable

Data to specify

entity_id

The unique identifier of a customer for the table.

email

The customer’s email address.

website_id

Identifies the specific website for installations with multiple websites.

group_id

Determines the customer group associated with the registered account.

store_id

Determines which Magento store view is associated with the account.

firstname

Indicates the customer’s first name.

lastname

Indicates the customer’s last name.

 

If you want to import customer groups, the file must contain the following fields: 

Magento field to enable

Data to specify

customer_group_id

The unique identifier of a customer group for the table.

tax_class_id

The identifier of the tax class attribute that will be assigned to the group.

customer_group_code

The text value for the customer group (e.g. General) 

 

Product

Product importing is most complicated because there are different types of products – and you have to import them in different ways. To import Configurable Products, you must first migrate Simple ones. Only when all Simple Products are imported, you can start importing the Configurable ones.

Simple Products

The only thing you need to import Simple Products is to specify the root block: 

magento simple products

Product (root entity)

Magento field to enable

Data to specify

entity_id

The unique identifier of a product for the table.

attribute_set_id

Assigns the product to a specific attribute set or product template, according to the product type.

type_id

Indicates the product type. Values are:

  • simple — tangible items that are generally sold as single units or in fixed quantities;
  • grouped — a group of separate products that are sold as a set;
  • configurable — a product with multiple options that the customer should select before making a purchase. Inventory can be managed for each set of variations because they feature a separate product with a unique SKU. For example, a combination of color and size for a configurable product is associated with a unique SKU in the catalog;
  • virtual — a non-tangible product that does not require shipping and is not kept in inventory. These can be services, memberships, and subscriptions;
  • bundle — a customizable set of simple products sold together.

sku

The Stock-Keeping Unit is a unique, alphanumeric identifier that is used to track inventory. An SKU can be up to 64 characters in length. For example: sku123

Note that an SKU longer than 64 characters causes failure of importing.

has_options

1 — if the product has the options (for example, specify 1 for configurable products)/

0 — the product doesn’t have options.

required_options

1 — if the product has required options;

0 — the product doesn’t have required options.

Configurable Products

After the Simple Products have been successfully added, you can import the Configurable Products. To do this, you need to specify the following blocks: 

  • Product (root entity)
  • Configurable Product Super Attribute
  • Configurable Product Super Attribute Link

magento configurable products

So, at this step, you need to include the following fields and specify the data shown below:

Product (root entity)

Magento field to enable

Data to specify

attribute_set_id

The unique identifier of an attribute set for the table.

type_id

Indicates the product type. Values are:

  • simple — tangible items that are generally sold as single units or in fixed quantities;
  • grouped — a group of separate products that are sold as a set;
  • configurable — a product with multiple options that the customer should select before making a purchase. Inventory can be managed for each set of variations because they feature a separate product with a unique SKU. For example, a combination of color and size for a configurable product is associated with a unique SKU in the catalog;virtual — a non-tangible product that does not require shipping and is not kept in inventory. These can be services, memberships, and subscriptions;
  • bundle — a customizable set of simple products sold together.

sku

The Stock-Keeping Unit is a unique, alphanumeric identifier that is used to track inventory. An SKU can be up to 64 characters in length. For example: sku123

Note that an SKU longer than 64 characters causes failure of importing.

has_options

1 — if the product has the options (for example, specify 1 for configurable products)/

0 — the product doesn’t have options.

Configurable Product Super Attribute

Magento field to enable 

Data to specify

product_super_

attribute_id

The attribute ID of a configurable product variation.

product_id

The ID of the configurable product.

attribute_id

The ID of the linked attribute.

position

Determines the position of the associated product when listed with other associated products.

 

Configurable Product Super Attribute Link

Magento field to enable

Data to specify

product_id

The ID of the simple product.

parent_id

The ID of the configurable product.

sku

The SKU of a single product.

Pricing 

Let’s proceed with the Pricing. You can Import Pricing using the Customer Group Price block. 

magento price

In case of pricing, you will need to complete the following fields:

Magento field to enable

Data to specify

value_id

The unique identifier of the price group for the table.

all_groups

1 - if the price group applies to all customer groups;

0 - if the price group applies to specific customer groups.

customer_group_id

Determines the customer group identifier for which the pricing should be applied;

0 - for all groups. 


If you need it for a specific group, specify the ID of the desired one.  

qty

The quantity of the product that must be ordered to apply the specified price. 

value

The price that should be applied if the required quantity is ordered.

website_id

Identifies a specific website where the product is available (for installations with multiple websites). If blank, the product is available on all websites.

Product Category

The next entity you can import is Product Category. To import categories, you need to enable the following entities: 

  • Product Category
  • Product Category Attribute

magento categories

After that, complete the fields with the data below:

Product Category

Magento field to enable

Data to specify

entity_id   

The unique identifier of the category for the table.

path 

The path according to the category tree. E.g. 1/2/20/22

position 

Determines the position (sort order) of the category.

children_count 

The number of subcategories included in the parent one.

Product Category Attribute

Magento field to enable  

Data to specify

name

The title of the category.

available_sort_by

The parameter to use for the sorting in the category, e.g. Position, Product Name, Price.

default_sort_by

The default parameter to use for the sorting in the category, e.g. Position, Product Name, Price.

filter_price_range

The parameter is specified as the price step of the layered navigation.

Importing is a complicated process, and we hope we've managed to make it a little easier and clearer for you. 

If you still have any questions, don't hesitate to ask them in the comments below.

Stay tuned, we are already working on the following useful articles about import/export! 

 

Special thanks to Pavel Gabrusevich for his help in creating the article.

July 8, 2022
July 11, 2022
July 1, 2022
Comments
Leave your comment

Your email address will not be published

This blog was created with Amasty Blog Pro

This blog was created with Amasty Blog Pro

Loading