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.
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 commercetools Composable Commerce. Since the Import API does not duplicate the validation logic of the HTTP APIs, a successful reference resolution does not imply the data consistency in the Project (cf. the diagram). For example, the uniqueness of product variant sku's cannot be checked by the Import API but only by the HTTP APIs.
Every Import Operation is assigned with one of the following states.
Initial state assigned if the format (JSON structure and fields) meets the Import API's specification. The resource import is in progress.
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 validation constraints.
Import Request contains key references to resources that are currently not present in commercetools Composable Commerce.
Waiting for a master variant to arrive. The Product Import has required attributes and thus a master variant that provides those is required.
Resource was successfully imported.
Resource could not be imported. References were resolved, but the system could not import the data due to an internal server error and the limit of retry has been reached.
The Import state flow
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 commercetools Composable Commerce. The resource import is completed.
unresolved may be temporarily assigned.
An Import Operation in the following states requires the client's attention:
unresolved: Some referenced resources do not currently exist in commercetools Composable Commerce. This state is automatically solved if the asynchronous import progresses and the missing resources are resolved in that time.
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 Composable Commerce because of further validation constraints. Please check the errors.
rejected: References were resolved, but the system could not import the data 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.
Retrials and Time to live
- Once all the references are resolved, the system tries to import the resource 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.