Sale request
An overview of the Sale request message for Android.
Overview
👉 The Sale request is used to prompt payment from the customer for a specific amount, including the desired tip amount. Once the customer has attempted or completed payment, a related transaction (either successful or unsuccessful) will be created.
This request allows for multimerchant functionality with the ISV schema. For multimerchant functionality without the ISV schema, please see Multimerchant 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 originating from the client app to initiate a request for a new Sale transaction.
- Sale response originating from the ‘viva.com | Terminal’ application to return the result of a Sale transaction.
Sale request
For a typical Sale request, the client app must provide the following information:
Field | Description | Example | Required | Card terminal support | Character limit | Type |
---|---|---|---|---|---|---|
scheme | The Viva custom URL scheme, the host and the version. | 'vivapayclient://pay/v1' | ✅ | ![]() ![]() |
||
appId | The client app ID. For successful validation, should not be empty. | 'com.example.myapp' | ✅ | ![]() ![]() |
||
action | Sale transaction. For successful validation, should not be empty. | 'sale' | ✅ | ![]() ![]() |
||
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' | ![]() ![]() |
2048 | String | |
amount | Amount in cents without any decimal digits. This value must not be empty and must be an integer larger than zero. | '1200' = 12 euro | ✅ | ![]() ![]() |
10 | integer (int32) |
tipAmount | The tip that will be added on top of the amount. This must be less than or equal to the amount. | '200' = 2 euro | ![]() ![]() |
10 | integer (int32) | |
withInstallments | Enable card installments. Only in Greek Merchants | 'true' | ![]() ![]() |
Boolean | ||
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' | Required if withInstallments is set | ![]() ![]() |
2 | integer (int32) |
callback | The URI callback that will handle the result. For successful validation, should not be empty. | 'mycallbackscheme://result' | ✅ | ![]() ![]() |
||
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. | 'false' | ![]() |
|||
show_transaction_result | A flag indicating whether transaction result will be shown. | 'true' | ![]() |
Boolean | ||
show_rating | A flag indicating if the rating flow will be shown. | 'true' | ![]() ![]() |
Boolean | ||
ISV_amount | The amount the ISV charges. Only for ISV Partners | '100' = 1€ | Required for ISV integration | ![]() ![]() |
10 | integer (int32) |
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 PartnersRefer to note below. |
kf7fpz4c4gkc6ch03u4415o8acipq9xdefzuto4b6by94.apps.vivapayments.com | Required for ISV integration | ![]() ![]() |
||
ISV_clientSecret | The secret of the ISV client. Only for ISV PartnersRefer to note below. |
SY5Nt33019xdyagX85Ct6DQwpTiZhG | Required for ISV integration | ![]() ![]() |
||
ISV_sourceCode | The source code of the ISV. Only for ISV PartnersRefer to note below. |
[A payment source (physical store) that is associated with a terminal] How to create a payment source for ISV |
![]() ![]() |
4 | integer (int32) | |
ISV_merchantId | Support for merchant switching via the inter-app while utilizing ISV feature. | 8d40824a-a5d3-4639-819c-6e8bddb99477 | Required for multimerchant integration | ![]() |
||
ISV_currencyCode | Currency used for the given merchant when ISV is being used.You may find all the currency codes here. |
978 | Required for ISV integration | ![]() |
3 | integer (int32) |
ISV_merchantSourceCode | The source code of the merchant. | [A payment source (physical store) that is associated with a terminal] How to create a payment source for stores |
![]() |
4 | integer (int32) | |
ISV_customerTrns | The ISV transaction description for customer. | Description of items/services (up to 2048 characters). |
![]() |
2048 | String | |
ISV_clientTransactionId | A unique transaction ID transmitted to the host for storage with the transaction of the ISV. Note that this value will be provided in the Merchant Reference field provided in the sales export response. | 2600679 (up to 2048 characters). |
![]() |
|||
paymentMethod | The payment method to be presented first to the user. The same time, the user is able to select another payment method |
Choose one of the following values:
|
![]() |
|||
protocol | The protocol used. | Always pass this value: int_default | Required for Paydroid devices | ![]() |
ISV parameter info:
- ISV_amount is only for ISV partners and is required for ISV integration. This value is set during an API call.
- ISV_clientId can be found under Settings > API access in the Viva Wallet banking app
- ISV_clientSecret as above.
- ISV_sourceCode is the payment source for ISV set up under Sales > Physical Payments > Stores.
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"
+ "?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=kf7fpz4c4gkc6ch03u4415o8acipq9xdefzuto4b6by94.apps.vivapayments.com"
+ "&ISV_clientSecret=SY5Nt33019xdyagX85Ct6DQwpTiZhG"
+ "&ISV_sourceCode=Default"
+ "&ISV_currencyCode=978"
+ "&ISV_customerTrns=ItemDescription"
+ "&ISV_clientTransactionId=12345678901234567890123456789012"
+ "&ISV_merchantId=1234567890"
+ "&ISV_merchantSourceCode=9090"
+ "&paymentMethod=CardPresent"
+ "&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"
+ "?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=kf7fpz4c4gkc6ch03u4415o8acipq9xdefzuto4b6by94.apps.vivapayments.com"
+ "&ISV_clientSecret=SY5Nt33019xdyagX85Ct6DQwpTiZhG"
+ "&ISV_sourceCode=Default"
+ "&ISV_currencyCode=978"
+ "&ISV_customerTrns=ItemDescription"
+ "&ISV_clientTransactionId=12345678901234567890123456789012"
+ "&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"
+ "?appId=com.example.myapp"
+ "&action=sale"
+ "&clientTransactionId=1234567801234"
+ "&amount=1200"
+ "&tipAmount=200"
+ "&show_receipt=true"
+ "&show_transaction_result=true"
+ "&show_rating=true"
+ "&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"
+ "?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"
+ "&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 ‘viva.com | Terminal’ application 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.
Please see sample responses below for transactions made with the ‘viva.com | Terminal’ application for Android.
Parameters may vary for transactions made with Paydroid card terminals.
A sale response for an approved transaction looks as follows:
mycallbackscheme://result?status=success&message=Transaction successful&action=sale&clientTransactionId=1234567890&amount=146&tipAmount=23&rrn=121343565787&verificationMethod=CHIP&cardType=Debit Mastercard&accountNumber=515876******4490&referenceNumber=174010&authorisationCode=174010&tid=16109900&orderCode=3050112220001919&transactionDate=2023-06-13T11:22:33.1234567+03:00&transactionId=a12e1ba8-6153-7754-a6a8-e3d2654872c8&paymentMethod=CARD_PRESENT&shortOrderCode=3050112220
A sale response 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=CHIP&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
Note: transactions may fail for various reasons. Additionally, the structure of a failed 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' |
Loyalty Programs Enumeration | |
---|---|
EUROBANK_EPISTROFI | 1 |
NBG_GO4MORE | 2 |
Key to card terminal product categories
To understand the icons used on the above tables, see the below table.
Product category | Terminal models | Icon |
---|---|---|
Android Card Terminals | Android Card Terminal Ethernet, Android Card Terminal 4G, Mobile Card Terminal Plus, Mobile Card Terminal. | ![]() |
'viva.com | Terminal' application for Android | Mini Card Reader, Pocket Card Terminal connected via Bluetooth or USB to the 'viva.com | Terminal' application for Android. | ![]() |
Linux Card Terminals | Countertop, IM20, S900, S800, D200. | ![]() |
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 Contact & Support page to see how we can help!