Get stock levels
GET
/stock
const url = 'https://example.com/stock';const options = { method: 'GET', headers: {cookie: 'bottle.session_token=<bottle.session_token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/stock \ --cookie bottle.session_token=<bottle.session_token>Every yard and every vehicle, with what is on each, full and empty counted apart. Summed from the movements rather than kept beside them, so a count and its workings cannot drift. Also what the whole business holds, and anything at or under the figure somebody set for it.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”Where the stock is
Media typeapplication/json
object
holders
required
Array<object>
object
kind
required
string
id
required
UUID v7
string format: uuid
name
required
string
out
required
boolean
counts
required
Array<object>
object
productId
required
UUID v7
string format: uuid
productName
required
string
shortCode
required
string | null
full
required
integer
empty
required
integer
totals
required
Array<object>
object
productId
required
UUID v7
string format: uuid
productName
required
string
shortCode
required
string | null
full
required
integer
empty
required
integer
withCustomers
required
Array<object>
object
productId
required
UUID v7
string format: uuid
productName
required
string
shortCode
required
string | null
full
required
integer
empty
required
integer
promised
required
Array<object>
object
productId
required
UUID v7
string format: uuid
quantity
required
integer
low
required
Array<object>
object
productId
required
UUID v7
string format: uuid
productName
required
string
locationId
required
UUID v7
string | null format: uuid
locationName
required
string | null
full
required
integer
minimumFull
required
integer
Example
{ "holders": [ { "kind": "place", "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "counts": [ { "productId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" } ] } ], "totals": [ { "productId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" } ], "withCustomers": [ { "productId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" } ], "promised": [ { "productId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" } ], "low": [ { "productId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "locationId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" } ]}Not signed in
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Not a member, or without the permission this needs
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Validation failed
Media typeapplication/json
object
error
required
string
message
required
string
issues
required
Array<object>
object
path
required
string
message
required
string
Example
{ "error": "validation", "issues": [ { "path": "email", "message": "Invalid email" } ]}