Publish, unpublish or delete a store product
Show a store product to customers, hide it, or remove it.
POST
{BASE_URL}/store/products/:externalId/publishPOST
{BASE_URL}/store/products/:externalId/unpublishDELETE
{BASE_URL}/store/products/:externalIdRequires the UPDATE scope.
- Publish shows the product in your store; unpublish hides it. Both answer the product, in the shape
PUT /store/productsreturns. 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#
| Status | Code | When |
|---|---|---|
200 | — | Done, or "dryRun": true for a sandbox key. |
400 | externalId_invalid | The externalId is not 1–128 letters, digits or . _ ~ : -. |
403 | provider_module_not_allowed | A Technology Provider without the Store module. |
404 | resource_not_found | No 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 }