Sale request

The client app must implement a mechanism to send messages using Android intents and URI calls and to receive the result in a custom URI callback.

Sale request

For a typical sale request the client app must provide the following information:

Field Description Example Card terminal support
scheme The Viva custom URL scheme, the host and the version. 'vivapayclient://pay/v1' Android Card TerminalsViva Wallet POS app for Android
merchantKey The merchant's key. For successful validation, should not be empty.
Deprecated: you may pass any value.
'SG23323424EXS3' Android Card TerminalsViva Wallet POS app for Android
appId The client app ID. For successful validation, should not be empty. 'com.example.myapp' Android Card TerminalsViva Wallet POS app for Android
action Sale transaction. For successful validation, should not be empty. 'sale' Android Card TerminalsViva Wallet POS app for Android
clientTransactionId A unique transaction ID transmitted to the host for storage with the transaction. Note that this value will be provided in the Merchant Reference field provided in the sales export response. '12345678901234567890123456789012' Android Card TerminalsViva Wallet POS app for Android
amount Amount in cents without any decimal digits. If action is sale or bill payment, must not be empty. Must be integer and bigger than zero. '1200' = 12 euro Android Card TerminalsViva Wallet POS app for Android
tipAmount The tip that will be added on top of the amount. '200' = 2 euro Android Card TerminalsViva Wallet POS app for Android
withInstallments Enable card installments. Only in Greek Merchants 'true' Android Card TerminalsViva Wallet POS app for Android
preferredInstallments Number of preferred card installments. Only in Greek Merchants. If the number is between the allowed range and the card supports installments then the flow complete without any prompt for installments. If the number is 0 or > max allowed number of installments then the user will be prompt to enter the number in the app. If the card does not support installments then the app will request from the user how to proceed with the flow. If withInstallments is true preferredInstallments must be integer and not empty. '10' Android Card TerminalsViva Wallet POS app for Android
callback The URI callback that will handle the result. For successful validation, should not be empty. 'mycallbackscheme://result' Android Card TerminalsViva Wallet POS app for Android
show_receipt A flag indicating if the receipt and transaction result will be shown. If true both transaction result and receipt will be shown. If false receipt will not be shown and result will be shown if show_transaction_result is true. 'true' Viva Wallet POS app for Android
show_transaction_result A flag indicating whether transaction result will be shown. 'true' Viva Wallet POS app for Android
show_rating A flag indicating if the rating flow will be shown. 'true' Android Card TerminalsViva Wallet POS app for Android
ISV_amount The amount the ISV charges. Only for ISV Partners '100' = 1€ Android Card TerminalsViva Wallet POS app for Android
ISV_clientId The ID of the ISV client. It is mandatory that if client ID is provided the ISV_amount and ISV_clientSecret parameters should be provided too. Only for ISV Partners
Refer to note below.
'qwerty123456' Android Card TerminalsViva Wallet POS app for Android
ISV_clientSecret The secret of the ISV client. Only for ISV Partners
Refer to note below.
'qwerty123456' Android Card TerminalsViva Wallet POS app for Android
ISV_sourceCode The reseller source code of the ISV. Only for ISV Partners
Refer to note below.
'qwerty123456' Android Card TerminalsViva Wallet POS app for Android
protocol The protocol used. Always pass this value: int_default Android Card Terminals

ISV parameter info:

The above parameters must be used to create a URI call. Please see the below examples:

Intent payIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(
                        "vivapayclient://pay/v1"
                                + "?merchantKey="MY_MERCHANT_KEY""
                                + "&appId=com.example.myapp"
                                + "&action=sale"
                                + "&clientTransactionId=1234567801234"
                                + "&amount=1200"
                                + "&tipAmount=200"
                                + "&show_receipt="+true
                                + "&show_transaction_result="+true
                                + "&show_rating="+true
                                + "&ISV_amount="+100
                                + "&ISV_clientId=qwerty123456"
                                + "&ISV_clientSecret=qwerty123456"
                                + "&ISV_sourceCode=qwerty123456"
                                + "&callback=mycallbackscheme://result"));

payIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

payIntent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
                startActivity(payIntent);
