Create or update a product by its SKU
POST/products
Pushes one product. The product is found by sku within the brandId: none → it is created (201, with a Location), exactly one → it is updated (200), more than one → 409 and nothing is written. The match is by SKU only, never by title. The push is partial: a field you leave out is untouched, null clears a single value and [] clears a list. Photos are fetched in the background; read their state with ?expand=details. Both answers carry the product with every ?expand=details key and its state ETag. Idempotency-Key is required: a retry with the same key and body returns the same answer and writes nothing more. A SKU whose product is linked to a connected store is refused (409). There is no PATCH and no DELETE: archive a product with POST /products/{productId}/archive.
Request
Responses
- 200
- 201
- 400
- 401
- 403
- 409
- 412
- 422
- 429
- 503
OK. The product was updated, or the push changed nothing.
Response Headers
Strong hash of the product state — the value If-Match is compared with.
Created — or the replay of an earlier create with this key.
Response Headers
Strong hash of the product state — the value If-Match is compared with.
The created product: /api/public/v1/products/{productId}.
Bad Request. The Idempotency-Key header is missing (IDEMPOTENCY_KEY_REQUIRED) or malformed (INVALID_IDEMPOTENCY_KEY).
Unauthorized. Missing, malformed, unknown, revoked, or expired bearer token — or the token owner no longer holds the required entitlement (ENTITLEMENT_LOST). A uniform problem body is returned with a distinct code; no owner/condition detail (no-leak).
Forbidden. The key lacks the products:write scope (API_TOKEN_SCOPE_DENIED), or a create would put the account over its plan's product limit (LIMIT_EXCEEDED, with limitKey, limit and current). An update is never refused for the limit.
Conflict. More than one product of the brand has the SKU (PRODUCT_SKU_AMBIGUOUS, with sku, brandId and productIds); the product is linked to a connected store (PRODUCT_OWNED_BY_STORE, with sku, brandId and productId); or a request under this key is still in progress (IDEMPOTENCY_IN_PROGRESS, retry after Retry-After); or the key was already used for a different request (IDEMPOTENCY_KEY_REUSED).
Response Headers
Seconds to wait before retrying.
Precondition Failed (PRECONDITION_FAILED). If-Match no longer matches the product, or was sent on a push that creates it. Nothing was changed; read the product again and retry.
Unprocessable Content (VALIDATION_ERROR). The body is malformed — an unknown field, an http photo, more than 10 photos or a repeated photo url, a category id starting with path:, a missing name on a create — or brandId is not one of the account’s brands; every offending field is listed in errors[]. Or (GROUNDED_ASSET_STAYS_IN_APP) a photo url is one of the account’s search-grounded images, which stay inside Mocart; nothing was written and the Idempotency-Key is not used up.
Too Many Requests. The per-token sliding window of 300 requests/minute was exceeded. The body is express-rate-limit's DEFAULT plain-text message (NOT the JSON problem+json envelope).
Response Headers
IETF draft-7 rate-limit policy/state (limit, remaining, reset).
Seconds to wait before retrying.
Service Unavailable. Writes are paused for this account (WRITES_PAUSED), or this create lost a race with other writes (SERVICE_UNAVAILABLE). Nothing was written and the Idempotency-Key is still usable: retry the SAME request after Retry-After.
Response Headers
Seconds to wait before retrying.