Skip to content

Save a count of one product at a yard, with the corrections chosen

POST
/assets/stocktake
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.

Media typeapplication/json
object
yardId
required

UUID v7

string format: uuid

Example

019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f
productId
required

UUID v7

string format: uuid

Example

019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f
serials
required
Array<string>
<= 5000 items
moveHere
Array<string>
default: <= 5000 items
markLost
Array<string>
default: <= 5000 items
add
Array<object>
default: <= 5000 items
object
serial
required
string
>= 1 characters <= 100 characters
condition
required
string
Allowed values: full empty
setCount
boolean
note
string | null
<= 500 characters

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
Allowed values: validation
message
required
string
issues
required
Array<object>
object
path
required
string
message
required
string

Example

{
"error": "validation",
"issues": [
{
"path": "email",
"message": "Invalid email"
}
]
}