Update a paired device
Replaces a paired peripheral’s fields WHOLESALE — this is not a patch. ALWAYS read the device first, apply your change to the object you got back, and send the whole thing. An omitted field does not keep its stored value: id, label, kind, store and register are required (omitting one is a 400), and status is OPTIONAL WITH A DEFAULT OF disconnected — so omitting status flips a ready device to disconnected and makes a working register look offline. The body’s id is required by validation but IGNORED: the path deviceId is merged in afterwards and wins, so send the same value in both. lastSeen is re-stamped from the server clock on every call (an update IS a state change), so never send it and never rely on it staying put. Use this to re-label a device or move it to another register; writing status records an OPERATOR-ASSERTED state, it does not probe the hardware, so do not use it to ‘fix’ a device reported as error. 404s for an unknown device — updating never implicitly pairs one. PERMISSION TRAP (see solya-pos#950): the route guard accepts pos.settings.manage, but the use-case additionally asserts the kernel config:manage permission and NO pos.settings.* scope maps to it, so a principal authenticated by scopes alone clears the guard and then 403s inside the use-case.
Authorizations
Authorization: Bearer <token>. Accepts EITHER a Keycloak access token (scopes-in-token) OR an opaque POS session token; both resolve to the same pos.* scope vocabulary the route guards enforce.
Path Parameters
1Body
Response
The device as it now stands, with lastSeen re-stamped.
The device as it now stands, with lastSeen re-stamped.
111111^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
