Import Containers

Import Containers serve as data containers for Import Resources.
Import Containers are the fundamental aspect of the Import API. To import resources into your Project, you create Import Requests in an ImportContainer. The system then processes the Import Resources within those Import Requests as ImportOperations.
You can view the current number of ImportOperations within an ImportContainer by getting the ImportSummary of the ImportContainer. ImportSummaries provide an aggregated summary of the status of all ImportOperations in an ImportContainer, including the number of successful and failed operations. For more ways of monitoring the status of your imports, see monitor the import process.
A maximum of 1 000 Import Containers can be created per Project. Learn more about this limit here. For more information on using Import Containers effectively for your requirements, see best practices.

Representations

ImportContainer

Contains the resources to be imported. Unless resourceType is specified, the ImportContainer can import all of the supported ImportResourceTypes.
version
Int

Current version of the ImportContainer.

key
String

User-defined unique identifier of the ImportContainer.

resourceType
The resource type the ImportContainer supports. If not present, the ImportContainer can import all of the supported ImportResourceTypes.
retentionPolicyBETA

The retention policy of the ImportContainer.

expiresAtBETA
DateTime
Date and time (UTC) the ImportContainer is automatically deleted. Only present if a retentionPolicy is set. ImportContainers without expiresAt are permanent until manually deleted.
createdAt
DateTime

Date and time (UTC) the ImportContainer was initially created.

lastModifiedAt
DateTime

Date and time (UTC) the ImportContainer was last updated.

Example: json
{
  "key": "my-import-container",
  "version": 1,
  "createdAt": "2018-02-05T09:47:16.648Z",
  "lastModifiedAt": "2018-02-05T09:47:16.649Z"
}

ImportContainerDraft

The representation sent to the server to create an ImportContainer.
key
String

User-defined unique identifier of the ImportContainer.

Pattern^[a-zA-Z0-9_-]+$
resourceType

The resource type the ImportContainer will accept. If not specified, the ImportContainer can import all of the supported ImportResourceTypes.

retentionPolicyBETA

Set a retention policy to automatically delete the ImportContainer after a defined period.

Example: json
{
  "key": "my-import-container"
}

ImportContainerPagedResponse

PagedQueryResult with results containing an array of ImportContainer.
limit
Int
Default20Minimum0Maximum500
offset
Int
Number of elements skipped.
Default0Maximum10000
count
Int

Actual number of results returned.

total
Int

Total number of results matching the query.

results
Array of ImportContainer
ImportContainers matching the query.
Example: json
{
  "limit": 20,
  "offset": 0,
  "count": 1,
  "total": 1,
  "results": [
    {
      "key": "my-import-container",
      "version": 1,
      "createdAt": "2018-02-05T09:47:16.648Z",
      "lastModifiedAt": "2018-02-05T09:47:16.649Z"
    }
  ]
}

ImportContainerUpdateDraft

The representation sent to the server when updating an ImportContainer.

version
Int

Current version of the ImportContainer.

resourceType
The resource type to be imported. If not given, the ImportContainer is able to import all of the supported ImportResourceTypes.
Example: json
{
  "version": 1,
  "resourceType": "product"
}

ImportResourceType

The resource types that can be imported.

category
The Category import resource type.
customer
The Customer import resource type.
discount-code
The Discount Code import resource type.
inventory
The Inventory import resource type.
order
The Order import resource type.
order-patch
The Order patch import resource type.
price
The Embedded Price import resource type.
product
The Product import resource type.
product-draft
The Product draft import resource type.
product-selection
The Product Selection import resource type.
product-type
The Product Type import resource type.
product-variant
The Product Variant import resource type.
product-variant-patch
The Product Variant patch resource type.
standalone-price
The Standalone Price import resource type.
type
The Type import resource type.

ImportSummary

The current status of ImportOperations in an ImportContainer.
states
The current ProcessingStates of ImportOperations in an ImportContainer.
total
Int
The total number of ImportOperations in states.
Example: json
{
  "states": {
    "processing": 3,
    "validationFailed": 0,
    "unresolved": 0,
    "waitForMasterVariant": 0,
    "imported": 2,
    "rejected": 0,
    "canceled": 0
  },
  "total": 5
}

OperationStates

The number of ImportOperations in each ProcessingState.
processing
Int
The number of ImportOperations in the processing state.
validationFailed
Int
The number of ImportOperations in the validationFailed state.
unresolved
Int
The number of ImportOperations in the unresolved state.
waitForMasterVariant
Int
The number of ImportOperations in the waitForMasterVariant state.
imported
Int
The number of ImportOperations in the imported state.
rejected
Int
The number of ImportOperations in the rejected state.
canceled
Int
The number of ImportOperations in the canceled state.
Example: json
{
  "processing": 3,
  "validationFailed": 0,
  "unresolved": 0,
  "waitForMasterVariant": 0,
  "imported": 2,
  "rejected": 0,
  "canceled": 0
}

RetentionPolicy BETA

Abstract parent type for retention policies, distinguished by the strategy field.

TimeToLiveRetentionPolicy BETA

Set a time to live retention policy for the ImportContainer.

strategy
StrategyEnum
ttl

The strategy of the retention policy. Used to determine how the ImportContainer should be retained.

config

The configuration of the time to live retention policy.

TimeToLiveConfig BETA

timeToLive
String
The time to live of the ImportContainer. Used to generate the expiresAt value of the ImportContainer. The lowest accepted value is 1h and the highest accepted value is 30d.
Pattern^(?:(d+)d|(d+)h|(d+)m)$

Get ImportContainer

