---
title: Products
description: Send your products with POST /v1/products, and remove a product with DELETE /v1/products/{sku}.
---

Send each product of your shop to Optifeed. One product is one variant that a shopper can buy, with its own `sku`. Each order line carries the same `sku`. Optifeed keeps the products and imports them into your catalog each hour.

## Send products

`POST https://api.optifeed.com/v1/products`

Send a JSON object with a `products` list of 1 to 1,000 products.

```bash
curl https://api.optifeed.com/v1/products \
  -H "Authorization: Bearer $OPTIFEED_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "products": [
      {
        "sku": "SKU-1",
        "item_group_id": "ELBISE-1",
        "title": "Mavi Elbise",
        "description": "Pamuklu, yazlık elbise",
        "price": { "amount": "199.90", "currency": "TRY" },
        "sale_price": { "amount": "149.90", "currency": "TRY" },
        "availability": "in_stock",
        "product_link": "https://shop.example.com/p/SKU-1",
        "image_link": "https://cdn.example.com/SKU-1.jpg",
        "additional_images": [
          "https://cdn.example.com/SKU-1-2.jpg",
          "https://cdn.example.com/SKU-1-3.jpg"
        ],
        "category": "Giyim > Elbise",
        "brand": "Örnek",
        "gtin": "8690000000001",
        "color": "Mavi",
        "size": "M",
        "attributes": { "material": "Pamuk", "season": "Yaz" },
        "updated_at": "2026-11-20T14:05:00+03:00"
      }
    ]
  }'
```

The answer is `202 Accepted`:

```json
{
  "accepted": 1,
  "rejected": 0,
  "stale": 0,
  "errors": [],
  "warnings": [],
  "request_id": "6f1c0e5a-2b7d-4c1e-9a43-0d8f2c1b7e55"
}
```

