Get a product’s stock
GET
/products/{id}/stock
const url = 'https://example.com/products/019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f/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/products/019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f/stock \ --cookie bottle.session_token=<bottle.session_token>How many are on the shelf (null when the product is not counted), its low mark and what the shop does when none are left, and the last 50 changes, newest first: sold on the shop, put back from a cancelled order, a delivery in, or counted by hand. Cylinders are counted under Stock, not here.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
UUID v7
string format: uuid
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fUUID v7
Responses
Section titled “Responses”The count, its rules, and the last 50 movements, newest first
Media typeapplication/json
object
productId
required
UUID v7
string format: uuid
stockOnHand
required
integer | null
stockLowAt
required
integer | null
whenOut
required
string | null
movements
required
Array<object>
object
id
required
UUID v7
string format: uuid
change
required
integer
after
required
integer
reason
required
string
orderId
required
UUID v7
string | null format: uuid
note
required
string | null
userId
required
string | null
createdAt
required
string format: date-time
Example
{ "productId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "whenOut": "stop", "movements": [ { "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "reason": "sale", "orderId": "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"}Not found
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" } ]}