Skip to content

Release a batch of cylinders to full stock

POST
/assets/batch-intake
curl --request POST \
--url https://example.com/assets/batch-intake \
--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" ], "references": { "additionalProperty": "example" }, "expected": 1, "confirmed": false, "note": "example" }'

Sets the batch’s details (batch number, fill date, expiry) on every cylinder listed and puts them in full stock at the yard, in one step: cylinders in quarantine are released, empties in the yard are filled, and serials not in the register are added. The previous fill’s details stay searchable. A serial at another yard, on a vehicle, with a customer, lost, or of another product is refused with 422. A count that differs from expected, or a cylinder already in full stock, answers 409 batch_count_differs or batch_in_full_stock unless confirmed. Cylinders already carrying the batch are left as they are, so repeating a release changes nothing.

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>
>= 1 items <= 1000 items
references
required
object
key
additional properties
string
<= 200 characters
expected
integer | null
> 0 <= 1000
confirmed
boolean
note
string | null
<= 500 characters

Released

Media typeapplication/json
object
released
required
integer
filled
required
integer
added
required
integer
unchanged
required
integer

Example generated

{
"released": 1,
"filled": 1,
"added": 1,
"unchanged": 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, another cylinder already has that detail, or a batch release needs confirming

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"
}
]
}