Import Requests represent how you send resources to the Import API.
resources field of an ImportRequest, and create an Import Request. The system then creates one ImportOperation per resource in the ImportRequest, and returns the initial status of the import to you in an ImportResponse.20 resources. After making the request, you can monitor the import process.200 000 ImportOperations per ImportContainer.Create Import Request
for Business Units
Creates an Import Request for Business Units.
manage_project:{projectKey}manage_business_units:{projectKey}regionString ​ | The Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
importContainerKeyString ​ | key of the ImportContainer to send this ImportRequest. |
application/jsonapplication/jsoncurl https://import.{region}.commercetools.com/{projectKey}/business-units/import-containers/{importContainerKey} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"type" : "business-unit",
"resources" : [ {
"key" : "acme-business-unit",
"name" : "ACME Business Unit",
"unitType" : "Company"
}, {
"key" : "acme-business-unit-division-a",
"name" : "ACME Business Unit: Division A",
"unitType" : "Division",
"parentUnit" : {
"key" : "acme-business-unit",
"typeId" : "business-unit"
}
} ]
}
DATA{
"operationStatus": [
{
"state": "processing",
"operationId": "252c6ed3-c668-4610-afe9-87b9255e62e0"
}
]
}for Categories
Creates an Import Request for Categories.
assets and custom omitted from a CategoryImport are removed. Include all existing values you want to keep.manage_products:{projectKey}regionString ​ | The Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
importContainerKeyString ​ | key of the ImportContainer to send this ImportRequest. |
application/jsonapplication/jsoncurl https://import.{region}.commercetools.com/{projectKey}/categories/import-containers/{importContainerKey} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"type" : "category",
"resources" : [ {
"key" : "category-to-import",
"name" : {
"en" : "Category to import"
},
"slug" : {
"en" : "category-to-import-slug"
},
"description" : {
"en" : "Description of category to import"
},
"parent" : {
"typeId" : "category",
"key" : "key-of-parent-category"
}
} ]
}
DATA{
"operationStatus": [
{
"state": "processing",
"operationId": "252c6ed3-c668-4610-afe9-87b9255e62e0"
}
]
}for Customers
Creates an Import Request for Customers.
addresses, customerGroup, and custom omitted from a CustomerImport are removed. Include all existing values you want to keep.manage_customers:{projectKey}regionString ​ | The Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
importContainerKeyString ​ | key of the ImportContainer to send this ImportRequest. |
application/jsonapplication/jsoncurl https://import.{region}.commercetools.com/{projectKey}/customers/import-containers/{importContainerKey} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"type" : "customer",
"resources" : [ {
"key" : "customer-to-import",
"customerNumber" : "12345",
"email" : "john@example.com",
"password" : "D0cEx@mpl3!2025",
"firstName" : "John",
"lastName" : "Doe",
"dateOfBirth" : "1980-01-01",
"isEmailVerified" : false,
"externalId" : "external-id-123",
"customerGroup" : {
"typeId" : "customer-group",
"key" : "customer-group-key"
},
"addresses" : [ {
"key" : "john-doe-address-key",
"streetName" : "Main Street",
"streetNumber" : "123",
"postalCode" : "12345",
"city" : "Berlin",
"country" : "DE"
} ],
"authenticationMode" : "Password"
} ]
}
DATA{
"operationStatus": [
{
"state": "processing",
"operationId": "252c6ed3-c668-4610-afe9-87b9255e62e0"
}
]
}for Discount Codes
Creates an Import Request for Discount Codes.
manage_discount_codes:{projectKey}view_discount_codes:{projectKey}regionString ​ | The Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
importContainerKeyString ​ | key of the ImportContainer to send this ImportRequest. |
application/jsonapplication/jsoncurl https://import.{region}.commercetools.com/{projectKey}/discount-codes/import-containers/{importContainerKey} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"type" : "discount-code",
"resources" : [ {
"key" : "discountCodeKey",
"code" : "Save10",
"name" : {
"en" : "Save10"
},
"cartDiscounts" : [ {
"typeId" : "cart-discount",
"key" : "cartDiscountKey"
} ],
"isActive" : false,
"groups" : [ ]
} ]
}
DATA{
"operationStatus": [
{
"state": "processing",
"operationId": "252c6ed3-c668-4610-afe9-87b9255e62e0"
}
]
}for Embedded Prices
Creates an Import Request for Embedded Prices.
country, channel, customerGroup, validFrom, validUntil, tiers, discounted, and custom, are removed. Include all existing values you want to keep. Other Prices of the ProductVariant are not changed.manage_products:{projectKey}regionString ​ | The Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
importContainerKeyString ​ | key of the ImportContainer to send this ImportRequest. |
application/jsonapplication/jsoncurl https://import.{region}.commercetools.com/{projectKey}/prices/import-containers/{importContainerKey} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"type" : "price",
"resources" : [ {
"key" : "price-key",
"country" : "DE",
"validFrom" : "2021-04-11T14:00:00.000Z",
"validUntil" : "2022-04-11T14:00:00.000Z",
"customerGroup" : {
"typeId" : "customer-group",
"key" : "customer-group-key"
},
"channel" : {
"typeId" : "channel",
"key" : "channel-key"
},
"productVariant" : {
"typeId" : "product-variant",
"key" : "red-t-shirt"
},
"product" : {
"typeId" : "product",
"key" : "t-shirt"
},
"value" : {
"type" : "centPrecision",
"currencyCode" : "EUR",
"centAmount" : 300
}
} ]
}
DATA{
"operationStatus": [
{
"state": "processing",
"operationId": "252c6ed3-c668-4610-afe9-87b9255e62e0"
}
]
}for Inventory
Creates an Import Request for InventoryEntries.
supplyChannel and custom omitted from an InventoryImport are removed. Include all existing values you want to keep.manage_products:{projectKey}regionString ​ | The Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
importContainerKeyString ​ | key of the ImportContainer to send this ImportRequest. |
application/jsonapplication/jsoncurl https://import.{region}.commercetools.com/{projectKey}/inventories/import-containers/{importContainerKey} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"type" : "inventory",
"resources" : [ {
"key" : "inventory-import-key",
"sku" : "product-variant-sku",
"quantityOnStock" : 15,
"restockableInDays" : 2,
"expectedDelivery" : "2022-06-30T14:00:00.000Z",
"supplyChannel" : {
"typeId" : "channel",
"key" : "channel-key"
}
} ]
}
DATA{
"operationStatus": [
{
"state": "processing",
"operationId": "252c6ed3-c668-4610-afe9-87b9255e62e0"
}
]
}for Products
categories, taxCategory, and product-level attributes omitted from the ProductImport are removed. Omitting attributes removes all product-level Attributes, and a partial list removes every Attribute that is not in the list.Creates an Import Request for Products.
categories, taxCategory, and product-level attributes omitted from a ProductImport are removed. Omitting attributes removes all product-level Attributes, and a partial list removes every Attribute that is not in the list. Include all existing values you want to keep. ProductVariants and Prices are not changed.manage_products:{projectKey}regionString ​ | The Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
importContainerKeyString ​ | key of the ImportContainer to send this ImportRequest. |
application/jsonapplication/jsoncurl https://import.{region}.commercetools.com/{projectKey}/products/import-containers/{importContainerKey} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"type" : "product",
"resources" : [ {
"key" : "product-key",
"name" : {
"en" : "t-shirt"
},
"productType" : {
"typeId" : "product-type",
"key" : "product-type-key"
},
"slug" : {
"en" : "t-shirt-slug"
},
"description" : {
"en" : "t-shirt-description"
},
"categories" : [ {
"typeId" : "category",
"key" : "category-key"
} ],
"taxCategory" : {
"typeId" : "tax-category",
"key" : "tax-category-key"
},
"state" : {
"typeId" : "state",
"key" : "state-key"
}
} ]
}
DATA{
"operationStatus": [
{
"state": "processing",
"operationId": "252c6ed3-c668-4610-afe9-87b9255e62e0"
}
]
}for Product Drafts
categories, and taxCategory omitted from the ProductDraftImport are removed from the Product when it is imported. Omitting the product-level attributes removes all product-level Attributes, and a partial list removes every Attribute that is not in the list. To change only part of a Product, use a narrower endpoint such as Products, Product Variant Patches, or Embedded Prices.Creates an Import Request for Products.
categories, and taxCategory omitted from a ProductDraftImport are removed. Omitting the product-level attributes field removes all product-level Attributes, and a partial list removes every Attribute that is not in the list. Include all existing values you want to keep.manage_products:{projectKey}regionString ​ | The Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
importContainerKeyString ​ | The ImportContainer used to create the new resource |
application/jsonapplication/jsoncurl https://import.{region}.commercetools.com/{projectKey}/product-drafts/import-containers/{importContainerKey} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"type" : "product-draft",
"resources" : [ {
"key" : "product-draft-key",
"name" : {
"en" : "blue shirt"
},
"slug" : {
"en" : "blue-t-shirt"
},
"productType" : {
"typeId" : "product-type",
"key" : "sample"
},
"masterVariant" : {
"key" : "master-variant-key",
"attributes" : [ {
"type" : "reference",
"name" : "product-ref-attribute",
"value" : {
"key" : "category-key",
"typeId" : "category"
}
}, {
"type" : "reference",
"name" : "product-custom-object-ref-attribute",
"value" : {
"key" : "custom-object-key",
"container" : "custom-object-container-key",
"typeId" : "key-value-document"
}
} ]
}
} ]
}
DATA{
"operationStatus": [
{
"state": "processing",
"operationId": "252c6ed3-c668-4610-afe9-87b9255e62e0"
}
]
}for Product Types
attributes are removed, and the corresponding Attribute values are deleted from all Products with the Product Type. Omitting the entire attributes removes all AttributeDefinitions. This data cannot be recovered.Creates an Import Request for ProductTypes.
attributes field removes all AttributeDefinitions. This data cannot be recovered.manage_products:{projectKey}regionString ​ | The Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
importContainerKeyString ​ | key of the ImportContainer to send this ImportRequest. |
application/jsonapplication/jsoncurl 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{
"operationStatus": [
{
"state": "processing",
"operationId": "252c6ed3-c668-4610-afe9-87b9255e62e0"
}
]
}for Product Variants
sku, attributes, images, and assets omitted from the ProductVariantImport are removed from the Product Variant. To change only some Attribute values, use Product Variant Patches. The import does not change the Embedded Prices of an existing Product Variant. A new Product Variant created by this import has no Embedded Prices, so import them separately with Embedded Prices. StandalonePrices are not affected.Creates an Import Request for ProductVariants.
sku, attributes, images, and assets omitted from a ProductVariantImport are removed. Include all existing values you want to keep. To update only some Attributes, use the Product Variant Patches endpoint.manage_products:{projectKey}regionString ​ | The Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
importContainerKeyString ​ | key of the ImportContainer to send this ImportRequest. |
application/jsonapplication/jsoncurl https://import.{region}.commercetools.com/{projectKey}/product-variants/import-containers/{importContainerKey} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"type" : "product-variant",
"resources" : [ {
"key" : "red-t-shirt",
"sku" : "red-t-shirt",
"product" : {
"key" : "t-shirt",
"typeId" : "product"
},
"isMasterVariant" : true,
"attributes" : [ {
"name" : "new",
"type" : "boolean",
"value" : true
}, {
"name" : "weight",
"type" : "number",
"value" : 12.5
} ],
"images" : [ {
"url" : "https://example.com/images/red-t-shirt-front.jpg",
"label" : "Front view",
"dimensions" : {
"w" : 1400,
"h" : 1400
}
} ],
"assets" : [ {
"key" : "red-t-shirt-size-guide",
"name" : {
"en" : "Size guide"
},
"sources" : [ {
"uri" : "https://example.com/assets/red-t-shirt-size-guide.pdf",
"contentType" : "application/pdf"
} ]
} ]
} ]
}
DATA{
"operationStatus": [
{
"state": "processing",
"operationId": "252c6ed3-c668-4610-afe9-87b9255e62e0"
}
]
}for Product Variant Patches
product field set.manage_products:{projectKey}regionString ​ | The Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
importContainerKeyString ​ | key of the ImportContainer to send this ImportRequest. |
application/jsonapplication/jsoncurl https://import.{region}.commercetools.com/{projectKey}/product-variant-patches/import-containers/{importContainerKey} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"type" : "product-variant-patch",
"patches" : [ {
"productVariant" : {
"typeId" : "product-variant",
"key" : "red-t-shirt"
},
"attributes" : {
"attribute-to-update" : {
"type" : "boolean",
"value" : true
},
"name-of-attribute-to-delete" : null,
"name-of-localized-attribute-to-update" : {
"type" : "ltext",
"value" : {
"en" : "Existing field",
"es" : null,
"de" : "Updating field"
}
},
"name-of-localized-attribute-set-to-update" : {
"type" : "ltext-set",
"value" : [ {
"en" : "Existing field",
"es" : null,
"de" : "Updating field",
"br" : "New field"
}, {
"en" : "Another Existing field",
"es" : null,
"de" : "Another Updating field",
"br" : "Another New field"
} ]
}
},
"staged" : false
} ]
}
DATA{
"operationStatus": [
{
"state": "processing",
"operationId": "252c6ed3-c668-4610-afe9-87b9255e62e0"
}
]
}for Product Selections
Creates an Import Request for Product Selections.
assignments list in a ProductSelectionImport becomes the complete set of assignments, and Products omitted from the list are removed from the Product Selection.manage_product_selections:{projectKey}view_product_selections:{projectKey}regionString ​ | The Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
importContainerKeyString ​ | key of the ImportContainer to send this ImportRequest. |
application/jsonapplication/jsoncurl https://import.{region}.commercetools.com/{projectKey}/product-selections/import-containers/{importContainerKey} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"type" : "product-selection",
"resources" : [ {
"key" : "selection-001",
"name" : {
"en" : "Featured Products",
"de" : "Empfohlene Produkte"
},
"mode" : "Individual",
"assignments" : [ {
"product" : {
"key" : "product-123",
"typeId" : "product"
},
"variantSelection" : {
"type" : "includeOnly",
"skus" : [ "SKU-1", "SKU-2" ]
}
} ]
} ]
}
DATA{
"operationStatus": [
{
"state": "processing",
"operationId": "252c6ed3-c668-4610-afe9-87b9255e62e0"
}
]
}for Product Tailoring
Creates an Import Request for Product Tailoring.
manage_products:{projectKey}regionString ​ | The Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
importContainerKeyString ​ | key of the ImportContainer to send this ImportRequest. |
application/jsonapplication/jsoncurl https://import.{region}.commercetools.com/{projectKey}/product-tailorings/import-containers/{importContainerKey} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"type" : "product-tailoring",
"resources" : [ {
"key" : "product-tailoring-key",
"store" : {
"typeId" : "store",
"key" : "store-key"
},
"product" : {
"typeId" : "product",
"key" : "product-key"
},
"name" : {
"en" : "Tailored Product Name"
},
"description" : {
"en" : "Tailored product description"
},
"slug" : {
"en" : "tailored-product-slug"
},
"publish" : false,
"variants" : [ {
"sku" : "tailored-variant-sku",
"images" : [ {
"url" : "https://example.com/image.png",
"dimensions" : {
"w" : 100,
"h" : 100
},
"label" : "Tailored image"
} ]
} ]
} ]
}
DATA{
"operationStatus": [
{
"state": "processing",
"operationId": "252c6ed3-c668-4610-afe9-87b9255e62e0"
}
]
}for Orders
Creates an Import Request for creating Orders.
manage_orders:{projectKey}regionString ​ | The Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
importContainerKeyString ​ | key of the ImportContainer to send this ImportRequest. |
application/jsonapplication/jsoncurl https://import.{region}.commercetools.com/{projectKey}/orders/import-containers/{importContainerKey} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"type" : "order",
"resources" : [ {
"orderNumber" : "order-number",
"customer" : {
"typeId" : "customer",
"key" : "order-customer-key"
},
"lineItems" : [ {
"name" : {
"en" : "abc"
},
"quantity" : 10,
"price" : {
"value" : {
"type" : "centPrecision",
"centAmount" : 100,
"currencyCode" : "EUR"
}
},
"supplyChannel" : {
"typeId" : "channel",
"key" : "supplier-channel-key"
},
"variant" : {
"productVariant" : {
"typeId" : "product-variant",
"key" : "product-key"
},
"sku" : "variant-sku"
}
} ],
"customerGroup" : {
"typeId" : "customer-group",
"key" : "customer-group-key"
},
"totalPrice" : {
"type" : "centPrecision",
"currencyCode" : "EUR",
"centAmount" : 4200
}
} ]
}
DATA{
"operationStatus": [
{
"state": "processing",
"operationId": "252c6ed3-c668-4610-afe9-87b9255e62e0"
}
]
}for Order Patches
Creates an Import Request for updating Orders.
manage_orders:{projectKey}regionString ​ | The Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
importContainerKeyString ​ | The ImportContainer used to create the resource |
application/jsonapplication/jsoncurl https://import.{region}.commercetools.com/{projectKey}/order-patches/import-containers/{importContainerKey} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"type" : "order-patch",
"patches" : [ {
"orderNumber" : "order-number",
"fields" : {
"addReturnInfo" : {
"items" : [ {
"quantity" : 1,
"lineItemId" : "1",
"comment" : "any comment",
"shipmentState" : "Advised"
} ],
"returnTrackingId" : "returnTrackingId-example",
"returnDate" : "2021-04-30T09:21:15.003Z"
},
"addDeliveries" : [ {
"items" : [ {
"id" : "4ce24c27-cce5-447c-890e-0d6b70b690be",
"quantity" : 5
} ],
"parcels" : [ {
"measurements" : {
"heightInMillimeter" : 20,
"lengthInMillimeter" : 40,
"widthInMillimeter" : 5,
"weightInGram" : 10
}
} ]
} ],
"removeDelivery" : {
"id" : "95a6e7a7-b74e-4397-b0b4-37473d2e3573"
},
"removeParcelFromDelivery" : {
"parcelId" : "98840afa-ac20-4a34-a904-88d3407e2d76"
},
"addParcelToDelivery" : {
"deliveryId" : "95a6e7a7-b74e-4397-b0b4-37473d2e3573",
"measurements" : {
"heightInMillimeter" : 20,
"lengthInMillimeter" : 40,
"widthInMillimeter" : 5,
"weightInGram" : 10
}
},
"setParcelMeasurements" : {
"parcelId" : "98840afa-ac20-4a34-a904-88d3407e2d76",
"measurements" : {
"heightInMillimeter" : 20,
"lengthInMillimeter" : 40,
"widthInMillimeter" : 5,
"weightInGram" : 10
}
},
"setParcelTrackingData" : {
"parcelId" : "98840afa-ac20-4a34-a904-88d3407e2d76",
"trackingData" : {
"carrier" : "carrier data"
}
},
"setParcelItems" : [ {
"parcelId" : "98840afa-ac20-4a34-a904-88d3407e2d76",
"items" : [ {
"id" : "4ce24c27-cce5-447c-890e-0d6b70b690be",
"quantity" : 5
} ]
} ]
}
} ]
}
DATA{
"operationStatus": [
{
"state": "processing",
"operationId": "252c6ed3-c668-4610-afe9-87b9255e62e0"
}
]
}for Standalone Prices
Creates an Import Request for Standalone Prices.
validFrom, validUntil, tiers, discounted, and custom, are removed. Include all existing values you want to keep.staged field. If the existing StandalonePrice has staged changes, every update through the Import API discards them, even if the imported value is the same. To keep the staged changes, first apply them with the Apply Staged Changes update action.manage_standalone_prices:{projectKey}view_standalone_prices:{projectKey}regionString ​ | The Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
importContainerKeyString ​ | key of the ImportContainer to send this ImportRequest. |
application/jsonapplication/jsoncurl https://import.{region}.commercetools.com/{projectKey}/standalone-prices/import-containers/{importContainerKey} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"type" : "standalone-price",
"resources" : [ {
"key" : "standalone-price-key",
"sku" : "variantSku",
"value" : {
"type" : "centPrecision",
"currencyCode" : "EUR",
"centAmount" : 100
}
} ]
}
DATA{
"operationStatus": [
{
"state": "processing",
"operationId": "252c6ed3-c668-4610-afe9-87b9255e62e0"
}
]
}for Variants
productCatalogModel set to Modular.Creates an Import Request for Variants.
productCatalogModel set to Modular.images, attributes, and assets omitted from a VariantImport are removed. Include all existing values you want to keep.manage_products:{projectKey}regionString ​ | The Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
importContainerKeyString ​ | key of the ImportContainer to send this ImportRequest. |
application/jsonapplication/jsoncurl https://import.{region}.commercetools.com/{projectKey}/variants/import-containers/{importContainerKey} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"type" : "variant",
"resources" : [ {
"key" : "variant-1",
"sku" : "VARIANT-SKU-001",
"product" : {
"typeId" : "product",
"key" : "product-1"
},
"publish" : false,
"images" : [ {
"url" : "https://example.com/images/variant-1.jpg",
"label" : "Variant image",
"dimensions" : {
"w" : 800,
"h" : 600
}
} ],
"attributes" : [ {
"name" : "color",
"type" : "text",
"value" : "blue"
} ],
"assets" : [ {
"key" : "variant-asset-1",
"sources" : [ {
"uri" : "https://example.com/assets/variant-1.mp4",
"key" : "variant-video"
} ],
"name" : {
"en" : "Variant Demo"
},
"description" : {
"en" : "Variant demo video"
},
"tags" : [ "video", "demo" ]
} ]
} ]
}
DATA{
"operationStatus": [
{
"state": "processing",
"operationId": "252c6ed3-c668-4610-afe9-87b9255e62e0"
}
]
}for Types
Creates an Import Request for Types.
manage_project:{projectKey}manage_types:{projectKey}regionString ​ | The Region in which the Project is hosted. |
projectKeyString ​ | key of the Project. |
importContainerKeyString ​ | key of the ImportContainer to send this ImportRequest. |
application/jsonapplication/jsoncurl https://import.{region}.commercetools.com/{projectKey}/types/import-containers/{importContainerKey} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"type" : "type",
"resources" : [ {
"key" : "type-key",
"name" : {
"en" : "Name of type"
},
"description" : {
"en" : "Description of type"
},
"resourceTypeIds" : [ "customer" ],
"fieldDefinitions" : [ {
"type" : {
"name" : "String"
},
"name" : "exampleStringField",
"label" : {
"en" : "Example string field."
},
"required" : false,
"inputHint" : "SingleLine"
} ]
} ]
}
DATA{
"operationStatus": [
{
"state": "processing",
"operationId": "252c6ed3-c668-4610-afe9-87b9255e62e0"
}
]
}Representations
ImportRequest
BusinessUnitImportRequest
type​ | business-unitThe resource type that can be imported. |
resources​Array of BusinessUnitImport​ | The Business Unit import resources of this request. Can contain CompanyBusinessUnitImport or DivisionBusinessUnitImport. MinItems: 1​MaxItems: 20​ |
{
"type": "business-unit",
"resources": [
{
"key": "acme-business-unit",
"name": "ACME Business Unit",
"unitType": "Company"
},
{
"key": "acme-business-unit-division-a",
"name": "ACME Business Unit: Division A",
"unitType": "Division",
"parentUnit": {
"key": "acme-business-unit",
"typeId": "business-unit"
}
}
]
}CategoryImportRequest
type​ | categoryThe resource type that can be imported. |
resources​Array of CategoryImport​ | The category import resources of this request. MaxItems:Â20​ |
{
"type": "category",
"resources": [
{
"key": "category-to-import",
"name": {
"en": "Category to import"
},
"slug": {
"en": "category-to-import-slug"
},
"description": {
"en": "Description of category to import"
},
"parent": {
"typeId": "category",
"key": "key-of-parent-category"
}
}
]
}CustomerImportRequest
type​ | customerThe resource type that can be imported. |
resources​Array of CustomerImport​ | The customer import resources of this request. MaxItems:Â20​ |
{
"type": "customer",
"resources": [
{
"key": "customer-to-import",
"customerNumber": "12345",
"email": "john@example.com",
"password": "D0cEx@mpl3!2025",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "1980-01-01",
"isEmailVerified": false,
"externalId": "external-id-123",
"customerGroup": {
"typeId": "customer-group",
"key": "customer-group-key"
},
"addresses": [
{
"key": "john-doe-address-key",
"streetName": "Main Street",
"streetNumber": "123",
"postalCode": "12345",
"city": "Berlin",
"country": "DE"
}
],
"authenticationMode": "Password"
}
]
}DiscountCodeImportRequest
type​ | discount-codeThe resource type that can be imported. |
resources​Array of DiscountCodeImport​ | The Discount Code import resources of this request. MaxItems:Â20​ |
{
"type": "discount-code",
"resources": [
{
"key": "discountCodeKey",
"code": "Save10",
"name": {
"en": "Save10"
},
"cartDiscounts": [
{
"typeId": "cart-discount",
"key": "cartDiscountKey"
}
],
"isActive": false,
"groups": []
}
]
}EmbeddedPriceImportRequest
type​ | priceThe resource type that can be imported. |
resources​Array of PriceImport​ | The price import resources of this request. MaxItems:Â20​ |
{
"type": "price",
"resources": [
{
"key": "price-key",
"country": "DE",
"validFrom": "2021-04-11T14:00:00.000Z",
"validUntil": "2022-04-11T14:00:00.000Z",
"customerGroup": {
"typeId": "customer-group",
"key": "customer-group-key"
},
"channel": {
"typeId": "channel",
"key": "channel-key"
},
"productVariant": {
"typeId": "product-variant",
"key": "red-t-shirt"
},
"product": {
"typeId": "product",
"key": "t-shirt"
},
"value": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 300
}
}
]
}InventoryImportRequest
type​ | inventoryThe resource type that can be imported. |
resources​Array of InventoryImport​ | The inventory import resources of this request. MaxItems:Â20​ |
{
"type": "inventory",
"resources": [
{
"key": "inventory-import-key",
"sku": "product-variant-sku",
"quantityOnStock": 15,
"restockableInDays": 2,
"expectedDelivery": "2022-06-30T14:00:00.000Z",
"supplyChannel": {
"typeId": "channel",
"key": "channel-key"
}
}
]
}StandalonePriceImportRequest
type​ | standalone-priceThe resource type that can be imported. |
resources​Array of StandalonePriceImport​ | The Standalone Price import resources of this request. MaxItems:Â20​ |
{
"type": "standalone-price",
"resources": [
{
"key": "standalone-price-key",
"sku": "variantSku",
"value": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 100
}
}
]
}OrderImportRequest
type​ | orderThe resource type that can be imported. |
resources​Array of OrderImport​ | The order import resources of this request. MaxItems:Â20​ |
{
"type": "order",
"resources": [
{
"orderNumber": "order-number",
"customer": {
"typeId": "customer",
"key": "order-customer-key"
},
"lineItems": [
{
"name": {
"en": "abc"
},
"quantity": 10,
"price": {
"value": {
"type": "centPrecision",
"centAmount": 100,
"currencyCode": "EUR"
}
},
"supplyChannel": {
"typeId": "channel",
"key": "supplier-channel-key"
},
"variant": {
"productVariant": {
"typeId": "product-variant",
"key": "product-key"
},
"sku": "variant-sku"
}
}
],
"customerGroup": {
"typeId": "customer-group",
"key": "customer-group-key"
},
"totalPrice": {
"type": "centPrecision",
"currencyCode": "EUR",
"centAmount": 4200
}
}
]
}OrderPatchImportRequest
type​ | order-patchThe resource type that can be imported. |
patches​Array of OrderPatchImport​ | The order patches of this request MaxItems:Â20​ |
{
"type": "order-patch",
"patches": [
{
"orderNumber": "order-number",
"fields": {
"addReturnInfo": {
"items": [
{
"quantity": 1,
"lineItemId": "1",
"comment": "any comment",
"shipmentState": "Advised"
}
],
"returnTrackingId": "returnTrackingId-example",
"returnDate": "2021-04-30T09:21:15.003Z"
},
"addDeliveries": [
{
"items": [
{
"id": "4ce24c27-cce5-447c-890e-0d6b70b690be",
"quantity": 5
}
],
"parcels": [
{
"measurements": {
"heightInMillimeter": 20,
"lengthInMillimeter": 40,
"widthInMillimeter": 5,
"weightInGram": 10
}
}
]
}
],
"removeDelivery": {
"id": "95a6e7a7-b74e-4397-b0b4-37473d2e3573"
},
"removeParcelFromDelivery": {
"parcelId": "98840afa-ac20-4a34-a904-88d3407e2d76"
},
"addParcelToDelivery": {
"deliveryId": "95a6e7a7-b74e-4397-b0b4-37473d2e3573",
"measurements": {
"heightInMillimeter": 20,
"lengthInMillimeter": 40,
"widthInMillimeter": 5,
"weightInGram": 10
}
},
"setParcelMeasurements": {
"parcelId": "98840afa-ac20-4a34-a904-88d3407e2d76",
"measurements": {
"heightInMillimeter": 20,
"lengthInMillimeter": 40,
"widthInMillimeter": 5,
"weightInGram": 10
}
},
"setParcelTrackingData": {
"parcelId": "98840afa-ac20-4a34-a904-88d3407e2d76",
"trackingData": {
"carrier": "carrier data"
}
},
"setParcelItems": [
{
"parcelId": "98840afa-ac20-4a34-a904-88d3407e2d76",
"items": [
{
"id": "4ce24c27-cce5-447c-890e-0d6b70b690be",
"quantity": 5
}
]
}
]
}
}
]
}ProductTypeImportRequest
type​ | product-typeThe resource type that can be imported. |
resources​Array of ProductTypeImport​ | The product type import resources of this request. MaxItems:Â20​ |
{
"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"
}
]
}
]
}ProductImportRequest
type​ | productThe resource type that can be imported. |
resources​Array of ProductImport​ | The product import resources of this request. MaxItems:Â20​ |
{
"type": "product",
"resources": [
{
"key": "product-key",
"name": {
"en": "t-shirt"
},
"productType": {
"typeId": "product-type",
"key": "product-type-key"
},
"slug": {
"en": "t-shirt-slug"
},
"description": {
"en": "t-shirt-description"
},
"categories": [
{
"typeId": "category",
"key": "category-key"
}
],
"taxCategory": {
"typeId": "tax-category",
"key": "tax-category-key"
},
"state": {
"typeId": "state",
"key": "state-key"
}
}
]
}ProductDraftImportRequest
type​ | product-draftThe resource type that can be imported. |
resources​Array of ProductDraftImport​ | The product draft import resources of this request. MaxItems:Â20​ |
{
"type": "product-draft",
"resources": [
{
"key": "product-draft-key",
"name": {
"en": "blue shirt"
},
"slug": {
"en": "blue-t-shirt"
},
"productType": {
"typeId": "product-type",
"key": "sample"
},
"masterVariant": {
"key": "master-variant-key",
"attributes": [
{
"type": "reference",
"name": "product-ref-attribute",
"value": {
"key": "category-key",
"typeId": "category"
}
},
{
"type": "reference",
"name": "product-custom-object-ref-attribute",
"value": {
"key": "custom-object-key",
"container": "custom-object-container-key",
"typeId": "key-value-document"
}
}
]
}
}
]
}ProductVariantImportRequest
type​ | product-variantThe resource type that can be imported. |
resources​Array of ProductVariantImport​ | The product variant import resources of this request. MaxItems:Â20​ |
{
"type": "product-variant",
"resources": [
{
"key": "red-t-shirt",
"sku": "red-t-shirt",
"product": {
"key": "t-shirt",
"typeId": "product"
},
"isMasterVariant": true,
"attributes": [
{
"name": "new",
"type": "boolean",
"value": true
},
{
"name": "weight",
"type": "number",
"value": 12.5
}
],
"images": [
{
"url": "https://example.com/images/red-t-shirt-front.jpg",
"label": "Front view",
"dimensions": {
"w": 1400,
"h": 1400
}
}
],
"assets": [
{
"key": "red-t-shirt-size-guide",
"name": {
"en": "Size guide"
},
"sources": [
{
"uri": "https://example.com/assets/red-t-shirt-size-guide.pdf",
"contentType": "application/pdf"
}
]
}
]
}
]
}ProductVariantPatchRequest
type​ | product-variant-patchThe resource type that can be imported. |
patches​Array of ProductVariantPatch​ | The product variant patches of this request. MaxItems:Â20​ |
{
"type": "product-variant-patch",
"patches": [
{
"productVariant": {
"typeId": "product-variant",
"key": "red-t-shirt"
},
"attributes": {
"attribute-to-update": {
"type": "boolean",
"value": true
},
"name-of-attribute-to-delete": null,
"name-of-localized-attribute-to-update": {
"type": "ltext",
"value": {
"en": "Existing field",
"es": null,
"de": "Updating field"
}
},
"name-of-localized-attribute-set-to-update": {
"type": "ltext-set",
"value": [
{
"en": "Existing field",
"es": null,
"de": "Updating field",
"br": "New field"
},
{
"en": "Another Existing field",
"es": null,
"de": "Another Updating field",
"br": "Another New field"
}
]
}
},
"staged": false
}
]
}VariantImportRequest
productCatalogModel set to Modular.type​ | variantThe resource type that can be imported. |
resources​Array of VariantImport​ | The Variant import resources of this request. MinItems:Â1​MaxItems: 20​ |
{
"type": "variant",
"resources": [
{
"key": "variant-1",
"sku": "VARIANT-SKU-001",
"product": {
"typeId": "product",
"key": "product-1"
},
"publish": false,
"images": [
{
"url": "https://example.com/images/variant-1.jpg",
"label": "Variant image",
"dimensions": {
"w": 800,
"h": 600
}
}
],
"attributes": [
{
"name": "color",
"type": "text",
"value": "blue"
}
],
"assets": [
{
"key": "variant-asset-1",
"sources": [
{
"uri": "https://example.com/assets/variant-1.mp4",
"key": "variant-video"
}
],
"name": {
"en": "Variant Demo"
},
"description": {
"en": "Variant demo video"
},
"tags": [
"video",
"demo"
]
}
]
}
]
}ProductSelectionImportRequest
type​ | product-selectionThe resource type that can be imported. |
resources​Array of ProductSelectionImport​ | The Product Selection import resources of this request. MaxItems:Â20​ |
{
"type": "product-selection",
"resources": [
{
"key": "selection-001",
"name": {
"en": "Featured Products",
"de": "Empfohlene Produkte"
},
"mode": "Individual",
"assignments": [
{
"product": {
"key": "product-123",
"typeId": "product"
},
"variantSelection": {
"type": "includeOnly",
"skus": [
"SKU-1",
"SKU-2"
]
}
}
]
}
]
}ProductTailoringImportRequest
type​ | product-tailoringThe resource type that can be imported. |
resources​Array of ProductTailoringImport​ | The Product Tailoring import resources of this request. MaxItems:Â20​ |
{
"type": "product-tailoring",
"resources": [
{
"key": "product-tailoring-key",
"store": {
"typeId": "store",
"key": "store-key"
},
"product": {
"typeId": "product",
"key": "product-key"
},
"name": {
"en": "Tailored Product Name"
},
"description": {
"en": "Tailored product description"
},
"slug": {
"en": "tailored-product-slug"
},
"publish": false,
"variants": [
{
"sku": "tailored-variant-sku",
"images": [
{
"url": "https://example.com/image.png",
"dimensions": {
"w": 100,
"h": 100
},
"label": "Tailored image"
}
]
}
]
}
]
}TypeImportRequest
type​ | typeThe resource type that can be imported. |
resources​Array of TypeImport​ | The type import resources of this request. MaxItems:Â20​ |
{
"type": "type",
"resources": [
{
"key": "type-key",
"name": {
"en": "Name of type"
},
"description": {
"en": "Description of type"
},
"resourceTypeIds": [
"customer"
],
"fieldDefinitions": [
{
"type": {
"name": "String"
},
"name": "exampleStringField",
"label": {
"en": "Example string field."
},
"required": false,
"inputHint": "SingleLine"
}
]
}
]
}ImportResponse
The response of each Import Request.
operationStatus​Array of ImportOperationStatus​ | The identifiers and status of the ImportOperations created by the ImportRequest. MaxItems: 20​ |
{
"operationStatus": [
{
"state": "processing",
"operationId": "252c6ed3-c668-4610-afe9-87b9255e62e0"
}
]
}