`accepted` is the number of products that Optifeed stored. Read `rejected`, `stale`, `errors` and `warnings` in each answer. [Errors](/docs/api/errors#errors-and-warnings-of-records) explains each field.

## Product fields

| Field | Type | Required | Rules | When you do not send it |
| --- | --- | --- | --- | --- |
| `sku` | Text or whole number | Yes | The code of the variant in your system. It is the id of the product in your catalog. 255 characters at most. | Error `required`. |
| `item_group_id` | Text or whole number | No | The id that joins the variants of one model. 255 characters at most. | No value. |
| `title` | Text | No | 1,000 characters at most. | No value, and the warning `content_gap`. |
| `description` | Text | No | 10,000 characters at most. | No value. |
| `price` | Price | No | The normal price. See [Prices](#prices). | No value, and the warning `content_gap`. |
| `sale_price` | Price | No | The price on the product page after a shelf discount. See [Prices](#prices). | No value. |
| `availability` | Text | No | `in_stock`, `out_of_stock`, `preorder` or `backorder`. | No value, and the warning `content_gap`. |
| `product_link` | Text | No | The link of the product page. 2,000 characters at most. | No value, and the warning `content_gap`. |
| `image_link` | Text | No | The link of the main image. 2,000 characters at most. | No value, and the warning `content_gap`. |
| `additional_images` | List of text | No | The links of the other images. Each link has 2,000 characters at most. | No value. |
| `video_link` | Text | No | 2,000 characters at most. | No value. |
| `category` | Text | No | 1,000 characters at most. | No value. |
| `brand` | Text | No | 1,000 characters at most. | No value. |
| `gtin` | Text or whole number | No | 255 characters at most. | No value. |
| `color` | Text | No | 1,000 characters at most. | No value. |
| `size` | Text | No | 1,000 characters at most. | No value. |
| `attributes` | Object | No | Your other fields. See [Attributes](#attributes). | No value. |
| `updated_at` | Time | Yes | The time of the last change of the product, in ISO 8601 with an offset. 24 hours in the future at most. | Error `required`. |

- Optifeed puts no default value into a field that you do not send. For example, a product with no `availability` does not become `in_stock`.
- Optifeed checks only the length of a link. It does not open the link.
- A comma in a link of `additional_images` becomes `%2C`, so the link stays one link.

### Prices

Send `price` and `sale_price` as an object with an amount and a currency:

```json
"price": { "amount": "199.90", "currency": "TRY" }
```

- `amount` is decimal text with 2 decimals at most, from `0` to `9999999999.99`. A JSON number gets the error `amount_not_text`.
- `currency` is an ISO 4217 code of 3 letters.
- Each object needs both keys. A price that is not an object, for example `"199.90 TRY"`, gets the error `invalid_type`.

Put the shelf discount in `sale_price`. A discount that your shop gives only in the cart is a [campaign](/docs/api/campaigns#the-shelf-discount-and-the-cart-discount).

### Attributes

Send each other field of a product in `attributes`, as text. Each key of `attributes` becomes a field of your catalog, so your rules and exports can use it.

- A key next to the fields of the table that is not one of them also goes into `attributes`.
- A key with the value `null` is the same as no key.
- Each value is text of 10,000 characters at most. A number or an object gets the error `invalid_type`.
- A key has 255 characters at most. It can have letters and digits of any language, spaces, and `_ - < > . : [ ] ( ) / & # + @ % ₺ ² ™`. Another character gets the error `invalid_key`.
- The same key next to the fields and in `attributes` gets the error `duplicate_attribute`.

These keys get the error `reserved_key`:

- the name of a field of the table, inside `attributes`,
- `cart_campaign_price`, `cart_campaign_name`, `cart_campaign_start_date` and `cart_campaign_end_date`, because Optifeed writes them from your [campaigns](/docs/api/campaigns#the-cart-price),
- `id` in uppercase or lowercase, because the `sku` is the id of the product.

## Change a product

Send the full product again with the same `sku` and a newer `updated_at`. The new product replaces the full stored product. A field that the new product does not send is removed, also an attribute.

A product that a request does not send stays in Optifeed. Only a delete removes a product. For a product that is out of stock, send `availability` with the value `out_of_stock`.

### The stale rule

Optifeed keeps the newest version of each product. It compares the `updated_at` of the product with the stored product that has the same `sku`.

- A product with an older `updated_at` is stale. Optifeed does not store it. It counts the product in `stale` and gives the warning `stale`.
- A product with the same `updated_at` replaces the stored product. So you can send a request again after a timeout.
- When one request has two products with one `sku`, Optifeed stores the product with the newest `updated_at`. The older product is stale. When the two have the same `updated_at`, the later product in the list replaces the earlier one, and both count as accepted.

## From the request to the catalog

1. Optifeed stores each accepted product before the answer.
2. Each hour, Optifeed writes all your products into one file and imports the file into your catalog. [Limits](/docs/api/limits#product-import) gives the times.
3. When the number of products falls too much, [the import guard](/docs/api/limits#the-import-guard) stops the import.

The first accepted product or campaign creates the catalog of the API in Optifeed. A request with no accepted product creates nothing. Optifeed maps the fields of the table to the fields of your catalog, so you need no mapping.

### Content gaps

Some channels need `title`, `price`, `availability`, `product_link` and `image_link`. When one of them is missing or empty, the product gets the warning `content_gap`. Optifeed accepts the product without the value. The other optional fields give no warning.

### A catalog that is not active

When the catalog of the API is not active in Optifeed, `POST /v1/products` and `DELETE /v1/products/{sku}` get `409` with the code `catalog_inactive`. Optifeed stores nothing and deletes nothing. Contact Optifeed support.

### Products that could not be added

The page of your API catalog in the web app has the section **Products that could not be added**. Open **Feed Sources**, then the feed source **Optifeed API**.

- The list has each SKU that Optifeed rejected, with the field, the code and the message of its first error, and the time.
- A later valid product with the same SKU removes its row. So send the corrected product again.
- A row stays 30 days.
- Products with no usable SKU have no row. The page gives their count for each day.

## Delete a product

`DELETE https://api.optifeed.com/v1/products/{sku}`

```bash
curl -X DELETE https://api.optifeed.com/v1/products/SKU-1 \
  -H "Authorization: Bearer $OPTIFEED_TOKEN"
```

The answer is `202 Accepted`:

```json
{
  "sku": "SKU-1",
  "deleted": true,
  "request_id": "6f1c0e5a-2b7d-4c1e-9a43-0d8f2c1b7e55"
}
```

- Encode the `sku` in the path. For example, send `ELBISE 2/M` as `ELBISE%202%2FM`. A `sku` can have a dot.
- Optifeed removes the product from its store at once. The product leaves your catalog and your exports with the next hourly file and import. So the answer is `202`, not `200`.
- A `sku` that Optifeed does not have gets `404` with the code `not_found` and `param` `sku`. A second delete of the same `sku` also gets `404`. So read `404` as "the product is not in Optifeed".
- A delete has no `updated_at`. After a delete, the next product with the `sku` is stored, also with an older `updated_at`.

## Errors and warnings

These errors refuse the full request, and Optifeed stores nothing:

| Code | Status | When |
| --- | --- | --- |
| `invalid_json` | `400` | The body is not valid JSON. |
| `invalid_batch` | `400` | The body has no `products` list, or the list is empty. |
| `batch_too_large` | `400` | The list has more than 1,000 products. |
| `payload_too_large` | `413` | The body is larger than 5 MB. |
| `catalog_inactive` | `409` | The catalog of the API is not active. |
| `not_found` | `404` | Only for `DELETE`: Optifeed does not have the `sku`. |

These codes reject one product in a `202` answer:

| Code | Example `param` | When |
| --- | --- | --- |
| `not_an_object` | `null` | The product is not a JSON object. |
| `required` | `sku`, `updated_at`, `price.amount` | A required field is missing or `null`. |
| `invalid_type` | `price`, `size`, `attributes.fit` | The value has the wrong type. |
| `too_long` | `title`, `image_link` | The value is too long. |
| `invalid_currency` | `sale_price.currency` | The currency is not an ISO 4217 code. |
| `amount_not_text` | `price.amount` | An amount is a JSON number. |
| `invalid_amount` | `price.amount` | An amount is not decimal text with 2 decimals at most. |
| `invalid_date` | `updated_at` | `updated_at` is not ISO 8601 with an offset. |
| `future_date` | `updated_at` | `updated_at` is more than 24 hours in the future. |
| `invalid_value` | `availability` | The value is not one of the permitted values. |
| `invalid_key` | `attributes.a"b` | An attribute key has a character that is not permitted, or is too long. |
| `reserved_key` | `attributes.title`, `id` | An attribute uses a reserved key. |
| `duplicate_attribute` | `season` | The key is next to the fields and in `attributes`. |

These codes keep the product:

| Code | `param` | When |
| --- | --- | --- |
| `content_gap` | `title`, `price`, `availability`, `product_link`, `image_link` | A field that a channel needs is missing or empty. |
| `stale` | `updated_at` | Optifeed has a newer version of the product, so it ignored this one. |

[Errors](/docs/api/errors) gives the codes of the access token, the company and the rate limit.
