Processing States

Processing states indicate the status of a resource during the import process. To monitor the processing states, retrieve Import Operations or Import Summaries. Processing states are queryable at Import Operations.

Reference resolution

The references of a resource are said to be resolved when, during the asynchronous import process, all the resources referenced by the resource are found in the commercetools platform. Since the Import API does not duplicate the validation logic of the commercetools platform, a successful reference resolution does not imply the data consistency in the commercetools Project (cf. the diagram). For example, the uniqueness of product variant sku's cannot be checked by the Import API but only by the platform.

ProcessingState

Every Import Operation is assigned with one of the following states.

processing

Initial state assigned if the format (JSON structure and fields) meets the Import API's specification. The resource import is in progress.

validationFailed

Either the request payload is missing the data as per the Import API's specification or even though the references were resolved, the data does not meet the platform constraints.

unresolved

Import Request contains key references to resources that are currently not present in the platform.

waitForMasterVariant

Waiting for a master variant to arrive. The Product Import has required attributes and thus a master variant that provides those is required.

imported

Resource was successfully imported.

rejected

Resource could not be imported. References were resolved, but the system could not import the data into the platform due to an internal server error and the limit of retry has been reached.

The Import state flow

Successful states

A successful Import Operation goes through the following states:

  • processing: This is the Initial state assigned to a resource if the format (JSON structure and fields) meets the Import API's specification. This indicates that the import is in progress.
  • imported: The resource is either created or updated on the commercetools platform. The resource import is completed.

The state unresolved may be temporarily assigned.

Unsuccessful states

An Import Operation in the following states requres requires the client's attention:

  • unresolved: Some referenced resources do not currently exist in the platform. This state is automatically solved if the asynchronous import progresses and the missing resources reach the platform.
  • validationFailed: This state is assigned in two cases:
    • The format (JSON structure and fields) of the data is not valid as per the Import API specifications.
    • All the references are resolved. However, the data was not accepted by the commercetools platform because of further platform constraints. Please check the errors.
  • rejected: References were resolved, but the system could not import the data into the platform due to an internal server error and the limit of retry has been reached. Some problem with the data is likely to exist which needs to be addressed before a follow-up Import Request is made. Please check the error messages to see details about the problems with the data rejected by the platform.

Retrials and Time to live

  • Once all the references are resolved, the system tries to import the resource to the commercetools platform up to five times of retry attempts.
  • The service deletes Import Operations 48 hours after they are created. Hence, any attempt afterwards to retrieve an Import Operation by ID would result in HTTP 404 errors. You can still call Query operations to fetch all the existing ImportOperations.