Please see below for information on configuring the getLastReceiptRequest, as well as the expected getLastReceiptResponse.
getLastReceiptRequest - originating from the application to initiate a request to get the receipt data for the last transaction
getLastReceiptResponse - originating from the card terminal to return the response of a get last receipt request
The Get Last Receipt request returns receipt data in its response. To instead re-print a physical receipt, please see the Reprint request
getLastReceiptRequest
For a typical request the client must provide the following information:
Field
Type
Length (chars)
Description
Example
Required
Card terminal support
msgLength
String
4
A 4-digit number padded with leading zeros indicating message length minus 4 (including any separators). The request will be rejected if the correct message length is not provided.
‘0063’
sessionId
String
6
A unique number to control integrity of session sequence.
‘002690’
msgType
String
3
‘700’
‘700’
✅
msgCode
String
2
‘00’
‘00’
✅
The above information elements must be joined into one single string using ‘|’ as a separator. i.e.
0014|002690|700|00
If the resulting string gets appropriately transmitted to the terminal, the terminal will respond with a getLastReceiptResponse message700
getLastReceiptResponse
In a getLastReceiptRequest the terminal responds with a getLastReceiptResponse to indicate if the transaction has been approved or not.
A getLastReceiptResponse for an approved transaction looks as follows:
0306|000014|710|00|1.23|0.0|134811422007|451545******0080|2021-12-14T13:59:57.673428+02:00|A0000000031010|EL096019265|kifisias 10, 12342 Athens|AGROTIKOS SYNETAIRISMOS MESOLOGGIOU NAUPAKTIAS I ENOSI|true|null|null|null|null|null|null|null|0000|false|false|1490355478|EUR|No text|v3.11.0(2451)|null|null|07|true
The table below summarises the contents of the response.
Field
Length (chars)
Description
Example
Card terminal support
msgLength
4
A 4-digit number padded with leading zeros indicating the length of the message that follows (including separators). Before considering the msgLength value, please make sure that you've decoded the terminal response with UTF-8.
'0129'
seqTxnId
6
A 6 digit number matching the value sent in seqTnxNum field of the preceding txReady message.
'000032'
msgTypeResp
3
'710'
'710'
respCode
2
Approval status. '00' indicates approval. All other values indicate failure codes. See failure code table at the end.
'00'
amountResp
variable
The transaction's amount.
'123.00'
tipAmountResp
2
'00' (currently not used)
'00'
rrn
12
The Retrieval Reference Number of the transaction RRN.
'123456833121'
accountNumber
variable up to 20
The card number masked. Note that only the 6 first and the 4 last digits are provided. All other digits are masked with stars.
'479275\*\*\*\*\*\*9999'
transactionDate
variable up to 40
The transaction date in ISO 8601 format.
'2019-09-13T12:14:19.8703452+03:00'
aid
variable up to 20
A string indicating the AID of the card.
'A000000003101001'
vatNumber
variable up to 20
The transaction's amount.
'123.00'
address
variable
The address of merchant.
‘Main St 123, 12312 Anytown’
businessDescription
variable up to 20
'00' (currently not used)
'00'
printLogoOnMerchantReceipt
5
A boolean indicating weather the VivaWallet logo should be printed on merchant receipt.
'true'
merchantReceiptPAN
variable up to 19
This field contains the value of the PAN (and additional clipping) that should be printed in merchant receipt. If is empty, then apply the default clipping
'629914XXXXXXXXX6770'
cardholderReceiptPAN
variable up to 19
This field contains the value of the PAN (and additional clipping) that should be printed in customer receipt. If is empty, then apply the default clipping
'629914XXXXXXXXX6770'
transactionReceiptAcquirerZone
variable up to 200
If it is not empty then this value should be printed at the end of the customer receipt
'qwerty123456'
cardholderReceiptText
variable up to 200
If it is not empty then this value should be printed at the end of the customer receipt
'qwerty123456'
merchantReceiptText
variable up to 200
If it is not empty then this value should be printed at the end of the customer receipt
'qwerty123456'
cardholderName
variable
Name of the cardholder.
'JOHN DOE'
cardExpirationDate
4
Expiration date of the card (YYMM).
'2212'
cardholderNameExpirationDateFlags
4
Each char may be 0 (false) or 1 (true) and indicates if the cardholder name and the expiration date should be printed on the merchant/cardholder receipts).
1st char: if 1 then the Cardholder Name should be printed in the merchant's receipt. If 0, then it should not.
2nd char: if 1 then the Cardholder Name should be printed in the cardholder's receipt. If 0, then it should not.
3rd char: if 1 then the Expiration Date should be printed in the merchant's receipt. If 0, then it should not.
4th char: if 1 then the Expiration Date should be printed in the cardholder's receipt. If 0, then it should not.
'1010'
needsSignature
5
A boolean indicating if the receipt needs a signature section.
'false'
addQRCode
5
A boolean indicating if the order code should be printed as a QR. (Used in successful receipts)
'false'
terminalSerialNumber
variable up to 15
The serial number of the terminal. (Used in successful receipts)
“1234567891“
currency
variable up to 5
The currency of the transaction. (Used in successful receipts)
“EUR“
errorText
variable up to 200
Text to print on the receipt stating the error description and the error code. (Used in declined receipts)
“Transaction failed - Z-3“
applicationVersion
variable up to 15
The version of the application. (Used in declined receipts)
'v3.7.0(1956)'
oldBalance
variable
The old balance of the cardholder. (Used in successful receipts)
'123.00'
newBalance
variable
The new balance of the cardholder. (Used in successful receipts)
'123.00'
entryMode
2
The POS entry mode. (Used in successful receipts)
'07'
printVatOnMerchantReceipt
5
A boolean indicating weather the merchant VAT should be printed on merchant receipt.
'true''
isReprint
5
A boolean indicating weather this receipt is reprint
'true''
Get Support
If you would like to integrate with Viva, or if you have any queries about our products and solutions, please see our Contact & Support page to see how we can help!