On This Page
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 toCustomPrintRequest.
- printLayout.sections
- Set this field to a list of one or more print sections. Each section must include asectionTypefield 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
TEXT
Section- printLayout.sections[n].sectionType
- Set this field toTEXT.
- printLayout.sections[n].textContent.textType
- Set this field to identify the type of text content. Supported values arePARAGRAPH,LABEL_VALUE, andNO_LINE.
TEXT Section: PARAGRAPH Text Content
Required Fields
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
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
BARCODE
Section- printLayout.sections[n].sectionType
- Set this field toBARCODE.
- 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 areCODE39,CODE128,EAN13,EAN128,PDF417, andQRCODE.
IMAGE Section
IMAGE
Section- printLayout.sections[n].sectionType
- Set this field toIMAGE.
- printLayout.sections[n].imageData
- Set this field to a Base64-encoded image. Supported formats arePNG,JPEG, andBMP. The maximum image width and height is 384 pixels.
SPACER Section
SPACER
Section- printLayout.sections[n].sectionType
- Set this field toSPACER.
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
TEXT
Section: PARAGRAPH
Optional
Fields- printLayout.sections[n].textContent.align
- Set this field toLEFT,CENTER, orRIGHT. The default value isLEFT.
- printLayout.sections[n].textContent.textStyle.size
- Set this field toSMALL,MEDIUM, orLARGE. The default value isMEDIUM.
- printLayout.sections[n].textContent.textStyle.style
- Set this field toNORMALorEMPHASIZE. The default value isNORMAL.
TEXT Section: LABEL_VALUE Optional
Fields
TEXT
Section: LABEL_VALUE
Optional
Fields- printLayout.sections[n].textContent.content[n].label.textStyle.size
- Set this field toSMALL,MEDIUM, orLARGE. The default value isMEDIUM.
- printLayout.sections[n].textContent.content[n].label.textStyle.style
- Set this field toNORMALorEMPHASIZE. The default value isNORMAL.
- printLayout.sections[n].textContent.content[n].value.textStyle.size
- Set this field toSMALL,MEDIUM, orLARGE. The default value isMEDIUM.
- printLayout.sections[n].textContent.content[n].value.textStyle.style
- Set this field toNORMALorEMPHASIZE. The default value isNORMAL.
SPACER Section Optional Fields
SPACER
Section Optional Fields- printLayout.sections[n].lines
- Set this field to the number of blank lines to insert. The default value is1.
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." }