Get Last Receipt

An overview of the Get Last Receipt message.

Overview

Please see below for information on configuring the getLastReceiptRequest, as well as the expected getLastReceiptResponse.

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’ Android Card Terminals
sessionId String 6 A unique number to control integrity of session sequence. ‘002690’ Android Card Terminals
msgType String 3 ‘700’ ‘700’ Android Card Terminals
msgCode String 2 ‘00’ ‘00’ Android Card Terminals

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' Android Card Terminals
seqTxnId 6 A 6 digit number matching the value sent in seqTnxNum field of the preceding txReady message. '000032' Android Card Terminals
msgTypeResp 3 '710' '710' Android Card Terminals
respCode 2 Approval status. '00' indicates approval. All other values indicate failure codes. See failure code table at the end. '00' Android Card Terminals
amountResp variable The transaction's amount. '123.00' Android Card Terminals
tipAmountResp 2 '00' (currently not used) '00' Android Card Terminals
rrn 12 The Retrieval Reference Number of the transaction RRN. '123456833121' Android Card Terminals
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' Android Card Terminals
transactionDate variable up to 40 The transaction date in ISO 8601 format. '2019-09-13T12:14:19.8703452+03:00' Android Card Terminals
aid variable up to 20 A string indicating the AID of the card. 'A000000003101001' Android Card Terminals
vatNumber variable up to 20 The transaction's amount. '123.00' Android Card Terminals
address variable The address of merchant. ‘Main St 123, 12312 Anytown’ Android Card Terminals
businessDescription variable up to 20 '00' (currently not used) '00' Android Card Terminals
printLogoOnMerchantReceipt 5 A boolean indicating weather the VivaWallet logo should be printed on merchant receipt. 'true' Android Card Terminals
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' Android Card Terminals
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' Android Card Terminals
transactionReceiptAcquirerZone variable up to 200 If it is not empty then this value should be printed at the end of the customer receipt 'qwerty123456' Android Card Terminals
cardholderReceiptText variable up to 200 If it is not empty then this value should be printed at the end of the customer receipt 'qwerty123456' Android Card Terminals
merchantReceiptText variable up to 200 If it is not empty then this value should be printed at the end of the customer receipt 'qwerty123456' Android Card Terminals
cardholderName variable Name of the cardholder. 'JOHN DOE' Android Card Terminals
cardExpirationDate 4 Expiration date of the card (YYMM). '2212' Android Card Terminals
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' Android Card Terminals
needsSignature 5 A boolean indicating if the receipt needs a signature section. 'false' Android Card Terminals
addQRCode 5 A boolean indicating if the order code should be printed as a QR. (Used in successful receipts) 'false' Android Card Terminals
terminalSerialNumber variable up to 15 The serial number of the terminal. (Used in successful receipts) “1234567891“ Android Card Terminals
currency variable up to 5 The currency of the transaction. (Used in successful receipts) “EUR“ Android Card Terminals
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“ Android Card Terminals
applicationVersion variable up to 15 The version off the application. (Used in declined receipts) 'v3.7.0(1956)' Android Card Terminals
oldBalance variable The old balance of the cardholder. (Used in successful receipts) '123.00' Android Card Terminals
newBalance variable The new balance of the cardholder. (Used in successful receipts) '123.00' Android Card Terminals
entryMode 2 The POS entry mode. (Used in successful receipts) '07' Android Card Terminals
printVatOnMerchantReceipt 5 A boolean indicating weather the merchant VAT should be printed on merchant receipt. 'true'' Android Card Terminals
isReprint 5 A boolean indicating weather this receipt is reprint 'true'' Android Card Terminals

Get Support

If you would like to integrate with Viva Wallet, or if you have any queries about our products and solutions, please see our Get Support page to see how we can help!