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 customermerchantReceipt– 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"]
| Position | Field | Description |
|---|---|---|
| 0 | Text | The content to display |
| 1 | Font size | Size from 1-9 (1 = smallest, 9 = largest) |
| 2 | Alignment | L (left), C (center), R (right) |
| 3 | Style | N (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
| Size | Typical Use |
|---|---|
| 1 | Fine print, URLs |
| 2 | Secondary information |
| 3 | Standard text |
| 5 | Section headers |
| 6 | Important amounts |
| 9 | Logo/branding |
Common Receipt Lines
| Line | Description |
|---|---|
| paynt | Branding header |
| MERCHANT COPY / CUSTOMER COPY | Receipt type identifier |
| MID | Merchant ID |
| TID | Terminal ID |
| Terminal S/N | Terminal serial number |
| Date/time | Transaction timestamp |
| Transaction type | SALE, REFUND, etc. |
| Amount | Transaction amount |
| Auth code | Authorization code from issuer |
| Masked PAN | Card number (masked) |
| CVM | Cardholder verification method |
| Card type | VISA, MASTERCARD, etc. |
| AID | Application identifier |
| Receipt number | Sequential 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.
Related
- How EPOS Communication Works – Understanding the API flow