BETA

Importing Products

The Product Import endpoint can be used to import Product data without Product Variant or Price information. The data to import is represented by ProductImport and loaded in ProductImportRequest, which is posted to import Products.

To import Product data with Product Variants and Prices in one import request, the ProductDraft Import endpoint is available. However, as the present endpoint has a smaller payload, generally a faster performance can be expected when Product Variant and Price information is not involved.

To monitor an import status, use Get ImportSummary, Get ImportOperation, and Query ImportOperations.

Representations

ProductImportRequest

The request body to import Products. Contains data for Products to be created or updated in a commercetools Project.

type
String
"product"

The product import resource type.

resources
Array of ProductImport

The product import resources of this request.

MaxItems: 20
Example: json
{
"type" : "product",
"resources" : [ {
"key" : "t-shirt",
"name" : {
"en" : "t-shirt"
},
"productType" : {
"typeId" : "product-type",
"key" : "sample"
},
"slug" : {
"en" : "t-shirt-slug"
},
"description" : {
"en" : "t-shirt-description"
},
"categories" : [ {
"typeId" : "category",
"key" : "greatTestCat"
} ],
"metaTitle" : {
"en" : "title"
},
"metaDescription" : {
"en" : "description"
},
"metaKeywords" : {
"en" : "Keywords"
},
"taxCategory" : {
"typeId" : "tax-category",
"key" : "tax-category-key"
},
"state" : {
"typeId" : "state",
"key" : "state-key"
}
} ]
}

ProductImport

The data representation for a Product to be imported that is persisted as a Product in the Project.

This is the minimal representation required for creating a Product in commercetools.

key
String
name

Maps to Product.name.

productType

The productType of a Product. Maps to Product.productType. The Reference to the ProductType with which the Product is associated. If referenced ProductType does not exist, the state of the ImportOperation will be set to unresolved until the necessary ProductType is created.

slug

Human-readable identifiers usually used as deep-link URL to the related product. Each slug must be unique across a Project, but a product can have the same slug for different languages. Allowed are alphabetic, numeric, underscore (_) and hyphen (-) characters.

description

Maps to Product.description.

categories

Maps to Product.categories. The References to the Categories with which the Product is associated. If referenced Categories do not exist, the state of the ImportOperation will be set to unresolved until the necessary Categories are created.

metaTitle
metaDescription
metaKeywords
taxCategory

The Reference to the TaxCategory with which the Product is associated. If referenced TaxCategory does not exist, the state of the ImportOperation will be set to unresolved until the necessary TaxCategory is created.

searchKeywords
SearchKeywords

The Reference to the State with which the Product is associated. If referenced State does not exist, the state of the ImportOperation will be set to unresolved until the necessary State is created.

publish
Boolean

If publish is set to either true or false, both staged and current projections are set to the same value provided by the import data. If publish is not set, the staged projection is set to the provided import data, but the current projection stays unchanged. However, if the import data contains no update, that is, if it matches the staged projection of the existing Product in the platform, the import induces no change in the existing Product whether publish is set or not.

Import Products

Creates a request for creating new Products or updating existing ones.

POST
https://import.{region}.commercetools.com/{projectKey}/products/import-containers/{importContainerKey}
OAuth 2.0 Scopes:
manage_products:{projectKey}
Path parameters:
region
String

The Region in which the Project is hosted.

projectKey
String

The commercetools Project key.

importContainerKey
String

The ImportContainer used to create the new resource

Response: