Skip to main content

Printing

Like the rest of the axept® PRO solution, the Printing & Scanning API is a RESTful endpoint residing on the target terminal.

URL

https://(TerminalIP):8080/POSitiveWebLink/1.1.0/rest/print

An HTTPS POST request should be sent to the above URL with the following parameters:

POST /print - Query String Parameters
Field NameStateData TypeDescription
tidMandatoryString

This is the Serial Number of the terminal that should print the request. This is printed on a label on the rear of the device.

POST /transaction - Header Parameters
AuthorizationMandatoryStringThis field should be populated with a value of
Bearer 6945595921271780

POST /print Body

POST /print Object
Field NameStateData TypeDescription
printFormatMandatoryEnum

Indicates what kind of printing you wish to complete. The following values are allowed:

bitmapYou wish to print an image or bitmap only.

Requires receipt only as the next field.
linesYou wish to print text a line at a time, including optionally images in-line.

Use printContent only as the next field. This is an array containing multiple objects.
printContentConditionalArrayMandatory for lines ONLY.

An Array of Objects, one for each line required.
receiptConditionalStringMandatory for bitmap ONLY.

Base64 Encoded bitmap to be printed.
caution

Images/Bitmaps must be no wider that 384 pixels.

tip

Each object in the printContent Array can contain EITHER the text or img Objects, as described below.

If printFormat is bitmap however, you will only need the receipt field above.

See our Examples below for more information.

printContent Array - text Object

text Object
Field NameStateData TypeDescription
textMandatoryStringThe text you wish to print in its unformatted state. Mandatory where text is used.

This field supports the JavaScript escape sequence command \n for a New Line, allowing you to split or wrap text manually. You can also use this to add multiple line spaces. Please see the examples below for more details.
attributesMandatoryIntegerA numeric value that tells axept® PRO how to format the provided text. Any valid additive combination of the following values can be accepted.

0Normal, left-aligned text.
1Bold text.
4Medium text.
8Large text.
16Right-aligned text.
32Centre-aligned text.
Any valid combination is possible, however note that Medium/Large, and Right/Centre cannot be combined and will result in an error.

Example: Bold(1), Medium(4), Right-Aligned(16) text would require attributes=21 because 1+4+16 = 21.

Mandatory where text is used.

printContent Array - img Object

The img object is a single field and value pair as detailed below.

text Object
Field NameStateData TypeDescription
imgMandatoryStringBase64 encoded bitmap of the image you wish to print.
caution

Images/Bitmaps must be no wider that 384 pixels.

note

Examples containing Base64 encoded images are very large. It is recommended that you copy them from below and view them in a different program.

{
"printFormat": "bitmap",
"receipt": "Qk0+DwAAAAAAAD4AAAAoAAAAgAEAAFAAAAABAAEAAAAAAAAPAAB0EgAAdBIAAAAAAAAAAAAAAAAAAP///wD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////7///////////////////////////////////////////////////////////////7///////////////////////////////////////////////////////////////7///////////////////////////////////////////////////////////////7///////////////////////////////////////////////////////////////7///////////////////////////////////////////////////////////////7///////////////////////////////////////////////////////////////7///////////////////////////////////////////////////////////////7///////////////////////////////////////////////////////////////7///////////////////////////////////////////////////////////////7///////////////////////////////////////////////////////////////7////////wP/////////////////////////////////////////////////////7///////8AB/////////////////////////////////////////////////////7///////AAAH////////////////////////////////////////////////////7//////+AAAB///////////////////5///////+f///////////////////////7//////4AAAA///////////////////4///////+P///////////////////////7//////8AAAAP//////////////////4///////+P///////////////////////7//////OAAAAH//////////////////4////////P///////////////////////7/////8DB/8AD//////////////////4////////H///////////////////////7/////8Dn//gB//////////////////4////////H///////////////////////7/////4B///4A//////////////////4////////j///////////////////////7/////4B///8Af/////////////////4////////j///////////////////////7/////8D/D//AP/////////////////4////////z///////////////////////7/////sD/B//AP//////4eB4H+B/weB4+D//4Pj/x/5/+P/z/4H/j/8f8P8H////7/////H/+B8HwH//////gGB4H+B/AGB44A//gDj/x/4/+P/j/gB/j/8fwPwB////7/////D/+B4DwH/////+AAB4H+B+ACB4gAf+AAj/w/4/+P/j+AA/j/8fgPgA////7////+B/8DwB4D/////8AAB4H+B8AAB4D8P8H4j/g/4/+P/j8H4fj/8fD/H4f///7////+A/4PgB8D/////4AAB4H+B4AAB4P/H4f8D/g/4/+P/j8f+Pj/8fH+P8f///7////+B/w/gA8B/////4AAB4H+BwAAB4f/j4/+D/Ef4/+P/j4/+Hj/8fH+P8f///7////8B/h/gA8B/////4D4B4H+BwDwB4//jx//D/Ef4/+P/jx//Hj/8fH8f8f///7////8B+D/gA+B/////wH8B4H+BwP8B4//xx//j/OP4/+P/jx//Hj/8fP+f8f///7////8DwH/AB+B/////wP+B4H+BgP8B4//xx//j+OP4/+P/jx//nj/8fP//4f///7////8DgP/AD/A/////wP+B4H+BgP8B4//xx//j+PP4/+P/jz///j/8fP//A////7////4HgP+AH/A/////wP+B4H+BgP+B4//xj//j8fH4/+P/jwAAHj/8fP/4B////7////4HgP8AP/A/////wP+B4H+BgP+B4//xj//j8fH4/+P/jwAAHj/8fP/gP////7////4Hgf4D//A/////wP+B4H+BgP8B4//xx//j4/D4/+P/jz//nj/8fP/B/////7////4Hgf4H//A/////wP+B4H+BgP8B4//xx//j4/j4/+P/jx//Hj/8fP+P/////7////4Hw/wf8fA/////wH8B4D+BwP8B4//hx//D4/j4/+P/jx//Hj/8fP+f8f///7////4H//g/4PA/////4D4B4D8BwDwB4f/j4//Dx/x4/+H/j4//Hj/4/P+f8f///7////4H//B/wPA/////4AAB4AABwAAB4P/H4/+Dx/x4f8H/j4/+Ph/4/P+f8f///7////4D/8D/wPA/////8AAB4AAD4AAB4H+H8P8Dj/w4P8T/H8P8fg/x/P+P4////7////8D/4H/gfA/////8AAB4AAH8AAB4B4P8Dgjj/45Dww8H+DwfgPB4APHg////7////8D/gP/h+B/////+AAB4EAH+ACB4wAf/ABjH/4YgB4AP/AB/iAD4APAB////7////8B+Af+H+B//////gGB4GAf/AGB48B//wHjH/8YwD+A//wD/jgP4APwH////7////8B8A/8P8B//////4eB4Hh//weB////////////+f/n//////4//P///////7////8B8A/4f8B///////+B/////////////////////////////////P///////7////+A8B/A/8D///////+B/////////////////////////////////P///////7////+A8B+A/+D///////+B/////////////////////////////////P///////7/////AeD8B//H///////+B/////////////////////////////////P///////7/////APH8B//n///////+B/////////////////////////////////////////7/////gH/8B/h////////+B/////////////////////////////////////////7/////wD/8D/B///////////////////////////////////////////////////7/////4B/+H/A///////////////////////////////////////////////////7/////4A////A///////////////////////////////////////////////////7/////8AH//nB///////////////////////////////////////////////////7/////+AB/8Dz///////////////////////////////////////////////////7//////AAAAB////////////////////////////////////////////////////7//////gAAAA////////////////////////////////////////////////////7//////4AAAA////////////////////////////////////////////////////7//////+AAAD////////////////////////////////////////////////////7///////AAAH////////////////////////////////////////////////////7///////8AB/////////////////////////////////////////////////////7////////gP/////////////////////////////////////////////////////7///////////////////////////////////////////////////////////////7///////////////////////////////////////////////////////////////7///////////////////////////////////////////////////////////////7///////////////////////////////////////////////////////////////7///////////////////////////////////////////////////////////////7///////////////////////////////////////////////////////////////7///////////////////////////////////////////////////////////////7///////////////////////////////////////////////////////////////7///////////////////////////////////////////////////////////////7///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8="
}

