> ## Documentation Index
> Fetch the complete documentation index at: https://developers.criteo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrate the Product Importer API from Preview

> What to change in your integration when moving from the Preview Product Importer API to the 2027-01 stable contract.

The Product Importer API is moving from the `Preview` contract to the versioned `2027.01` stable contract. **`Preview` retires on 1 July 2027.** Every client must be migrated and validated on `2027.01` before that date.

Request bodies and catalog data are unchanged — no re-upload of your product catalog is needed. The changes are limited to paths, one response field, and the structure of error and status responses.

***

## Summary of changes

| Endpoint | What changes |
| - | - |
| **Upload** `POST .../catalog/products/batch` | Path gains `/marketing-solutions/` segment. Response token moves from `operationToken` to `data.id`. |
| **Report** `GET .../catalog/products/batch/report/{id}` | Path and parameter name change. Response restructured: data envelope, flat error lists, kebab-case codes, camelCase statuses, ISO-8601 timestamps. |
| **Statistics** `GET .../catalog/stats/merchants/{id}` | Path changes. Query parameter renamed. Response restructured: resource envelope, records array moved, string counters become JSON numbers. |

***

## 1. Update the upload call

**Old path:**

```
POST https://api.criteo.com/preview/catalog/products/batch
```

**New path:**

```
POST https://api.criteo.com/2027-01/marketing-solutions/catalog/products/batch
```

**Response change** — read the ingestion token from `data.id` instead of `operationToken`:

```diff theme={null}
- { "operationToken": "ing-a1b2c3d4" }
+ { "data": { "type": "CatalogProductsBatchReport", "id": "ing-a1b2c3d4" } }
```

The token value itself is unchanged — only the field name and envelope differ. The token has a 4-day lifetime and works on both `Preview` and `2027.01`: a token issued by either version can be used to query the report on the other.

***

## 2. Update the report call

**Old path:**

```
GET https://api.criteo.com/preview/catalog/products/batch/report/{operation-token}
```

**New path:**

```
GET https://api.criteo.com/2027-01/marketing-solutions/catalog/products/batch/report/{id}
```

The `id` path parameter takes the same token value previously passed as `operation-token`.

**Response restructuring** — the new response wraps results in a `data` envelope and aligns with Criteo's standard API conventions:

| Old | New |
| - | - |
| Flat root-level object | `data.attributes` wrapper |
| `status` values: `ACCEPTED`, `IN_PROGRESS`, `VALIDATED`, `VALIDATED_WITH_ERRORS`, `FAILED` (uppercase) | `accepted`, `inProgress`, `validated`, `validatedWithErrors`, `failed` (camelCase) |
| `importRequestTimestamp` as epoch milliseconds | ISO-8601 UTC timestamp |
| `numberOfProducts*` counts as strings | JSON numbers |
| `errorDetails[]` and `warningDetails[]` per-product error objects | `errors[]` and `warnings[]` flat arrays; omitted when empty |

**Error and warning field mapping:**

| `Preview` (`errorDetails[].errors[]`) | `2027.01` (`errors[]` and `warnings[]`) |
| - | - |
| `productId` (parent object key) | `source.productId` |
| `type` — PascalCase name (e.g. `InvalidProductUrl`) | `code` — kebab-case (e.g. `invalid-product-url`), plus `title` |
| `message` | `detail` |
| `isServerRelated: false` | `type: "validation"` |
| `isServerRelated: true` | `type: "unknown"` |
| — | `traceId` and `instance` (new in `2027.01`) |

**`Preview` report response:**

```json theme={null}
{
  "status": "VALIDATED_WITH_ERRORS",
  "importRequestTimestamp": 1601631392000,
  "numberOfProductsInTheBatch": "2",
  "numberOfProductsUpserted": "1",
  "numberOfProductsDeleted": "0",
  "numberOfProductsWithErrors": "1",
  "numberOfProductsWithWarnings": "0",
  "errorDetails": [
    {
      "productId": "sun-124",
      "errors": [
        {
          "type": "InvalidProductUrl",
          "message": "The product URL is not a valid absolute URL",
          "isServerRelated": false
        }
      ]
    }
  ]
}
```

