Change many products at once
POST
/api/v1/workspaces/{workspaceId}/product-bulk-actions
const url = 'https://api.crossmart.io/api/v1/workspaces/example/product-bulk-actions';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"productIds":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"],"action":"set_status","status":"DRAFT","tags":["example"],"percent":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.crossmart.io/api/v1/workspaces/example/product-bulk-actions \ --header 'Content-Type: application/json' \ --data '{ "productIds": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "action": "set_status", "status": "DRAFT", "tags": [ "example" ], "percent": 1 }'Set a status, add or remove tags, move every variant price by a percentage, or delete. Each action runs as one statement, scoped to the workspace.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”workspaceId
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
productIds
required
Array<string>
action
required
string
status
Required for set_status
string
tags
Required for add_tags and remove_tags
Array<string>
percent
Required for adjust_prices. 10 raises every price by 10%, -15 lowers it by 15%.
number
Responses
Section titled “Responses”Media typeapplication/json
object
affected
required
Products changed. Ids from other workspaces are not counted.
number
Example generated
{ "affected": 1}