Skip to content

Print

Method Endpoint Description
POST /api/document/print Print document which is waiting to be printed
POST /api/print Print string

POST /api/document/print

If document wasn't printed normally (while being created) due to a printer error (e.g. due to printer without paper), this method must be called to print the original receipt. Without it, eKasa won't accept any request which stores data to CHDU.

Request Body

Required.

Printer properties.

Media Type Schema
application/json Printer

Examples (application/json)

No parameters are required.

{}

Responses

200 — Success response

Media Type Schema
application/json GenericResponse
Examples (application/json)
The document was printed successfully

Successful response doesn't return any additional data.

{
  "resultCode": 0
}

404 — Document to print was not found

Media Type Schema
application/json ErrorResponse
Examples (application/json)
Everything printed

No document is waiting to be printed.

{
  "resultCode": 505,
  "error": "No unprinted document found."
}
Electronic document

If the last document was electronic, only the error text changes.

{
  "resultCode": 505,
  "error": "Last document was electronic."
}

500 — An error occurred (for example printer or CHDU got disconnected)

Media Type Schema
application/json ErrorResponse

POST /api/print

Print custom string data. These data will be stored in the CHDU memory.

Request Body

Required.

Data to print

Media Type Schema
application/json PrintStringRequest

Examples (application/json)

Simple text print

Simple print request

{
  "printData": "Print data"
}
Complex print

Since the eKasa client doesn't allow formatting the text yet, the text must be formatted manually. Please call the Printer endpoint first to discover the printer parameters (characters per line). This example is for 32 characters per line.

{
  "printData": "        Daily statement         \n--------------------------------\n                                \nTotal sales:                  37\nTotal item count:             70\nTotal cost:           468.50 EUR\n--------------------------------"
}

Responses

200 — Standard response

Media Type Schema
application/json RawResponse

500 — An error occurred...