BETA

Importing Product Types

This endpoint can be used to import Product Type data to create and update ProductTypes in a commercetools Project. The Product Type data to import is represented by ProductTypeImport and loaded in ProductTypeImportRequest, which is posted to import ProductTypes.

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

Representations

ProductTypeImportRequest

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

type
String
"product-type"

The product type import resource type.

resources

The product type import resources of this request.

MaxItems: 20
Example: json
{
"type" : "product-type",
"resources" : [ {
"key" : "sample",
"name" : "test_product_type",
"description" : "Test product type.",
"attributes" : [ {
"name" : "product-ref-attribute",
"label" : {
"en" : "selling product"
},
"isRequired" : false,
"isSearchable" : false,
"type" : {
"name" : "reference",
"referenceTypeId" : "category"
},
"attributeConstraint" : "Unique",
"inputTip" : {
"en" : "product input tip"
},
"inputHint" : "SingleLine"
} ]
} ]
}

ProductTypeImport

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

key
String
name
String

Maps to ProductType.name.

description
String

Maps to ProductType.description.

attributes
Array of AttributeDefinition

The attributes of ProductType.

Import ProductTypes

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

POST
https://import.{region}.commercetools.com/{projectKey}/product-types/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: