Set what a supplier charges
const url = 'https://example.com/stock/suppliers/019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f/costs';const options = { method: 'PUT', headers: { cookie: '__Host-bottle.session_token=<__Host-bottle.session_token>', 'Content-Type': 'application/json' }, body: '{"costs":[{"productId":"019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f","unitCostPence":1,"breaks":[{"fromQuantity":1,"unitCostPence":1}]}]}'};
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/stock/suppliers/019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f/costs \ --header 'Content-Type: application/json' \ --cookie __Host-bottle.session_token=<__Host-bottle.session_token> \ --data '{ "costs": [ { "productId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "unitCostPence": 1, "breaks": [ { "fromQuantity": 1, "unitCostPence": 1 } ] } ] }'What this supplier charges the business for some of the products they supply, before VAT, with any quantity prices. Products not named keep their costs. These costs stay on the supplier and are not shown on the product.
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
What a supplier charges the business for one product. Kept on the supplier only; not shown on the product.
object
UUID v7
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fA cheaper cost from a quantity, before VAT (“10 or more at £22.00 each”).
object
Responses
Section titled “Responses”The supplier, with its contacts
object
UUID v7
What a supplier charges the business for one product. Kept on the supplier only; not shown on the product.
object
UUID v7
A cheaper cost from a quantity, before VAT (“10 or more at £22.00 each”).
object
object
UUID v7
Example
{ "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "yardIds": [ "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" ], "productIds": [ "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" ], "costs": [ { "productId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" } ], "contacts": [ { "id": "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 supplier or contact in this business
object
Example
{ "error": "not_found", "message": "Customer not found"}Validation failed
object
object
Example
{ "error": "validation", "issues": [ { "path": "email", "message": "Invalid email" } ]}