Get yards and cylinder counts for a stock take
GET
/stock-takes/context
const url = 'https://example.com/stock-takes/context?locationId=019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f';const options = { method: 'GET', headers: {cookie: '__Host-bottle.session_token=<__Host-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-takes/context?locationId=019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f' \ --cookie __Host-bottle.session_token=<__Host-bottle.session_token>Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”locationId
UUID v7
string format: uuid
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fUUID v7
Responses
Section titled “Responses”Yards, products and last stock take
Media typeapplication/json
object
yards
required
Array<object>
object
id
required
UUID v7
string format: uuid
name
required
string
postcode
required
string
products
required
Array<object>
object
id
required
UUID v7
string format: uuid
name
required
string
shortCode
required
string | null
sku
required
string | null
full
required
integer
empty
required
integer
latest
required
object
id
required
UUID v7
string format: uuid
locationId
required
UUID v7
string format: uuid
locationName
required
string
byUserId
required
string | null
byName
required
string | null
createdAt
required
string format: date-time
note
required
string | null
lines
required
Array<object>
object
productId
required
UUID v7
string format: uuid
productName
required
string
shortCode
required
string | null
expectedFull
required
integer
expectedEmpty
required
integer
full
required
integer | null
empty
required
integer | null
damagedFull
integer
damagedEmpty
integer
damageRecordingSupported
required
boolean
Example
{ "yards": [ { "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" } ], "products": [ { "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" } ], "latest": { "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "locationId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "lines": [ { "productId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "damagedFull": 0, "damagedEmpty": 0 } ] }}Sign in
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Not allowed to take stock in this business
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Yard or product unavailable
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Check the counts
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" } ]}