Skip to Content
MySagra 1.4.0 is released 🎉

Printers

Manage thermal printers used for order ticket printing. Printers can be assigned to categories, food items, and cash registers.

Printer Object

{ "id": "clx1a2b3c4d5e6f7g8h9i0j1", "name": "Kitchen Printer", "ip": "192.168.1.200", "port": 9100, "description": "Printer located in the kitchen", "status": "ONLINE" }
FieldTypeDescription
idstringUnique identifier (CUID)
namestringPrinter name
ipstringIP address
portintegerPort number (default: 9100)
descriptionstringPrinter description
statusstringONLINE, OFFLINE, or ERROR

GET /v1/printers

Retrieve all printers.

Authentication: Bearer token

Response 200 OK

[ { "id": "clx1a2b3c4d5e6f7g8h9i0j1", "name": "Kitchen Printer", "ip": "192.168.1.200", "port": 9100, "description": "Printer located in the kitchen", "status": "ONLINE" } ]

GET /v1/printers/{id}

Retrieve a single printer by ID.

Authentication: Bearer token

Path Parameters

ParameterTypeDescription
idstringPrinter ID (CUID)

Response 200 OK

Returns a Printer Object.

Errors

StatusDescription
404Printer not found

POST /v1/printers

Create a new printer.

Authentication: Bearer token (admin)

Request Body

{ "name": "Kitchen Printer", "ip": "192.168.1.200", "port": 9100, "description": "Printer located in the kitchen", "status": "ONLINE" }
FieldTypeRequiredDescription
namestringYesPrinter name
ipstringYesIP address
portintegerNoPort (default: 9100)
descriptionstringNoDescription
statusstringNoONLINE, OFFLINE, or ERROR (default: ONLINE)

Response 201 Created

Returns the created Printer Object.

Errors

StatusDescription
400Invalid input

PUT /v1/printers/{id}

Update an existing printer.

Authentication: Bearer token (admin)

Path Parameters

ParameterTypeDescription
idstringPrinter ID (CUID)

Request Body

Same as POST.

Response 200 OK

Returns the updated Printer Object.

Errors

StatusDescription
404Printer not found

PATCH /v1/printers/{id}

Update the status of a printer.

Authentication: Bearer token (admin)

Path Parameters

ParameterTypeDescription
idstringPrinter ID (CUID)

Request Body

{ "status": "OFFLINE" }
FieldTypeRequiredValues
statusstringYesONLINE, OFFLINE, ERROR

Response 200 OK

Returns the updated Printer Object.

Errors

StatusDescription
400Invalid input
404Printer not found

DELETE /v1/printers/{id}

Delete a printer.

Authentication: Bearer token (admin)

Path Parameters

ParameterTypeDescription
idstringPrinter ID (CUID)

Response 200 OK

Errors

StatusDescription
404Printer not found
Last updated on