Importing Product Types

Elevate, May 20-22-2025, Miami Beach, Florida
Create and update ProductTypes in your Project.
The ProductType data to import is represented by ProductTypeImport and included in a ProductTypeImportRequest, which is imported using Import ProductTypes.
Read the Nested Attribute tutorial to learn how to create/update nested Attribute values with the Import API.

Representations

ProductTypeImportRequest

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

The resource types that can be imported.

resources
Array of ProductTypeImport

The product type import resources of this request.

MaxItems20
Example: json
{
  "type": "product-type",
  "resources": [
    {
      "key": "product-type-key",
      "name": "Product Type name",
      "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
User-defined unique identifier. If a ProductType with this key exists, it will be updated with the imported data.
MinLength2MaxLength256Pattern^[A-Za-z0-9_-]+$
name
String
Maps to ProductType.name.
description
String
Maps to ProductType.description.
attributes
The attributes of ProductType.
Example: json
{
  "key": "product-type-key",
  "name": "Product Type name",
  "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"
    }
  ]
}

Import ProductTypes

POST
https://import.{region}.commercetools.com/{projectKey}/product-types/import-containers/{importContainerKey}

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

OAuth 2.0 Scopes:
manage_products:{projectKey}
Path parameters:
region
String
The Region in which the Project is hosted.
projectKey
String

The Project key.

importContainerKey
String

The ImportContainer used to create the new resource

Request Body:ProductTypeImportRequestasapplication/json
Response:
201

ImportResponse

asapplication/json
Request Example:cURL
curl https://import.{region}.commercetools.com/{projectKey}/product-types/import-containers/{importContainerKey} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA 
{
  "type" : "product-type",
  "resources" : [ {
    "key" : "product-type-key",
    "name" : "Product Type name",
    "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"
    } ]
  } ]
}
DATA
201 Response Example: ImportResponsejson
{
  "operationStatus": [
    {
      "state": "processing",
      "operationId": "252c6ed3-c668-4610-afe9-87b9255e62e0"
    }
  ]
}