Change several products
const url = 'https://example.com/products/bulk';const options = { method: 'POST', headers: { cookie: '__Host-bottle.session_token=<__Host-bottle.session_token>', 'Content-Type': 'application/json' }, body: '{"productIds":["019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f"],"change":{"action":"publish"}}'};
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://example.com/products/bulk \ --header 'Content-Type: application/json' \ --cookie __Host-bottle.session_token=<__Host-bottle.session_token> \ --data '{ "productIds": [ "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" ], "change": { "action": "publish" } }'One change made to every product named: on or off the business’s shop, into or out of a category, archived or restored. Each is done by the same rules as editing it alone. One the change does not apply to, or that is already that way, is left as it is and listed as skipped; the rest still go.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
object
Put each on the business’s own shop. Deposits, rent and archived products are skipped.
object
Take each off the business’s shop.
object
Say who may buy each on the shop: everybody, consumers only or trade customers only. Deposits and rent are skipped.
Who may buy it on the shop once published. both: everybody (the default). consumer: anybody not signed in for a trade account, so trade customers do not see it. trade: signed-in trade customers only.
object
Keep each off new orders and off the shop. Old orders are left alone.
object
Bring each back from the archive. It stays off the shop until put back. A deposit or rent that would clash with a live one is skipped.
object
Add each to the category, keeping the others it is in. Deposits and rent are skipped.
UUID v7
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fobject
Take each out of the category, leaving the others it is in.
UUID v7
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fobject
Put each in the gas type, or in none with null. Deposits and rent are skipped: they are moved on their own form.
UUID v7
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fResponses
Section titled “Responses”What was changed and what was skipped
object
object
UUID v7
object
UUID v7
Example
{ "done": [ { "productId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" } ], "skipped": [ { "productId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "reason": "not_found" } ]}Not signed in
object
Example
{ "error": "not_found", "message": "Customer not found"}Not a member, or without the permission this needs
object
Example
{ "error": "not_found", "message": "Customer not found"}The category is not one of this business’s
object
Example
{ "error": "not_found", "message": "Customer not found"}Validation failed
object
object
Example
{ "error": "validation", "issues": [ { "path": "email", "message": "Invalid email" } ]}