Intent payIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(
                        "vivapayclient://pay/v1"
                                + "?merchantKey="MY_MERCHANT_KEY""
                                + "&appId=com.example.myapp"
                                + "&action=sale"
                                + "&clientTransactionId=1234567801234"
                                + "&amount=1200"
                                + "&tipAmount=200"
                                + "&show_receipt="+true
                                + "&show_transaction_result="+true
                                + "&show_rating="+true
                                + "&withInstallments="+true
                                + "&preferredInstallments="+10
                                + "&ISV_amount="+100
                                + "&ISV_clientId=qwerty123456"
                                + "&ISV_clientSecret=qwerty123456"
                                + "&ISV_sourceCode=qwerty123456"
                                + "&callback=mycallbackscheme://result"));

payIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

payIntent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
                startActivity(payIntent);

Sale response

After executing a sale transaction the card terminal app responds with a sale response result to indicate if the transaction has been approved or not.

The result is received as a URI in the callback activity intent:

Uri result = getIntent().getData()`

The table below summarises the contents of an approved response.

Field Description Example Card terminal support
callback The URI callback that will handle the result. 'mycallbackscheme://result' Android Card TerminalsViva Wallet POS app for Android
status The status of the transaction. 'success' Android Card TerminalsViva Wallet POS app for Android
message A string containing information about the transaction status. 'Transaction successful' Android Card TerminalsViva Wallet POS app for Android
action Sale transaction. 'sale' Android Card TerminalsViva Wallet POS app for Android
clientTransactionId The client transaction ID. '12345678901234567890123456789012' Android Card TerminalsViva Wallet POS app for Android
amount The amount in cents without any decimal digits. If action is cancel and amount is not empty must be integer and bigger than zero.
(Used in successful and declined receipts)
'1200' = 12 euro Android Card TerminalsViva Wallet POS app for Android
tipAmount How much of the amount in cents is considered as tip without any decimal digits.
(Used in successful and declined receipts)
'200' = 2 euro Android Card TerminalsViva Wallet POS app for Android
verificationMethod The verification method used. 'CHIP-PIN' Android Card TerminalsViva Wallet POS app for Android
rrn The retrieval reference number of the transaction RRN.
(Used in successful and declined receipts)
'123456833121' Android Card TerminalsViva Wallet POS app for Android
cardType The card type. 'VISA' Android Card TerminalsViva Wallet POS app for Android
accountNumber The card number masked. Note that only the 6 first and the 4 last digits are provided. All other digits are masked with stars.
(Used in successful and declined receipts)
'479275\*\*\*\*\*\*9999' Android Card TerminalsViva Wallet POS app for Android
referenceNumber A 6-digit number indicating the transaction's STAN number. '833121' Android Card TerminalsViva Wallet POS app for Android
authorisationCode A 6-digit number indicating the transaction's Authorisation code provided by the host. '690882' Android Card TerminalsViva Wallet POS app for Android
tid A 12 character string indicating the terminal's TID number. ' 16016684' Android Card TerminalsViva Wallet POS app for Android
orderCode The order code. ' 9256110059000200' Android Card TerminalsViva Wallet POS app for Android
shortOrderCode 10-digit integer. '1234567890' Android Card TerminalsViva Wallet POS app for Android
installments Number of card installments. ' 10' Android Card TerminalsViva Wallet POS app for Android
transactionDate The transaction date in ISO 8601 format.
(Used in successful and declined receipts)
'2019-09-13T12:14:19.8703452+03:00' Android Card TerminalsViva Wallet POS app for Android
transactionId A unique identifier for the transaction. 'a78e045c-49c3-4743-9071-f1e0ed71810c' Android Card TerminalsViva Wallet POS app for Android
ISV_amount The amount that the ISV charges. '100' = 1€ Viva Wallet POS app for Android
ISV_clientId The ID of the ISV client. 'qwerty123456' Viva Wallet POS app for Android
ISV_clientSecret The secret of the ISV client. 'qwerty123456' Viva Wallet POS app for Android
ISV_sourceCode The reseller source code of the ISV. 'qwerty123456' Viva Wallet POS app for Android
aid A string indicating the AID of the card.
(Used in successful receipts)
'A000000003101001' Android Card Terminals
vatNumber The VAT number of merchant.
(if print VAT is enabled in the Viva POS app settings)
(Used in successful and declined receipts)
'123412341' Android Card Terminals
address The address of merchant
(if print address is enabled in the Viva POS app settings)
(Used in successful receipts)
‘Main St 123, 12312 Anytown’ Android Card Terminals
businessDescription Merchant’s Business/Trade/Store name (depending on what option is selected in the Viva POS app settings),
(Used in successful receipts)
'Wonka Industries' Android Card Terminals
printLogoOnMerchantReceipt A boolean indicating weather the VivaWallet logo should be printed on merchant receipt.
(Used in successful receipts)
'false' Android Card Terminals
merchantReceiptPAN 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.
(Used in successful receipts)
'629914XXXXXXXXX6770' Android Card Terminals
cardholderReceiptPAN 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 If it is not empty then this value should be printed at the end of the customer receipt.
(Used in successful receipts)
'qwerty123456' Android Card Terminals
cardholderReceiptText If is not empty then this value should be printed at the end of the customer receipt.
(Used in successful receipts)
'qwerty123456' Android Card Terminals
merchantReceiptText If is not empty then this value should be printed at the end of the customer receipt.
(Used in successful receipts)
'qwerty123456' Android Card Terminals
cardholderName Name of the cardholder.
(Used in successful receipts)
'JOHN DOE' Android Card Terminals
cardExpirationDate Expiration date of the card (YYMM).
(Used in successful receipts)
'2212' Android Card Terminals
cardholderNameExpirationDateFlags 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.

4rd char: if 1 then the Expiration Date should be printed in the cardholder's receipt. If 0, then it should not.
(Used in successful receipts)
'1010' Android Card Terminals
needsSignature A boolean indicating if the receipt needs a signature section.
(Used in successful receipts)
false Android Card Terminals
addQRCode A boolean indicating if the order code should be printed as a QR.
(Used in successful receipts)
false Android Card Terminals
terminalSerialNumber The serial number of the terminal.
(Used in successful receipts)
“1234567891“ Android Card Terminals
currency The currency of the transaction.
(Used in successful receipts)
“EUR“ Android Card Terminals
errorText Text to print on the receipt stating the error description and the error ccode.
(Used in declined receipts)
“Transaction failed - Z-3“ Android Card Terminals
applicationVersion The version off the application.
(Used in declined receipts)
'v3.7.0(1956)' Android Card Terminals
oldBalance The old balance of the cardholder.
(Used in successful receipts)
'200' = 2 euro Android Card Terminals
newBalance The new balance of the cardholder.
(Used in successful receipts)
'200' = 2 euro Android Card Terminals
entryMode The POS entry mode.
(Used in successful receipts)
'07' Android Card Terminals

A sale response result for an approved transaction looks as follows:

mycallbackscheme://result?status=success&message=Transaction successful&action=sale&clientTransactionId=1234567801234&amount=1200&tipAmount=0&verificationMethod=CONTACTLESS - NO CVM&rrn=107715996464&cardType=Debit Mastercard&referenceNumber=996464&accountNumber=537488******9666&authorisationCode=006593&tid=16000223&orderCode=1077172694000223&shortOrderCode=1077172694&transactionDate=2021-03-18T17:07:51.1888432+02:00&transactionId=2161282c-3989-4089-80f1-2ac555dc5f63

It is expected that certain transactions will fail for various reasons. A sale response result for a failed transaction looks as follows:

mycallbackscheme://result?status=fail&message=(-12) TRANSACTION_DECLINED_BY_SERVER&action=sale&clientTransactionId=1234567801234&amount=101&tipAmount=0&verificationMethod=CONTACTLESS - NO CVM&rrn=107715996469&cardType=Debit Mastercard&referenceNumber=996469&accountNumber=537488******9666&tid=16000223&orderCode=1077172696000223&shortOrderCode=1077172696&transactionDate=2021-03-18T17:09:13.1917889+02:00&transactionId=3ca278e7-0679-411e-8279-ebb29ee519b2

The structure of the message is the same as in the case of an approved transaction. Fields such as referenceNumber and authorisationCode may not have values since there is no STAN code available, nor an authorisation code.

POS Entry Mode Enumeration

Entry Mode Value
NONE '00'
MANUAL ENTRY '01'
MAGSTRIPE PAN '02'
BAR CODE READER '03'
OCR '04'
CHIP '05'
CONTACTLESS CHIP '07'
CONTACTLESS MAGSTRIPE '91'
MAGSTRIPE '90'
FALLBACK '80'
MOTO '09'

Get Support

If you have any questions about our solutions, or questions about how to integrate with our solutions, please refer to our Get Support page.