Start from a starter set
const url = 'https://example.com/asset-starter-sets/medical_oxygen';const options = { method: 'POST', headers: { cookie: '__Host-bottle.session_token=<__Host-bottle.session_token>', 'Content-Type': 'application/json' }, body: '{"workReport":"replace"}'};
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/asset-starter-sets/medical_oxygen \ --header 'Content-Type: application/json' \ --cookie __Host-bottle.session_token=<__Host-bottle.session_token> \ --data '{ "workReport": "replace" }'Adds the set’s cylinder details, skipping any the business already has by that name, and sets the work report’s job types, checks and statements. When the business has changed those from a starter set, it answers 409 starterSetWorkReportChanged and changes nothing, unless workReport says to replace or keep them. Applying the set the business already has changes nothing. Needs both tenant:write and stock:write. Each can be changed or removed afterwards.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Medical_oxygen: serial, batch, fill and expiry dates; Install, Refill, Return and Service. industrial_gas: serial, next test due, tare weight, batch and fill date; Delivery, Exchange, Collection and Service.
Medical_oxygen: serial, batch, fill and expiry dates; Install, Refill, Return and Service. industrial_gas: serial, next test due, tare weight, batch and fill date; Delivery, Exchange, Collection and Service.
Request Body
Section titled “Request Body”object
Responses
Section titled “Responses”Every cylinder detail afterwards, and what happened to the work report
object
object
UUID v7
Text: letters, numbers and symbols, kept exactly as typed. date: a calendar day.
Cylinder: stays the same for the cylinder’s life, such as its serial number. fill: new each time it is refilled, such as its batch number.
Always: every cylinder must have it. when_full: only a full cylinder, such as a batch number. never: optional.
Sticker: printed text. barcode: a barcode or QR code. stamped: stamped into the metal. not_on_cylinder: typed in. other: described in shownAsOther, and typed in.
Warn: the driver is warned and the office told. block: the driver cannot deliver it. nothing: no action.
Example
{ "items": [ { "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "name": "Serial number", "valueType": "text", "lifetime": "cylinder", "required": "always", "shownAs": "sticker", "warnUnit": "days", "pastAction": "warn" } ], "workReport": "set"}Not signed in
object
Example
{ "error": "not_found", "message": "Customer not found"}Missing scope or role, or the plan does not open Assets
object
Example
{ "error": "not_found", "message": "Customer not found"}Not found, or Assets is not available to this business
object
Example
{ "error": "not_found", "message": "Customer not found"}Assets is switched off, another cylinder already has that detail, or a batch release needs confirming
object
Example
{ "error": "not_found", "message": "Customer not found"}Validation failed
object
object
Example
{ "error": "validation", "issues": [ { "path": "email", "message": "Invalid email" } ]}