Skip to main content

Receipt Data Structure

Transaction responses include receipt data that you can use to display or print receipts in your POS system.


Overview

Each transaction status response includes two receipt arrays:

  • cardholderReceipt – For the customer
  • merchantReceipt – For the merchant's records

Data Format

Receipt data is returned as an array of line items. Each line is an array with four elements:

["Text content", "font_size", "alignment", "style"]
PositionFieldDescription
0TextThe content to display
1Font sizeSize from 1-9 (1 = smallest, 9 = largest)
2AlignmentL (left), C (center), R (right)
3StyleN (normal), B (bold)

Example Receipt Data

"merchantReceipt": [
["paynt", "9", "C", "B"],
["www.paynt.com", "1", "C", "N"],
["MERCHANT COPY", "5", "C", "B"],
["MID: 800574917121001", "3", "L", "B"],
["TID: 34550590", "3", "L", "B"],
["Terminal S/N: 1852519496", "3", "L", "B"],
["27-02-2025 10:00:24", "3", "C", "N"],
["SALE", "5", "C", "B"],
["AMOUNT", "1", "C", "N"],
["€ 1.00", "6", "C", "B"],
["AUTHORISED - 308373", "3", "C", "N"],
["47**********0010", "3", "C", "N"],
["NO CARDHOLDER VERIFICATION", "2", "C", "N"],
["VISA CREDIT CONTACTLESS", "3", "L", "N"],
["AID: A0000000031010", "3", "L", "N"],
["Receipt 1", "3", "L", "N"],
["* END OF RECEIPT *", "3", "C", "B"]
]

Rendered Example

Based on the data above, the receipt would render as:

              paynt
www.paynt.com
MERCHANT COPY
MID: 800574917121001
TID: 34550590
Terminal S/N: 1852519496
27-02-2025 10:00:24
SALE
AMOUNT
€ 1.00
AUTHORISED - 308373
47**********0010
NO CARDHOLDER VERIFICATION
VISA CREDIT CONTACTLESS
AID: A0000000031010
Receipt 1
* END OF RECEIPT *

Font Size Reference

SizeTypical Use
1Fine print, URLs
2Secondary information
3Standard text
5Section headers
6Important amounts
9Logo/branding

Common Receipt Lines

LineDescription
payntBranding header
MERCHANT COPY / CUSTOMER COPYReceipt type identifier
MIDMerchant ID
TIDTerminal ID
Terminal S/NTerminal serial number
Date/timeTransaction timestamp
Transaction typeSALE, REFUND, etc.
AmountTransaction amount
Auth codeAuthorization code from issuer
Masked PANCard number (masked)
CVMCardholder verification method
Card typeVISA, MASTERCARD, etc.
AIDApplication identifier
Receipt numberSequential receipt number

Parsing Receipt Data

JavaScript Example

function parseReceipt(receiptData) {
return receiptData.map(line => ({
text: line[0],
fontSize: parseInt(line[1]),
alignment: line[2],
style: line[3]
}));
}

function renderReceiptHTML(receiptData) {
return receiptData.map(line => {
const [text, size, align, style] = line;
const alignClass = { 'L': 'left', 'C': 'center', 'R': 'right' }[align];
const fontWeight = style === 'B' ? 'bold' : 'normal';
const fontSize = 8 + (parseInt(size) * 2); // Scale to pixels

return `<div style="text-align: ${alignClass}; font-weight: ${fontWeight}; font-size: ${fontSize}px;">${text}</div>`;
}).join('');
}

Python Example

def parse_receipt(receipt_data):
return [{
'text': line[0],
'font_size': int(line[1]),
'alignment': line[2],
'style': line[3]
} for line in receipt_data]

def render_receipt_text(receipt_data):
lines = []
for line in receipt_data:
text, size, align, style = line
width = 40 # characters

if align == 'C':
formatted = text.center(width)
elif align == 'R':
formatted = text.rjust(width)
else:
formatted = text.ljust(width)

lines.append(formatted)

return '\n'.join(lines)

Tips

  • Both cardholder and merchant receipts contain similar information but are labeled differently.
  • The receipt data is generated by the terminal based on the transaction result.
  • You can use this data to display receipts in your POS UI or send digital receipts.
  • Font sizes are relative—map them to your rendering system appropriately.