Set a product’s quantity breaks and price list prices
const url = 'https://example.com/products/019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f/prices';const options = { method: 'PUT', headers: { cookie: 'bottle.session_token=<bottle.session_token>', 'Content-Type': 'application/json' }, body: '{"consumerBreaks":[{"fromQuantity":1,"unitPrice":1,"priceIncludesVat":true}],"tradeBreaks":[{"fromQuantity":1,"unitPrice":1,"priceIncludesVat":true}],"priceLists":[{"rateSetId":"019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f","price":{"unitPrice":1,"priceIncludesVat":true},"breaks":[{"fromQuantity":1,"unitPrice":1,"priceIncludesVat":true}]}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/products/019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f/prices \ --header 'Content-Type: application/json' \ --cookie bottle.session_token=<bottle.session_token> \ --data '{ "consumerBreaks": [ { "fromQuantity": 1, "unitPrice": 1, "priceIncludesVat": true } ], "tradeBreaks": [ { "fromQuantity": 1, "unitPrice": 1, "priceIncludesVat": true } ], "priceLists": [ { "rateSetId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "price": { "unitPrice": 1, "priceIncludesVat": true }, "breaks": [ { "fromQuantity": 1, "unitPrice": 1, "priceIncludesVat": true } ] } ] }'Replaces the quantity breaks on the Consumer and Trade rows, and on each price list sent, and sets or (price null) clears each list’s price. A price list left out is left as it is. The Consumer and Trade prices themselves change with PATCH /products/{id}. Breaks start at 2 or more, each from more than the last, at most ten a row. Who pays what: a customer’s own agreed price, then their price list’s price, then the Trade price for trade customers or the Consumer price for everyone else. Quantity breaks go with whichever price applies. Orders already taken keep their prices.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”UUID v7
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fUUID v7
Request Bodyrequired
Section titled “Request Bodyrequired”object
From this many of the product in one order, every one of them is this unit price (“10 or more: £30.00 each”).
object
From this many of the product in one order, every one of them is this unit price (“10 or more: £30.00 each”).
object
object
UUID v7
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fobject
From this many of the product in one order, every one of them is this unit price (“10 or more: £30.00 each”).
object
Responses
Section titled “Responses”The price table, as saved
object
UUID v7
object
From this many of the product in one order, every one of them is this unit price (“10 or more: £30.00 each”).
object
object
From this many of the product in one order, every one of them is this unit price (“10 or more: £30.00 each”).
object
object
UUID v7
From this many of the product in one order, every one of them is this unit price (“10 or more: £30.00 each”).
object
Example
{ "productId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "priceLists": [ { "rateSetId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" } ]}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"}No such product, or a price list that is not this business’s
object
Example
{ "error": "not_found", "message": "Customer not found"}A price list sent is archived
object
Example
{ "error": "not_found", "message": "Customer not found"}Validation failed, or a deposit, rent or delivery
object
object
Example
{ "error": "validation", "issues": [ { "path": "email", "message": "Invalid email" } ]}