GET
https://import.{region}.commercetools.com/{projectKey}/import-containers/{importContainerKey}
Retrieves an ImportContainer with the provided importContainerKey.
OAuth 2.0 Scopes:
manage_import_containers:{projectKey}view_import_containers:{projectKey}
Path parameters:
region
String
The Region in which the Project is hosted.
projectKey
String
key of the Project.
importContainerKey
String
key of the ImportContainer.
Response:
200

ImportContainer

asapplication/json
Request Example:cURL
curl --get https://import.{region}.commercetools.com/{projectKey}/import-containers/{importContainerKey} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" 
200 Response Example: ImportContainerjson
{
  "key": "my-import-container",
  "version": 1,
  "createdAt": "2018-02-05T09:47:16.648Z",
  "lastModifiedAt": "2018-02-05T09:47:16.649Z"
}

Get ImportSummary of ImportContainer

GET
https://import.{region}.commercetools.com/{projectKey}/import-containers/{importContainerKey}/import-summaries
Retrieves an ImportSummary for the ImportContainer with the provided importContainerKey.
OAuth 2.0 Scopes:
manage_import_containers:{projectKey}view_import_containers:{projectKey}
Path parameters:
region
String
The Region in which the Project is hosted.
projectKey
String
key of the Project.
importContainerKey
String
key of the ImportContainer.
Response:
200

ImportSummary

asapplication/json
Request Example:cURL
curl --get https://import.{region}.commercetools.com/{projectKey}/import-containers/{importContainerKey}/import-summaries -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
200 Response Example: ImportSummaryjson
{
  "states": {
    "processing": 3,
    "validationFailed": 0,
    "unresolved": 0,
    "waitForMasterVariant": 0,
    "imported": 2,
    "rejected": 0,
    "canceled": 0
  },
  "total": 5
}

Query ImportContainers

GET
https://import.{region}.commercetools.com/{projectKey}/import-containers

Retrieves all ImportContainers in the Project.

OAuth 2.0 Scopes:
manage_import_containers:{projectKey}view_import_containers:{projectKey}
Path parameters:
region
String
The Region in which the Project is hosted.
projectKey
String
key of the Project.
Query parameters:
sort
String
See Sorting.
The parameter can be passed multiple times.
limit
Int
Default: 20
Minimum: 0
Maximum: 500
offset
Int
Number of elements skipped.
Default: 0
Maximum: 10000
Response:
200

ImportContainerPagedResponse

asapplication/json
Request Example:cURL
curl --get https://import.{region}.commercetools.com/{projectKey}/import-containers -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
200 Response Example: ImportContainerPagedResponsejson
{
  "limit": 20,
  "offset": 0,
  "count": 1,
  "total": 1,
  "results": [
    {
      "key": "my-import-container",
      "version": 1,
      "createdAt": "2018-02-05T09:47:16.648Z",
      "lastModifiedAt": "2018-02-05T09:47:16.649Z"
    }
  ]
}

Create ImportContainer

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

Creates an Import Container in the Project.

Generates the ImportContainerCreated Event.
OAuth 2.0 Scopes:
manage_import_containers:{projectKey}
Path parameters:
region
String
The Region in which the Project is hosted.
projectKey
String
key of the Project.
Request Body:ImportContainerDraftasapplication/json
Response:
201

ImportContainer

asapplication/json
Request Example:cURL
curl https://import.{region}.commercetools.com/{projectKey}/import-containers -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA 
{
  "key" : "my-import-container"
}
DATA
201 Response Example: ImportContainerjson
{
  "key": "my-import-container",
  "version": 1,
  "createdAt": "2018-02-05T09:47:16.648Z",
  "lastModifiedAt": "2018-02-05T09:47:16.649Z"
}

Update ImportContainer

PUT
https://import.{region}.commercetools.com/{projectKey}/import-containers/{importContainerKey}
Updates an ImportContainer in the Project.
OAuth 2.0 Scopes:
manage_import_containers:{projectKey}
Path parameters:
region
String
The Region in which the Project is hosted.
projectKey
String
key of the Project.
importContainerKey
String
key of the ImportContainer.
Request Body:ImportContainerUpdateDraftasapplication/json
Response:
200

ImportContainer

asapplication/json
Request Example:cURL
curl -X PUT https://import.{region}.commercetools.com/{projectKey}/import-containers/{importContainerKey} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA 
{
  "version" : 1,
  "resourceType" : "product"
}
DATA
200 Response Example: ImportContainerjson
{
  "version": 2,
  "resourceType": "product",
  "key": "my-import-container",
  "createdAt": "2018-02-05T09:47:16.648Z",
  "lastModifiedAt": "2025-01-05T12:22:20.649Z"
}

Delete ImportContainer

DELETE
https://import.{region}.commercetools.com/{projectKey}/import-containers/{importContainerKey}

Deletes an Import Container in the Project.

Generates the ImportContainerDeleted Event.
OAuth 2.0 Scopes:
manage_import_containers:{projectKey}
Path parameters:
region
String
The Region in which the Project is hosted.
projectKey
String
key of the Project.
importContainerKey
String
key of the ImportContainer.
Response:
200

ImportContainer

asapplication/json
Request Example:cURL
curl -X DELETE https://import.{region}.commercetools.com/{projectKey}/import-containers/{importContainerKey} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
200 Response Example: ImportContainerjson
{
  "key": "my-import-container",
  "version": 1,
  "createdAt": "2018-02-05T09:47:16.648Z",
  "lastModifiedAt": "2018-02-05T09:47:16.649Z"
}