Guides
Log In
Guides

Print

Overview

The print command allows you to create a custom receipt that can be printed on terminals that have a built-in printer. The printData within the request body contains the data to be printed. The printData must be ISO-8895-1 encoded.

The printData can be formatted using control characters. Control characters must be in front of the data strings. They are in effect until another control character or “new line” (\n) is encountered.


Below is a list of the supported control characters:

  • \1 - Small font
  • \3 - Large font, to be used for section headers, like “Daily Summary”, “Details by Card Type” and card titles like “Visa”, “Debit”, etc
  • \B - Bold
  • \I - Inverse
  • \L - Left alignment
  • \C - Center alignment
  • \R - Right alignment
  • \n - New line

Sample String:

"\3\CCard Details\n" //centered large font 
"----------------------------------\n" //full width separator line 
"\LTransaction\RCount\RVolume\n" + //three columns 
"----------------------------------\n" 
"\LPurchase\R150\R$123.45\n" + 
"\LRefund\R1\R$ 1.23\n" + 
"\LCorrections\R30\R$1.23\n" 

List of coding scenarios that use this endpoint:

  1. Print Command

Request Structure

ElementTypeDescriptionSizeRequired
apiVersionStringAPI version numberV20Required
istConfigCodeStringMoneris provided integration configuration codeV50Required
dataIdStringMerchant defined unique identifier for the data objectV50Required
dataTimestampStringDate and time of the request (YYYY-MM-DD HH:MM:SS)F19Required
dataObjectObject that contains all transaction requests
requestArrayContains data applicable to transaction request
idempotencyKeyStringUnique transaction identifier to avoid duplicate requestV50Required
terminalIdStringDestination Terminal IDF8Optional
actionString"print"V50Required
printDataStringPrint data that needs to be printed by the terminal. Note: Data must be ISO-8895-1 encoded.V10000Required
progressStatusStringIf value is set to "True", terminal will return progress to POS. Note: This feature is only available on Direct Integration.V5Optional
addHeaderString"true" or "false" (Default: false)V5Optional
addFooterString"true" or "false" (Default: false)V5Optional

Request example

{
  "apiVersion": "3.0",
  "istConfigCode": "example_istConfigCode",
  "dataId": "example_dataId",
  "dataTimestamp": "1969-12-31 23:59:59",
  "data": {
    "request": [
      {
        "idempotencyKey": "example_idempotencyKey",
        "action": "print",
        "printData": "example_printData"
      }
    ]
  }
}

Response Structure

ElementTypeDescriptionSizeRequired
apiVersionStringAPI version numberV20Required
statusCodeStringStatus code for the overall transaction requestV4Required
statusStringDescription of the statusCodeV50Required
dataIdStringMerchant defined unique identifier for the data objectV50Required
dataTimestampStringDate and time of the request (YYYY-MM-DD HH:MM:SS)F19Required
dataObjectObject that contains all transaction requests
responseArrayContains data applicable to transaction request
idempotencyKeyStringUnique transaction identifier to avoid duplicate requestV50Required
actionString"print"V50Required
statusCodeStringStatus code for individual requestV4Required
statusStringDescription of the individual statusCodeV50Required
completedString"true" or "false"V5Required

Response example

{
  "receipt": {
    "apiVersion": "3.0",
    "statusCode": "example_statusCode",
    "status": "example_status",
    "dataId": "example_dataId",
    "dataTimestamp": "1969-12-31 23:59:59",
    "data": {
      "response": [
        {
          "terminalId": "example_terminalId",
          "cloudTicket": "example_cloudTicket",
          "idempotencyKey": "example_idempotencyKey",
          "statusCode": "example_statusCode",
          "status": "example_status",
          "completed": "true",
          "action": "print"
        }
      ]
    }
  }
}

Errors

If your response contains errors, visit the Errors page for a detailed description of each one.