Use the POST /api/v1/receipt
endpoint to print a receipt on a print-capable PIN
pad. The posted transaction data will be formatted using either the default template, or a custom
template contained in the request, and printed on the PIN pad.
If no template is provided in the request's customTemplate
field, triPOS will use its
Default Receipt Template The default template contains placeholders identified by
double beginning and ending curly brackets, e.g., "{{fieldName}}"
where fieldName
corresponds to the name of a field contained in the request. triPOS replaces the placeholders
with the field's value. Furthermore, the template contains custom tags which can be placed along with placeholder, e.g,
"@{Center}{{ApplicationLabel}}"
, triPOS uses to identify and remove data not needed for the
receipt based on other field values.
triPOS performs the following steps when replacing the template placeholders with the request data to create the receipt:
emv
field is always displayed.receiptType
("Sale", "Refund", "Void", "Authorization") is always displayed to the left of the subTotalAmount
.cashbackAmount
and tipAmount
are not present or 0, no Total is displayed.pinVerified
is true, the signature section is not displayed.emv.Tags
are present, the pin verified section is not displayed.header
and footer
string arrays is displayed on a separate line.If the default template isn't adequate, a custom template may be passed into the "customTemplate" field of the request. Use the same placeholders and tag ids contained in the default template so triPOS can properly replace and process them. If no placeholders or ids are used, triPOS will print the custom template as is.
Ingenico do not support HTML so custom/default template have been used. It has some set of rules:
@{Center},@{Left},@{Right}
.\r\n
is used for line break.@{Label}
is used for key of the placeholder value.@{Bold},@{Reverse},@{DoubleChar},@{BigChar}
.
This can be apply only on value placeholder not on the @{Label}
placeholder.
@{Bold}
prefix of value placeholder is used to make text bold. e.g.@{Bold}{{Header}}
@{Reverse}
prefix of value placeholder is used to make text background black.@{DoubleChar}
prefix of value placeholder is used to make Double-wide characters.@{BigChar}
prefix of value placeholder to make Very large typeface. Three line feeds must follow a line of
these characters to prevent overlap with the next characters or lines.
To use BigChar we can send the request in <@BigCharOn>{{Header}}<@BigCharOff>
this fromat
Using both alignment and formatting tags together will make alignment tags to be disabled or unsupported
Example: @{Center}@{Bold}{{Header}}
will make Header bold but the alignment will not be centered
The result of the print operation is return in the printResult
field.
POST http://localhost:8080/api/v1/receipt
Body: {
"receiptType": "Sale",
"accountNumber": "xxxxxxxxxxxx1234",
"approvalNumber": "123456",
"totalAmount": "25.00",
"cardLogo": "Visa",
"copyType": "Customer",
"currencyCode": "840",
"entryMode": "Swiped",
"emv": {
"applicationIdentifier": "A0000000031010",
"applicationLabel": "Visa Debit",
"applicationPreferredName": "",
"cryptogram": "AAC 41AF2CF95121D3CA"
},
"hostResponseCode": "00",
"isApproved": "true",
"laneId": "1",
"referenceNumber": "12345678",
"terminalId": "00000000",
"transactionDateTime": "September 3, 2016 2:56 PM ",
"transactionId": "2000986788",
"cashbackAmount": "0",
"tipAmount": "5.00",
"surchargeAmount" : "2:00",
"footer": ["THANK YOU"],
"header": ["Vantiv Integrated Payments", "500 North Juniper Drive", "Suite 100", "Chandler, AZ 85226", "(866) 435-3636"],
"pinVerified": "false",
"subTotalAmount": "20.00"
}