**`2027.01` report response:**

```json theme={null}
{
  "data": {
    "type": "CatalogProductsBatchReport",
    "id": "eyJhbGciOi...",
    "attributes": {
      "status": "validatedWithErrors",
      "importRequestTimestamp": "2020-10-02T09:36:32Z",
      "numberOfProductsInTheBatch": 2,
      "numberOfProductsUpserted": 1,
      "numberOfProductsDeleted": 0,
      "numberOfProductsWithErrors": 1,
      "numberOfProductsWithWarnings": 0
    }
  },
  "errors": [
    {
      "traceId": "56ed4096f96a4944888105468efe0ec9",
      "type": "validation",
      "code": "invalid-product-url",
      "instance": "/2027-01/marketing-solutions/catalog/products/batch/report/eyJhbGciOi...",
      "title": "The product URL is invalid.",
      "detail": "The product URL is not a valid absolute URL",
      "source": { "productId": "sun-124" }
    }
  ]
}
```

Counts (`numberOfProducts*`) change from strings to JSON numbers.

***

## 3. Update the statistics call

**Old path:**

```
GET https://api.criteo.com/preview/catalog/stats/merchants/{merchant-id}
```

**New path:**

```
GET https://api.criteo.com/2027-01/marketing-solutions/catalog/stats/merchants/{merchant-id}
```

**Query parameter rename:**

```diff theme={null}
- ?lastNumHours=24
+ ?last-number-of-hours=24
```

The parameter accepts values from 1 to 1000 and defaults to 24 when omitted.

**Response restructuring** — the new response wraps results in a `data` resource:

| Old | New |
| - | - |
| `data.statisticsRecordList[]` (list wrapped in `data`) | `data.type` = `"MerchantCatalogStatistics"`, `data.id` = merchant ID, records at `data.attributes.records[]` |
| Timestamp as string | ISO-8601 UTC timestamps |
| String counters (14 count fields) | JSON numbers |

**`Preview` stats response:**

```json theme={null}
{
  "data": {
    "statisticsRecordList": [
      {
        "startDate": "2026-09-06",
        "endDate": "2026-09-07",
        "total": "125430",
        "variant": "8021",
        "displayable": "119004",
        "nonDisplayable": "6426",
        "added": "1204",
        "deleted": "311",
        "updated": "20877",
        "blacklisted": "58",
        "outOfStock": "4390",
        "missingImage": "12",
        "missingUrl": "0",
        "missingPrice": "37",
        "missingName": "0",
        "missingDescription": "941"
      }
    ]
  }
}
```

**`2027.01` stats response:**

```json theme={null}
{
  "data": {
    "type": "MerchantCatalogStatistics",
    "id": "129099",
    "attributes": {
      "records": [
        {
          "startDate": "2026-09-06T00:00:00Z",
          "endDate": "2026-09-07T00:00:00Z",
          "total": 125430,
          "variant": 8021,
          "displayable": 119004,
          "nonDisplayable": 6426,
          "added": 1204,
          "deleted": 311,
          "updated": 20877,
          "blacklisted": 58,
          "outOfStock": 4390,
          "missingImage": 12,
          "missingUrl": 0,
          "missingPrice": 37,
          "missingName": 0,
          "missingDescription": 941
        }
      ]
    }
  }
}
```

***

## Migration checklist

* [ ] Update the upload path: change `preview` version prefix to `2027-01` and add `/marketing-solutions/` segment
* [ ] Read the ingestion token from `data.id` (not `operationToken`)
* [ ] Update the report path; replace `operation-token` path param with `id`
* [ ] Update response parsing: data envelope, new status values (`accepted`/`inProgress`/`validated`/`validatedWithErrors`/`failed`), flat errors, ISO-8601 timestamps
* [ ] Update the statistics path from `/preview/catalog/stats/merchants/{id}` to `/2027-01/marketing-solutions/catalog/stats/merchants/{merchant-id}` and rename `lastNumHours` to `last-number-of-hours`
* [ ] Test on the RC before the `Preview` cutoff (1 July 2027)

> [!WARNING]
>
> Build and test your migration on `2027.01`, not on `Preview`. `Preview` keeps working until 1 July 2027.
