Optifeed API
Products
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.
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:
{
"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 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. | No value, and the warning content_gap. |
sale_price |
Price | No | The price on the product page after a shelf discount. See 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. | 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
availabilitydoes not becomein_stock. - Optifeed checks only the length of a link. It does not open the link.
- A comma in a link of
additional_imagesbecomes%2C, so the link stays one link.
Prices
Send price and sale_price as an object with an amount and a currency:
"price": { "amount": "199.90", "currency": "TRY" }
amountis decimal text with 2 decimals at most, from0to9999999999.99. A JSON number gets the erroramount_not_text.currencyis 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 errorinvalid_type.
Put the shelf discount in sale_price. A discount that your shop gives only in the cart is a campaign.
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
nullis 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 errorinvalid_key. - The same key next to the fields and in
attributesgets the errorduplicate_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_dateandcart_campaign_end_date, because Optifeed writes them from your campaigns,idin uppercase or lowercase, because theskuis 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_atis stale. Optifeed does not store it. It counts the product instaleand gives the warningstale. - A product with the same
updated_atreplaces 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 newestupdated_at. The older product is stale. When the two have the sameupdated_at, the later product in the list replaces the earlier one, and both count as accepted.
From the request to the catalog
- Optifeed stores each accepted product before the answer.
- Each hour, Optifeed writes all your products into one file and imports the file into your catalog. Limits gives the times.
- When the number of products falls too much, 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}
curl -X DELETE https://api.optifeed.com/v1/products/SKU-1 \
-H "Authorization: Bearer $OPTIFEED_TOKEN"
The answer is 202 Accepted:
{
"sku": "SKU-1",
"deleted": true,
"request_id": "6f1c0e5a-2b7d-4c1e-9a43-0d8f2c1b7e55"
}
- Encode the
skuin the path. For example, sendELBISE 2/MasELBISE%202%2FM. Askucan 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, not200. - A
skuthat Optifeed does not have gets404with the codenot_foundandparamsku. A second delete of the sameskualso gets404. So read404as "the product is not in Optifeed". - A delete has no
updated_at. After a delete, the next product with theskuis stored, also with an olderupdated_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 gives the codes of the access token, the company and the rate limit.
