Change a batch's details
PATCH
/assets/batch-intake/drafts/{id}
const url = 'https://example.com/assets/batch-intake/drafts/019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f';const options = { method: 'PATCH', headers: { cookie: '__Host-bottle.session_token=<__Host-bottle.session_token>', 'Content-Type': 'application/json' }, body: '{"references":{"additionalProperty":"example"},"expected":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://example.com/assets/batch-intake/drafts/019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f \ --header 'Content-Type: application/json' \ --cookie __Host-bottle.session_token=<__Host-bottle.session_token> \ --data '{ "references": { "additionalProperty": "example" }, "expected": 1 }'Sets the batch number, fill date, expiry and the count on the filler’s paperwork. references replaces the details given before. A released batch is refused with 409.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
UUID v7
string format: uuid
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fUUID v7
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
references
object
key
additional properties
string
expected
integer | null
Example generated
{ "references": { "additionalProperty": "example" }, "expected": 1}Responses
Section titled “Responses”The batch
Media typeapplication/json
object
id
required
UUID v7
string format: uuid
yard
required
object
id
required
UUID v7
string format: uuid
name
required
string
product
required
object
id
required
UUID v7
string format: uuid
name
required
string
shelfLifeMonths
required
integer | null
references
required
object
key
additional properties
string
expected
required
integer | null
serials
required
Array<object>
object
serial
required
string
addedBy
required
object
id
required
string
name
required
string
addedFrom
required
Office: typed or scanned on the office’s Batch intake screen. phone: from the driver app.
string
addedAt
required
string format: date-time
fields
required
Array<object>
object
id
required
UUID v7
string format: uuid
name
required
string
valueType
required
string
createdBy
required
object
id
required
string
name
required
string
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
expiresAt
required
string format: date-time
releasedAt
required
string | null format: date-time
released
required
object
released
required
integer
filled
required
integer
added
required
integer
unchanged
required
integer
Example
{ "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "yard": { "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" }, "product": { "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" }, "serials": [ { "addedFrom": "office" } ], "fields": [ { "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "valueType": "text" } ]}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
message
required
string
issues
required
Array<object>
object
path
required
string
message
required
string
Example
{ "error": "validation", "issues": [ { "path": "email", "message": "Invalid email" } ]}