Save a count of one product at a yard, with the corrections chosen
POST
/assets/stocktake
const url = 'https://example.com/assets/stocktake';const options = { method: 'POST', headers: { cookie: '__Host-bottle.session_token=<__Host-bottle.session_token>', 'Content-Type': 'application/json' }, body: '{"yardId":"019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f","productId":"019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f","serials":["example"],"moveHere":[],"markLost":[],"add":[],"setCount":false,"note":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/assets/stocktake \ --header 'Content-Type: application/json' \ --cookie __Host-bottle.session_token=<__Host-bottle.session_token> \ --data '{ "yardId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "productId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "serials": [ "example" ], "moveHere": [], "markLost": [], "add": [], "setCount": false, "note": "example" }'Checks the count again, then applies only the corrections asked for, all or none: cylinders recorded elsewhere move to the yard, missing ones are marked lost and leave the yard’s stock, new serials are added to the register at the yard, and with setCount the yard’s stock is set to what was counted. The count is kept in the yard’s stocktake history.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
yardId
required
UUID v7
string format: uuid
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fproductId
required
UUID v7
string format: uuid
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fserials
required
Array<string>
moveHere
Array<string>
markLost
Array<string>
add
Array<object>
object
serial
required
string
condition
required
string
setCount
boolean
note
string | null
Responses
Section titled “Responses”Saved
Media typeapplication/json
object
moved
required
integer
lost
required
integer
added
required
integer
adjusted
required
object
full
required
integer
empty
required
integer
Example generated
{ "moved": 1, "lost": 1, "added": 1, "adjusted": { "full": 1, "empty": 1 }}Not signed in
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Missing scope or role, or the plan does not open Assets
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Not found, or Assets is not available to this business
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Assets is switched off, or another cylinder already has that detail
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" } ]}