Create a product
const url = 'https://api.oletapp.com/your-store/v1/products';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"active":true,"brand_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","category_id":"","codes":[{"code":"example","type":"upc"}],"components":[{"product_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","quantity":1}],"created_at":"example","description":"example","dimension_unit":"mm","has_inventory":true,"has_variants":true,"height":1,"id":"example","image_thumb_url":"example","image_url":"https://example.com","is_composite":true,"is_gift_card":"example","length":1,"loyalty_amount":1,"name":"example","purchase_account_code":"example","retail_price":1,"sales_account_code":"example","sku":"example","suppliers":[{"id":"example","is_primary":true,"supplier_code":"example","supplier_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","supplier_name":"example"}],"tags":[{"id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","name":"example"}],"updated_at":"example","variant_attributes":[{"id":"example","name":"example","position":1}],"variant_options":["example"],"variant_parent_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","weight":1,"weight_unit":"g","width":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.oletapp.com/your-store/v1/products \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "active": true, "brand_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "category_id": "", "codes": [ { "code": "example", "type": "upc" } ], "components": [ { "product_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "quantity": 1 } ], "created_at": "example", "description": "example", "dimension_unit": "mm", "has_inventory": true, "has_variants": true, "height": 1, "id": "example", "image_thumb_url": "example", "image_url": "https://example.com", "is_composite": true, "is_gift_card": "example", "length": 1, "loyalty_amount": 1, "name": "example", "purchase_account_code": "example", "retail_price": 1, "sales_account_code": "example", "sku": "example", "suppliers": [ { "id": "example", "is_primary": true, "supplier_code": "example", "supplier_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "supplier_name": "example" } ], "tags": [ { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example" } ], "updated_at": "example", "variant_attributes": [ { "id": "example", "name": "example", "position": 1 } ], "variant_options": [ "example" ], "variant_parent_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "weight": 1, "weight_unit": "g", "width": 1 }'Creates a product, optionally with its nested codes, tags, suppliers, variant_attributes and components in the same atomic request.
-
Include
codes,tags,suppliers,variant_attributesorcomponentsto create that collection alongside the product; omit one to create none of that kind. -
tags are referenced by tag id; an unknown id is a 400.
-
supply_price is never accepted, neither on the product nor on a nested supplier.
-
variant_options is read-only and ignored if sent.
-
The write is atomic: an invalid entry in any collection creates nothing, not even the product.
-
image_url fetches the image once and imports it through the same pipeline as an admin upload; a fetch failure does not undo the product write: it answers 422 IMAGE_FETCH_FAILED with the created product in data.
-
400 VALIDATION_FAILED: a field failed validation, including a duplicate natural key within one collection, or a variant_attributes rule (more than 3 entries, a position outside 1 to 3, or a duplicate position). -
402 PRODUCT_LIMIT_REACHED: the plan’s product quota is reached. -
409 CONFLICT: the sku is already in use, or a nested code or supplier link conflicts with an existing one. -
422 UNPROCESSABLE: a codes, tags, suppliers or components cap was exceeded. -
422 IMAGE_FETCH_FAILED: the product was created but the image could not be imported.
Requires scope: catalog:write
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”object
object
object
object
object
Responses
Section titled “Responses”Create a product
object
object
object
object
The retail price. Integer minor units (cents).
Live supplier links for this product. Never carries supply_price; use the admin UI or an export for cost data.
object
This supplier link’s own id, not the supplier’s id. Distinct from supplier_id below.
Whether this is the product’s primary supplier.
This retailer’s own code for the product at this supplier, if set.
The linked supplier’s id.
The supplier name as of this document.
Tags attached to this product, with names.
object
The tag’s own id, usable to reference it elsewhere.
The tag name as of this document.
Present on a variant parent product; empty on a variant child or an ordinary product.
object
The variant attribute’s id. A variant child’s variant_options reference it as attribute_id.
The attribute name, for example Size or Colour.
Display order among this product’s variant attributes.
object
Opaque delta-sync version. Increases with every change to this document: its own fields, and the addition, removal, or edit of a code, tag link, supplier link, variant option, variant attribute, or component, including when an attached tag or supplier is itself renamed. Use it to detect updates.
Examplegenerated
{ "data": { "active": true, "brand_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "category_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "codes": [ { "code": "example", "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "type": "example" } ], "components": [ { "product_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "quantity": 1 } ], "created_at": "2026-04-15T12:00:00Z", "description": "example", "dimension_unit": "example", "has_inventory": true, "has_variants": true, "height": 1, "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "image_thumb_url": "example", "image_url": "example", "is_composite": true, "is_gift_card": true, "length": 1, "loyalty_amount": 1, "name": "example", "purchase_account_code": "example", "retail_price": 1, "sales_account_code": "example", "sku": "example", "suppliers": [ { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "is_primary": true, "supplier_code": "example", "supplier_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "supplier_name": "example" } ], "tags": [ { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example" } ], "updated_at": "2026-04-15T12:00:00Z", "variant_attributes": [ { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "position": 1 } ], "variant_options": [ { "attribute_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "attribute_name": "example", "value": "example" } ], "variant_parent_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "version": "example", "weight": 1, "weight_unit": "example", "width": 1 }}default
Section titled “default”An error response.
object
object
A machine-readable error code, e.g. VALIDATION_FAILED.
object
A plain-English sentence describing what went wrong.
Example
{ "error": { "code": "UNAUTHORIZED" }}