Card Present Tokenization

How to use card tokenization for Card Present transactions.

Available for ISV Partners and Merchants

Overview

This document provides developers with a structured guide on how to implement card-present tokenization using Viva Payments API. The process involves securely capturing and tokenizing card details from a physical terminal, retrieving the transaction details, and processing the final charge using ISV credentials. Each step is accompanied by the necessary API calls and authentication methods to ensure a secure and efficient card-present payment experience.

Card Present Tokenization for ISV Partners

1. Send a Sale Request

Start by sending a sale request to the terminal using your Merchant POS credentials. This initializes the transaction process.

2. Retrieve Session

After sending the sale request, retrieve the session details to obtain the unique transactionId associated with the transaction.

3. Retrieve Transaction

Use Basic Authentication (MID + API Key) to fetch transaction details. The objective for this steps is to store the bank card expiration month and year to be use on a later step.

4. Create a Card Token

Using the transactionId obtained earlier, make a request to create a Card Token. The generated token (ct_..) represents the customer’s payment method token. Make sure to use the Merchant’s Smart Checkout Credentials.

Make sure to requeste the tokenization role to be enabled at your Viva.com bank account.

5. Create Charge Token (ISV)

Next, use Bearer Token authentication with ISV credentials to create a one-time charge token for processing the payment. Make the following request:

post    /nativecheckout/v2/isv/chargetokens?MerchantId=xxx

Environment URL
Production https://api.vivapayments.com/nativecheckout/v2/isv/chargetokens?MerchantId=xxx
Demo https://demo-api.vivapayments.com/nativecheckout/v2/isv/chargetokens?MerchantId=xxx
curl '[Environment URL]'
-H 'Authorization: Bearer [access token]'
-H 'Content-Type: application/json'
-d '{
	"moto": true,
	"amount": 1000,
	"token": "Card Token from the previous call",
	"holderName": "name",
	"expirationYear": 2030,
	"expirationMonth": 5,
	"currencyCode": "978"
}'

This API call returns a one-time Charge Token (ctok_..) which is required for the final transaction step.

6. Final Charge - Create Transaction

With the Charge Token obtained in the previous step, you can now complete the transaction by making a request using Bearer Token authentication with ISV credentials:

post    /nativecheckout/v2/isv/transactions?MerchantId=xxx

Environment URL
Production https://api.vivapayments.com/nativecheckout/v2/isv/transactions?merchantId=xxx
Demo https://demo-api.vivapayments.com/nativecheckout/v2/isv/transactions?merchantId=xxx
curl '[Environment URL]'
-H 'Authorization: Bearer [access token]'
-H 'Content-Type: application/json'
-d '{
  "amount": 1000,
  "isvAmount": 0,
  "preauth": false,
  "chargeToken": "Charge Token you got from the previous step",
  "installments": 1,
  "allowsRecurring": false,
  "merchantTrns": "Merchant transaction reference",
  "customerTrns": "Short description of items/services purchased to display to your customer",
  "currencyCode": 978,
  "customer": {
    "email": "johndoe@viva.com",
    "phone": "442037347770",
    "fullname": "John Doe",
    "requestLang": "en",
    "countryCode": "GB"
   }
}'

Upon successful execution of this request, the transaction is completed, and the charge is processed.

Card Present Tokenization for Merchants

Contact your Viva.com Sale representative to inquiry about the Card Present Tokenization for Merchants.

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!