Common batch request pattern
This section shows practical examples on how to batch insert, update, or delete products using the API. The Product Importer (PI) API allows multiple product operations to be submitted in a single request. Each entry in theentries array represents an operation—such as adding, updating, or deleting a product—identified by the method field. Below are practical examples for typical batch request patterns.
Once your request is submitted, the API responds with an
operationToken that can be used to track processing status. See below for response examples and result reporting.For details on how to structure individual
product objects, see the examples section below.Add Products
Add one or more new products in a single request.Update Products
Update attributes of existing products (e.g., price or availability).Add and Update Products
Perform both insert and update operations in a single batch.Add and Delete Products
Combine inserting new products and removing old ones in the same request.Update and Delete Products
Full mixed-method request example
The following example shows a complete request that performs both a productinsert and a delete, using the full structure of a product object:
Examples for the batch endpoint
202
Request
Response
400
Request
Response
Action
Please revise your request based on the error details and submit it again.401
Request
Assuming the user posts this payload along with an invalid bearer token.Response
Action
Request a new token from the authentication endpoint and then retry.403
Request
Assuming the current authenticated user doesn’t have the permission to manage merchant 123 (merchantId).
Response
Action
Check the credentials you used to authenticate and themerchantId, then fix and then retry.
404
Doesn’t apply to this particular route.
413
Request
Response
No body.Action
If any text field exceeds its allowed capacity, reduce its size or decrease the batch size, then retry the request.429
Request
Response
Action
Wait for the specified duration before retrying, using an exponential backoff strategy. Ensure that the number of products being sent does not exceed the default limit of 3,000 products per second per merchant.500
Request
Response
Action
Retry using an exponential back off algorithm.503
Request
Response
Action
Retry using an exponential back off algorithm.Examples for the report endpoint
200
Request
HTTP
Response
Action
The batch has been accepted, but its treatment has not started yet.200
Request
HTTP
Response
Action
The batch has been fully validated without any error.200
Request
- Assuming a batch of one product has been submitted successfully,
- Assuming that a transformation occurred on the
imageUrl, such as a prefix being added to the original URL, which could lead to potential overflow.
HTTP
Response
Action
Since Criteo applies transformations to align incoming data with its product schema, transformation failures may occur. These issues can typically be resolved by adjusting either the product definition or the transformation process.400
Request
HTTP
Response
Action
Fix the indicated error, then retry.403
Request
HTTP
Response
Action
Verify that the credentials used for this operation are authorized to access the partner’s services.404
Request
HTTP
Response
Action
The requested operation could not be found, possibly due to a significant service disruption. Criteo recommends resubmitting the entire batch to ensure successful processing.413
Request
Corrupted tokens, particularly those with overly large payloads, may lead to processing errors.Response
No body.Action
Ensure the token is well-formed and that its payload does not exceed the maximum allowed size. Generate a new token if necessary.429
Request
Assuming you may have exceeded your request limit. Criteo is throttling your traffic to prevent overload.HTTP
Response
Action
Wait for the specified duration before retrying, using an exponential backoff strategy. Since the average time to generate a report for 1,000 products is typically under 3 seconds, Criteo recommends initiating polling after 3 seconds and then applying exponential backoff for subsequent retries.500
Request
HTTP
Response
Action
Retry using an exponential backoff algorithm.503
Request
HTTP