Viewrium Docs
HTTP referenceProducts

Publish or unpublish products

POST/v1/products/publish

Publishes or unpublishes up to 100 products at once; a single product can also be toggled with PATCH /v1/products/{id}. Answers each id's outcome. 402 when the plan does not allow publishing, or publishing them would pass the plan's active-product limit.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

The products to publish or unpublish, up to 100.

Response Body

application/json

application/json

curl -X POST "https://example.com/v1/products/publish" \  -H "Content-Type: application/json" \  -d '{    "ids": [      "6e0346a3-e54d-40e3-9779-4ba1e707e35b"    ],    "published": true  }'
{  "affected": [    "4fa450be-f7f9-4947-9cd8-45f559412bd8"  ],  "not_found": [    "42d097e8-23d9-4b4b-9d40-4c593308d98f"  ],  "forbidden": [    "f09f22a4-960f-4de7-bfb1-fbb0befa8bdd"  ]}
{  "error": {    "code": "string",    "message": "string",    "details": null  }}