Skip to navigation

Create a product with its product items

Creates the product and all its product items in one transaction, after validating everything: if anything is refused, nothing is written. product.status can be DRAFT (default) or ACTIVE, and the product items take the product’s status. The product and every product item must be new: an existing product reference is refused, naming the product (use PATCH /v1/products/{id} to change it and POST /v1/product-items to add a product item), and an existing product item reference is refused, naming that product item. When calling with an API key, send an Idempotency-Key header to retry safely: a repeated request with the same key returns the original response and creates nothing new. At most 10 product items per request. Requires the PRODUCT.CREATE or PRODUCT_ITEM.CREATE permission. Requires both PRODUCT.CREATE and PRODUCT_ITEM.CREATE.

Authentication

X-API-KEYstring
API Key authentication via header
OR
AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

versionstringRequiredDefaults to 1
version

Headers

x-platform-idstringOptional
Platform ID.

Request

This endpoint expects an object.
productobjectRequired

The product to create. Its status can be DRAFT or ACTIVE (default DRAFT). Its reference must be new.

product_itemslist of objectsRequired

The product items to create on the product. They take the product’s status; a reference used by another product item is refused.

Response

OK
productobjectOptional
The product as created.
product_itemslist of objectsOptional
The product items as created, in request order.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
500
Internal Server Error