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: '__Host-bottle.session_token=<__Host-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},"notCharged":false,"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 __Host-bottle.session_token=<__Host-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 }, "notCharged": false, "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. A deposit or rent has the same table without quantity breaks (sending any is a 422): its Consumer and Trade amounts, and each price list’s amount, or notCharged for a list whose members do not pay it. Who pays a deposit or rent: a customer’s own agreed amount, then their price list’s say, then, where its chargeAudience includes them, the Trade amount for trade customers or the Consumer amount for everyone else; a customer it leaves out pays nothing. Where its cylinders also have the other charge, a list charges one or neither, never both: an amount for a list needs the other charge notCharged on that list (422 charges_both otherwise), and listChoice says what each list chose. A list that chose the other charge, or neither, is changed on the price list (PUT /rate-sets/{id}/cylinder-charges). notCharged on anything that is not a deposit or rent is a 422. 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
Who pays a deposit or rent where no price list or agreed amount says otherwise. both: Consumer and Trade customers (the default). consumer: everybody who is not a trade customer, signed in or not. trade: trade customers only. Meaningless on anything that is not a charge.
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
What a price list charges its members on one gas type (or size). usual: each member pays the deposit or rent they are set to, at the usual amount. deposit: the deposit and never rent. rent: the rent and never a deposit. none: neither.
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", "charge": "deposit", "chargeAudience": "both", "priceLists": [ { "rateSetId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "listChoice": "usual" } ]}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, a delivery charge, quantity breaks on a deposit or rent, notCharged on something sold, or a list that would charge both a deposit and rent on one gas type
object
object
Example
{ "error": "validation", "issues": [ { "path": "email", "message": "Invalid email" } ]}