Skip to content
PharmaFlow Knowledgebase
Esc
↑↓navigate↵open⌘Jpreview

Update a printer

Admin only. Patches a printer’s name, kind, copies, auto print, drawer, active, or default. Clearing the last default is refused; a branch must keep exactly one default printer.

PUT/api/v1/printing/printers/{printerId}
Authorization
AuthorizationBearer token (JWT) · headerrequired

JWT from POST /api/v1/auth/login sent as Authorization Bearer.

Path parameters
printerIdstringrequired

The printer being updated.

Request body
requiredapplication/json
namestring
kindstring
connectionstring
device_pathstring
copiesnumber
auto_printboolean
kick_drawerboolean
is_activeboolean
is_defaultboolean
Responses
200

Printer updated

idstringrequired
branch_idstringrequired
namestringrequired
kindstringrequired
connectionstringrequired
device_pathstringrequired
is_defaultintegerrequired
min -9007199254740991 · max 9007199254740991
copiesintegerrequired
min -9007199254740991 · max 9007199254740991
auto_printintegerrequired
min -9007199254740991 · max 9007199254740991
kick_drawerintegerrequired
min -9007199254740991 · max 9007199254740991
is_activeintegerrequired
min -9007199254740991 · max 9007199254740991
is_deletedintegerrequired
min -9007199254740991 · max 9007199254740991
created_atstringrequired
updated_atstringrequired
400

The name is blank, a device path is set, a kind or copies value is invalid, no fields were sent, or clearing the default would leave the branch without one

detailstringrequired
401

Not authenticated

detailstringrequired
403

Caller is not an admin, or the branch is outside your ownership

detailstringrequired
404

Printer not found

detailstringrequired
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X PUT 'http://localhost:8000/api/v1/printing/printers/string' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "kind": "string",
  "connection": "string",
  "device_path": "string",
  "copies": 0,
  "auto_print": true,
  "kick_drawer": true,
  "is_active": true,
  "is_default": true
}'
Response
{
  "id": "string",
  "branch_id": "string",
  "name": "string",
  "kind": "string",
  "connection": "string",
  "device_path": "string",
  "is_default": -9007199254740991,
  "copies": -9007199254740991,
  "auto_print": -9007199254740991,
  "kick_drawer": -9007199254740991,
  "is_active": -9007199254740991,
  "is_deleted": -9007199254740991,
  "created_at": "string",
  "updated_at": "string"
}