/reprint API

In addition to giving you control over the printer for bespoke printing, you can also use the Printing & Scanning API to reprint cardholder receipts for previous transactions, even if printing was disabled originally.

URL

https://(TerminalIP):8080/POSitiveWebLink/1.1.0/rest/reprint

An HTTPS POST request should be sent to the above URL with the following parameters:

POST /reprint - Query String Parameters
Field NameStateData TypeDescription
tidMandatoryString

This is the Serial Number of the terminal that should print the request. This is printed on a label on the rear of the device.

POST /transaction - Header Parameters
AuthorizationMandatoryStringThis field should be populated with a value of
Bearer 6945595921271780
POST /transaction - Body Parameters
reprintRequestMandatoryBodyProvides the required information to print your image or text.

POST /reprint Body

POST /print Object
Field NameStateData TypeDescription
utiMandatoryStringThe unique transaction identifier for the original transaction. This is returned in the Payment Response in the axept® PRO /transaction API.
copyMandatoryEnum

Indicates which receipt you want to print. The following values are allowed:

MERCHANTYou wish to print the merchant copy, which includes the MID & TID in full.
CARDHOLDERYou wish to print the cardholder copy, which only shows the last four digits of the MID & TID.
Both receipts indicate their copy type and that they are duplicate copies.

/reprint Examples

{
"uti": "0445B143-C8B5-4A02-A258-667049065CF2",
"copy": "MERCHANT"
}

Printing Error Codes

A successful /print or /reprint request will result in a 200 OK HTTP Response code with the following fields:

{
"additionalInfo": "Success",
"resultCode": 0,
"resultError": "",
"resultType": "OK"
}

In some cases, unsuccessful attempts will result in a 4xx HTTP Response code, with the below responses.

Error Responses
HTTP Response CodeJSON Response dataResolution
400 - Bad input parameter or invalid JSON"additionalInfo": "Image format invalid or unsupported",
"resultCode": -3,
"resultError": "Bad input parameter or invalid JSON",
"resultType": "Error"
Ensure the image data is a properly encoded Base64 bitmap, and retry.
400 - Bad input parameter or invalid JSON"additionalInfo": "Device doesn't have a printer",
"resultCode": -2,
"resultError": "Bad input parameter or invalid JSON",
"resultType": "Error"
Ensure the image data is a properly encoded Base64 bitmap, and retry.
400 - Bad input parameter or invalid JSONN/ACorrect the JSON data being supplied.
400 - UTI not foundN/ACorrect the uti being supplied in the reprint request.
408 - Request TimeoutN/ACheck the receipt size. Long images can exceed the amount of data available in the request.
413 - Content Too Large"additionalInfo": "Image too wide",
"resultCode": -4,
"resultError": "Content Too Large",
"resultType": "Error"
Resize the base64 encoded image to be max. 384 pixels
caution

This is NOT an exhaustive list of errors. You will receive other regular HTTP Response Codes in addition to those detailed above.