FILTER BY TAG

Custom Printing

Use this information to send a custom print request in Local mode. This feature enables you to print custom content directly to the integrated printer of a PAX terminal, including text, label-value pairs, images, barcodes, and QR codes.
IMPORTANT
The Custom Printing feature does not affect your configuration for printing standard customer or merchant receipts.

Endpoints

The endpoint is the same for the test and production environments.
Test:
wss://{terminal IP address:port number}/
Production:
wss://{terminal IP address:port number}/

Required Fields for Custom Printing

type
Set this field to
CustomPrintRequest
.
printLayout.sections
Set this field to a list of one or more print sections. Each section must include a
sectionType
field to identify the type of custom content to print.

Required Fields for Custom Printing by Section Type

Use these fields to define the required content for each custom print section in the
printLayout.sections
field. Each section in this field must include a
sectionType
field that identifies the type of content to print. The
printLayout.sections
field supports these
sectionType
values:
TEXT
,
SPACER
,
BARCODE
, and
IMAGE
. These values are case sensitive.

TEXT
Section

printLayout.sections[n].sectionType
Set this field to
TEXT
.
printLayout.sections[n].textContent.textType
Set this field to identify the type of text content. Supported values are
PARAGRAPH
,
LABEL_VALUE
, and
NO_LINE
.

TEXT
Section:
PARAGRAPH
Text Content Required Fields

printLayout.sections[n].textContent.lines
Set this field to a list of one or more strings to print as paragraph lines.

TEXT
Section:
LABEL_VALUE
Text Content Required Fields

printLayout.sections[n].textContent.content
Set this field to a list of one or more label-value pairs.
printLayout.sections[n].textContent.content[n].label.labelText
Set this field to the label text string.
printLayout.sections[n].textContent.content[n].value.valueText
Set this field to the value text string.

BARCODE
Section

printLayout.sections[n].sectionType
Set this field to
BARCODE
.
printLayout.sections[n].content
Set this field to the data to encode in the barcode.
printLayout.sections[n].barcodeType
Set this field to the barcode format. Supported values are
CODE39
,
CODE128
,
EAN13
,
EAN128
,
PDF417
, and
QRCODE
.

IMAGE
Section

printLayout.sections[n].sectionType
Set this field to
IMAGE
.
printLayout.sections[n].imageData
Set this field to a Base64-encoded image. Supported formats are
PNG
,
JPEG
, and
BMP
. The maximum image width and height is 384 pixels.

SPACER
Section

printLayout.sections[n].sectionType
Set this field to
SPACER
.

Optional Fields for Custom Printing

Use these fields to define optional content and formatting for custom print sections in the
printLayout.sections
field. Optional fields are supported for
TEXT
and
SPACER
sections.
IMPORTANT
If you do not specify the value for an optional field, the default value is used.

TEXT
Section:
PARAGRAPH
Optional Fields

printLayout.sections[n].textContent.align
Set this field to
LEFT
,
CENTER
, or
RIGHT
. The default value is
LEFT
.
printLayout.sections[n].textContent.textStyle.size
Set this field to
SMALL
,
MEDIUM
, or
LARGE
. The default value is
MEDIUM
.
printLayout.sections[n].textContent.textStyle.style
Set this field to
NORMAL
or
EMPHASIZE
. The default value is
NORMAL
.

TEXT
Section:
LABEL_VALUE
Optional Fields

printLayout.sections[n].textContent.content[n].label.textStyle.size
Set this field to
SMALL
,
MEDIUM
, or
LARGE
. The default value is
MEDIUM
.
printLayout.sections[n].textContent.content[n].label.textStyle.style
Set this field to
NORMAL
or
EMPHASIZE
. The default value is
NORMAL
.
printLayout.sections[n].textContent.content[n].value.textStyle.size
Set this field to
SMALL
,
MEDIUM
, or
LARGE
. The default value is
MEDIUM
.
printLayout.sections[n].textContent.content[n].value.textStyle.style
Set this field to
NORMAL
or
EMPHASIZE
. The default value is
NORMAL
.

SPACER
Section Optional Fields

printLayout.sections[n].lines
Set this field to the number of blank lines to insert. The default value is
1
.

REST Example: Custom Printing

Request
{ "type": "CustomPrintRequest", "printLayout": { "sections": [ { "sectionType": "TEXT", "textContent": { "textType": "PARAGRAPH", "lines": ["ACME STORE", "123 Main St"], "align": "CENTER", "textStyle": { "size": "LARGE", "style": "NORMAL" } } }, { "sectionType": "IMAGE", "imageData": "iVBORw0KGgoAAAANS..." }, { "sectionType": "SPACER", "lines": 1 }, { "sectionType": "TEXT", "textContent": { "textType": "LABEL_VALUE", "content": [ { "label": { "labelText": "Subtotal", "textStyle": { "size": "MEDIUM", "style": "NORMAL" } }, "value": { "valueText": "$23.45", "textStyle": { "size": "MEDIUM", "style": "NORMAL" } } }, { "label": { "labelText": "Total", "textStyle": { "size": "LARGE", "style": "NORMAL" } }, "value": { "valueText": "$25.99", "textStyle": { "size": "LARGE", "style": "NORMAL" } } } ] } }, { "sectionType": "BARCODE", "content": "TXN123456789", "barcodeType": "CODE128" } ] } }
Mid-Transaction Status Updates
During the operation, you might receive one or more update responses indicating the current status of the operation. You can choose to display these updates on your point-of-sale (POS) system.
{ "type": "OperationStatusResponse", "message": "Status update to display." }
Response to a Successful Request
{ "type": "CustomPrintResponse", "message": "Custom Print successfully" }
Response to an Unsuccessful Request
When the request is unsuccessful, you receive an error response with details.
{ "type": "ErrorResponse", "message": "Error message to display.", "developerDescription": "Detailed description of error." }