Skip to navigation

Create a product

View as Markdown

Creates a product the way the admin does: the same defaults, a unique page address, the plan’s product limit (409 plan_limit). Images are added in the admin. Requires products:write. Send an Idempotency-Key header to make a retry safe.

Authentication

AuthorizationBearer

An API key from the store’s admin: חנות > API ומפתחות. Send it as Authorization: Bearer coi_sk_... (or X-Api-Key: coi_sk_...). Never in the URL - ?apikey= is refused with 400.

Headers

Idempotency-KeystringOptional<=255 characters

Any unique string. A retry with the same key within 24 hours gets the first answer again (header Idempotent-Replayed: true) instead of a second product.

Request

This endpoint expects an object.
namestringOptional<=200 characters
pricedoubleOptional>=0
oldPricedoubleOptional>=0
deliveryPricedoubleOptional>=0
costdoubleOptional>=0
stockdouble or nullOptional>=0

null = not counted.

categoryIdslist of integersOptional

Ids of this store’s product categories (see categoryIds on any product). Replaces the product’s categories.

skustringOptional<=50 characters
internalSkustringOptional<=50 characters
activebooleanOptionalDefaults to true
urlNamestringOptional<=200 characters

The page address. Made from the name on create when not sent; kept unique among the store’s pages.

summarystringOptional
descriptionstringOptional

HTML, up to 250,000 characters. Images must be links, not inlined data:.

brandstringOptional<=100 characters
manufacturerstringOptional<=50 characters
modelstringOptional<=50 characters
gtinstringOptional<=50 characters
warrantyBystringOptional<=200 characters

Who gives the warranty (the product page and the Zap mirror).

vatFreebooleanOptional
showInSearchbooleanOptionalDefaults to true
showInMirrorbooleanOptionalDefaults to true
showInGoogleMerchantbooleanOptionalDefaults to true
False takes the product out of the Google Merchant Center feed.
seoTitlestringOptional<=100 characters
seoDescriptionstringOptional<=200 characters

Response

Created.
oktrueOptional
dataobjectOptional

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
409
Conflict Error
429
Too Many Requests Error