Pre-auth request
An overview of the Pre-auth request message for Android.
Overview
👉 The Pre-auth request is used to initiate a pre-authorisation transaction.
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.
- Pre-auth request originating from the client app to initiate a request for a new Pre-auth transaction
- Pre-auth response originating from the ‘Viva.com Terminal’ application to return the result of a Pre-auth transaction
Pre-auth request
For a typical Pre-auth request, the client app must provide the following information:
Note on Pre-auth with ISV Scheme:
There are two ways to use the pre-authorization flow within the ISV scheme:
Option 1 — Pass ISV parameters directly in the pre-auth request:
Include the ISV parameters (e.g. ISV_clientId, ISV_clientSecret, ISV_sourceCode, ISV_currencyCode, ISV_merchantSourceCode, ISV_customerTrns, ISV_clientTransactionId) in the request as described below.
Option 2 — Capture later via API:
Initiate a pre-auth transaction as describe below, with no ISV parameters.
Capture the pre-auth transaction via API with out using the ISV credentials.
| Field | Description | Example | Required | Card terminal support | Character limit | Type |
|---|---|---|---|---|---|---|
| scheme | The Viva custom URL scheme, the host and the version. | 'vivapayclient://pay/v1' | ✅ | ![]() |
||
| merchantKey | The merchant's key. For successful validation, should not be empty. Deprecated: you may pass any value. |
'SG23323424EXS3' | ![]() |
|||
| appId | The client app ID. For successful validation, should not be empty. | 'com.example.myapp' | ✅ | ![]() |
||
| action | Pre-auth transaction. For successful validation, should not be empty. | 'pre_auth' | ✅ | ![]() |
||
| 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 | ||
| 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 | ✅ | ![]() |
2048 | decimal |
| 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' | boolean | |||
| show_transaction_result | A flag indicating whether transaction result will be shown. | 'true' | boolean | |||
| 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:
Please note, MOTO payments are not supported if the request is done with ISV credentials. |
string | |||
| 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 | '0' = 0 | Required for ISV integration but the amount on the pre_auth must be set to 0 | 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_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 | 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 | 2048 | String | ||
| saleToAcquirerData | 👉 JSON converted to base64 string containing additional metadata information. Please note that this parameter applies to Hospitality, Car Rentals & Dropshipping industries. Please visit this link to view a sample of the JSON and generate the encoded data. |
ewogICAgImFwcGxpY2F0aW9uSW5mbyI6IHsKICAgICAgICAiZXh0ZXJuYWxQbGF0Zm9ybSI6IHsKICAgICAgICAgICAgIm5hbWUiOiAidml2YS5jb218VGVybWluYWwiLAogICAgICAgICAgICAidmVyc2lvbiI6ICJjb20udml2YXdhbGxldC5zcG9jLnBheWFwcCB2NS4xOS43ICgxMDgxNSkiLAogICAgICAgICAgICAiaW50ZWdyYXRvciI6ICJWaXZhIgogICAgICAgIH0KICAgIH0KfQ== | ![]() |
Alphanumeric | ||
| callback | The URI callback that will handle the result. For successful validation, should not be empty. | 'mycallbackscheme://result' | ✅ | ![]() |
[*] These parameters are only applicable in Greece
The above parameters must be used to create a URI call. Please see the below example:
Intent payIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(
"vivapayclient://pay/v1"
+ "?merchantKey="MY_MERCHANT_KEY""
+ "&appId=com.example.myapp"
+ "&action=pre_auth"
+ "&clientTransactionId=1234567801234"
+ "&amount=1200"
+ "&show_receipt="+true
+ "&show_transaction_result="+true
+ "&show_rating="+true
+ "&ISV_amount=0"
+ "&ISV_clientId=kf7fpz4c4gkc6ch03u4415o8acipq9xdefzuto4b6by94.apps.vivapayments.com"
+ "&ISV_clientSecret=SY5Nt33019xdyagX85Ct6DQwpTiZhG"
+ "&ISV_sourceCode=5151"
+ "&ISV_currencyCode=978"
+ "&ISV_merchantSourceCode=11526"
+ "&ISV_customerTrns=IcustmerTrns"
+ "&ISV_clientTransactionId=test"
+ "&saleToAcquirerData=base64EncodedJsonData"
+ "&paymentMethod=CardPresent"
+ "&callback=mycallbackscheme://result"));
payIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
payIntent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
startActivity(payIntent);Pre-auth response
After executing a Pre-auth transaction the ‘Viva.com Terminal’ application responds with a Pre-auth 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' | ![]() |
| transactionEventId | The event ID code of the transaction. | '10012' | ![]() |
| status | The status of the transaction. | 'success' | ![]() |
| message | A string containing information about the transaction status. | 'Transaction successful' | ![]() |
| action | Pre-auth transaction. | 'pre_auth' | ![]() |
| clientTransactionId | The client transaction ID. | '12345678901234567890123456789012' | ![]() |
| 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 | ![]() |
| ISV_amount | The amount that the ISV charges must be set on the capture not on the pre_auth. | '0' = 0 | |
| ISV_clientId | The ID of the ISV client. | 'xxxxx.apps.vivapayments.com' | |
| ISV_clientSecret | The secret of the ISV client. | 'qtFskX94T2f2Dkhc364pa1cgaFn3D' | |
| ISV_sourceCode | The reseller source code of the ISV. | '1234' | |
| ISV_clientTransactionId | A unique transaction ID transmitted to the host for storage with the transaction of the ISV. | '2600679' | |
| verificationMethod | The verification method used. | 'CHIP-PIN' | ![]() |
| rrn | The Retrieval Reference Number of the transaction RRN. (Used in successful and declined receipts) |
'123456833121' | ![]() |
| bankId | The ID of card network | NET_VISA | |
| cardType | The card type. | 'VISA' | ![]() |
| 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' | ![]() |
| referenceNumber | A number with up to 6 digits indicating the transaction's STAN (System Trace Audit Number). | '833121' | ![]() |
| authorisationCode | A 6-digit number indicating the transaction's Authorisation code provided by the host. | '690882' | ![]() |
| tid | A 12 character string indicating the terminal's TID number. | ' 16016684' | ![]() |
| orderCode | The order code. | ' 9256110059000200' | ![]() |
| shortOrderCode | 10-digit integer. | '1234567890' | ![]() |
| dccAmount | The decimal amount of the transaction expressed in the currency of the customer card. Present only if the Dynamic Currency Conversion (DCC) was accepted by the customer. |
14.80 | |
| dccCurrency |
Numeric code of the customer card currency, compilant with ISO 4217. Present only if the Dynamic Currency Conversion (DCC) was accepted by the customer. |
985 | |
| exchangeRate | The decimal rate of exchange from merchant currency to the customer currency Present only if the Dynamic Currency Conversion (DCC) was accepted by the customer. |
1.2333 | |
| markup | The decimal percentage representing the margin applied by the currency conversion operator. Its value is included in the exchangeRate and the dccAmount. Present only if the Dynamic Currency Conversion (DCC) was accepted by the customer. |
3.0 | |
| transactionDate | The transaction date in ISO 8601 format. (Used in successful and declined receipts) |
'2019-09-13T12:14:19.8703452+03:00' | ![]() |
| transactionId | A unique identifier for the transaction. | 'a78e045c-49c3-4743-9071-f1e0ed71810c' | ![]() |
| aid | A string indicating the AID of the card. (Used in successful receipts) |
'A000000003101001' | ![]() |
| vatNumber | The VAT number of merchant. (if print VAT is enabled in the 'Viva.com Terminal' application settings) (Used in successful and declined receipts) |
'123412341' | ![]() |
| address | The address of merchant (if print address is enabled in the 'Viva.com Terminal' application settings) (Used in successful receipts) |
‘Main St 123, 12312 Anytown’ | ![]() |
| businessDescription | Merchant’s Business/Trade/Store name (depending on what option is selected in the 'Viva.com Terminal' application settings), (Used in successful receipts) |
'Wonka Industries' | ![]() |
| printLogoOnMerchantReceipt | A boolean indicating weather the VivaWallet logo should be printed on merchant receipt. (Used in successful receipts) |
'false' | ![]() |
| 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' | ![]() |
| 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' | ![]() |
| transactionReceiptAcquirerZone | If it is not empty then this value should be printed at the end of the customer receipt. (Used in successful receipts) |
'qwerty123456' | ![]() |
| cardholderReceiptText | If is not empty then this value should be printed at the end of the customer receipt. (Used in successful receipts) |
'qwerty123456' | ![]() |
| merchantReceiptText | If is not empty then this value should be printed at the end of the customer receipt. (Used in successful receipts) |
'qwerty123456' | ![]() |
| cardholderName | Name of the cardholder. (Used in successful receipts) |
'JOHN DOE' | ![]() |
| cardExpirationDate | Expiration date of the card (YYMM). (Used in successful receipts) |
'2212' | ![]() |
| 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' | ![]() |
| needsSignature | A boolean indicating if the receipt needs a signature section. (Used in successful receipts) |
false | ![]() |
| addQRCode | A boolean indicating if the order code should be printed as a QR. (Used in successful receipts) |
false | ![]() |
| terminalSerialNumber | The serial number of the terminal. (Used in successful receipts) |
“1234567891“ | ![]() |
| currency | The currency of the transaction. (Used in successful receipts) |
“EUR“ | ![]() |
| errorText | Text to print on the receipt stating the error description and the error ccode. (Used in declined receipts) |
“Transaction failed - Z-3“ | ![]() |
| applicationVersion | The version off the application. (Used in declined receipts) |
'v3.7.0(1956)' | ![]() |
| oldBalance | The old balance of the cardholder. (Used in successful receipts) |
'200' = 2 euro | ![]() |
| newBalance | The new balance of the cardholder. (Used in successful receipts) |
'200' = 2 euro | ![]() |
| entryMode | Indicates the method used for PAN entry to initiate a transaction. You may find all the POS Entry Modes here. | '07' | ![]() |
A Pre-auth response result for an approved transaction looks as follows:
A sale response for a succesful pre-auth transaction with DCC(Dynamic Currency Conversion) looks as follows:
&clientTransactionId=&amount=2630&rrn=429515664150&verificationMethod=CONTACTLESS - NOCVM&cardType=VISADEBIT
&accountNumber=400180******8325&referenceNumber=664150&authorisationCode=033547&tid=16418842&
orderCode=4295174722418842&transactionDate=2024-10-21T18:55:58.5603482+03:00&
transactionId=7a28d159-417f-4161-8b38-a2b44c56ed51&paymentMethod=CARD_PRESENT&shortOrderCode=4295174722&
dccAmount=29.81&dccCurrency=840&exchangeRate=1.1336
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, or if you have any queries about our products and solutions, please see our Contact & Support page to see how we can help!

