Publish, unpublish or delete a store product

Show a store product to customers, hide it, or remove it.

POST{BASE_URL}/store/products/:externalId/publish
POST{BASE_URL}/store/products/:externalId/unpublish
DELETE{BASE_URL}/store/products/:externalId

Requires the UPDATE scope.

  • Publish shows the product in your store; unpublish hides it. Both answer the product, in the shape PUT /store/products returns. Calling either twice is harmless.
  • Delete removes the product and its stock counts. Orders that included it keep their own copy of what was ordered.

A sandbox key changes nothing and answers "dryRun": true.

A product that does not exist answers 404 resource_not_found.

Status codes#

StatusCodeWhen
200—Done, or "dryRun": true for a sandbox key.
400externalId_invalidThe externalId is not 1–128 letters, digits or . _ ~ : -.
403provider_module_not_allowedA Technology Provider without the Store module.
404resource_not_foundNo listing with that externalId that you manage.
cURL
curl -X POST "$LOCALOY_BASE_URL/store/products/pj-001/publish" \
  -H "Authorization: Bearer $LOCALOY_API_KEY"
Response · 200
{
  "success": true,
  "message": "Published",
  "dryRun": false,
  "data": { "externalId": "pj-001", "published": true, "…": "…" }
}
cURL
curl -X DELETE "$LOCALOY_BASE_URL/store/products/pj-001" \
  -H "Authorization: Bearer $LOCALOY_API_KEY"
Response · 200
{ "success": true, "message": "Product deleted", "dryRun": false }