Optifeed API
Testing
Check an access token with GET /v1/health, test a write request with a dry run, and check your integration before you go live.
Check the access token
GET https://api.optifeed.com/v1/health
curl https://api.optifeed.com/v1/health \
-H "Authorization: Bearer $OPTIFEED_TOKEN"
The answer is 200 OK:
{
"status": "ok",
"request_id": "6f1c0e5a-2b7d-4c1e-9a43-0d8f2c1b7e55"
}
- The health endpoint checks the access token and the company. It gives the same
401and403codes as the other endpoints. Errors gives each code. - It does not change your data.
- It does not check the catalog of the API, so it never gives
catalog_inactive. - It counts in the rate limit of the API user.
Test a write request with a dry run
Add ?dry_run=true to a write request. Optifeed checks the request and each record, and gives the answer of a real request. It stores nothing.
You can test each write endpoint:
POST /v1/orders,POST /v1/customers,POST /v1/productsandPOST /v1/campaignsDELETE /v1/products/{sku},DELETE /v1/customers/{id}andDELETE /v1/campaigns/{id}
This request sends one valid order and one order with a JSON number as total:
curl "https://api.optifeed.com/v1/orders?dry_run=true" \
-H "Authorization: Bearer $OPTIFEED_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"orders": [
{
"id": "A-1",
"created_at": "2026-11-20T14:05:00+03:00",
"updated_at": "2026-11-20T14:05:00+03:00",
"currency": "TRY",
"total": "199.90",
"customer": { "id": "C-9" },
"line_items": [{ "sku": "SKU-1", "quantity": 1 }]
},
{
"id": "A-2",
"created_at": "2026-11-20T15:10:00+03:00",
"updated_at": "2026-11-20T15:10:00+03:00",
"currency": "TRY",
"total": 199.9,
"customer": { "id": "C-10" },
"line_items": [{ "sku": "SKU-1", "quantity": 1 }]
}
]
}'
The answer is 202 Accepted, with "dry_run": true:
{
"accepted": 1,
"rejected": 1,
"stale": 0,
"errors": [
{
"position": "orders[1]",
"id": "A-2",
"param": "total",
"code": "amount_not_text",
"message": "Send the amount as decimal text, for example \"199.90\", not as a JSON number."
}
],
"warnings": [],
"dry_run": true,
"request_id": "6f1c0e5a-2b7d-4c1e-9a43-0d8f2c1b7e55"
}
What a dry run checks
- The access token, the company and the rate limit.
- The size of the body, the JSON and the list.
- Each record, with the errors and the warnings of a real request.
- For products and campaigns: the state of the catalog. A catalog that is not active gives
409withcatalog_inactive. - For a
DELETE: theskuor theid. The answer is the202or the404of a real delete.
What a dry run does not do
- It stores no record and deletes no record.
- It creates no catalog and starts no background job.
- It does not compare the records with the stored records. So
staleis always0, and no product gets the warningstale. A real request can then count some records as stale, andacceptedcan be lower. - It does not wait for the orders of your company, so it never gives
order_log_busy.
Rules of the parameter
- Send
dry_runonly in the query string. Optifeed ignores adry_runkey in the JSON body. - Send only
trueorfalse. Another value, for exampledry_run=1ordry_runwith no value, gets400with the codeinvalid_dry_run. Optifeed then stores nothing. dry_run=falseis a real request.GET /v1/healthignoresdry_run.- A dry run counts in the rate limit. Optifeed keeps the record of the request, with a mark that it was a dry run.
Before you go live
Check each item before your system sends live data:
- Each system has its own API user. The client secret is only on your server.
- Your system uses one access token for its full hour, and signs in again after
token_expired. - Each request has 1,000 records at most and 5 MB at most.
- Each amount is decimal text, and each time has a time zone offset.
- The
updated_atof a record is newer after each change, and never more than 24 hours in the future. - Your system reads
rejected,stale,errorsandwarningsof each202answer, and logs therequest_id. - Your system sends the same request again after an error with
retryable: true, for examplerate_limitedororder_log_busy. After429, it waits for the seconds inRetry-After. - After a record error, your system corrects the record before it sends the record again.
- Your system reads a
404of aDELETEas "the record is not in Optifeed", and does not send the delete again. - Your system sends contact hashes, never a plain email or phone number. The answers have no
invalid_hashwarning. - You read the
content_gapwarnings of your products and campaigns. - The settings of your live system do not have
dry_run=true. The answers have nodry_runfield.
