Use Basic Auth authentication

Step 1: Find your Viva Wallet access credentials

To authenticate with basic auth you need firstly to find your Viva Wallet access credentials (Merchant ID and API Key) in the Viva Wallet banking app. To do this:

  1. Log in to Viva Wallet, demo or live , and select the required account.

  2. Go to Settings > API Access in the left navigation.

  3. You’ll find your Merchant ID and API Key in the Access Credentials section at the top of the page:

    Access Credentials

  4. Copy and paste your Merchant ID and API Key to a temporary secure location.

Step 2: Use your access credentials in an API call

In the examples below, there are two ways in which the Viva Wallet access credentials are used:

Directly in Postman

Authorization tab in Postman with Basic Auth selected from Type dropdown:

Access Credentials

Request example

post    /api/orders

Run in Postman

Environment URL
Production https://www.vivapayments.com/api/orders
Demo https://demo.vivapayments.com/api/orders
curl '[Environment URL]'
-H 'Content-Type: application/json'
-H 'Authorization: Basic [Base64-encoded Merchant ID and API key]'
-d '{
  "amount": 100,
  "email": "customer@domain.com",
  "fullName": "Customer name",
  "customerTrns": "Short description of items/services purchased to display to your customer",
  "requestLang": "en-GB"
}'

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => '[Environment URL]',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
  "amount": 100,
  "email": "customer@domain.com",
  "fullName": "Customer name",
  "customerTrns": "Short description of items/services purchased to display to your customer",
  "requestLang": "en-GB"
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Basic [Base64-encoded Merchant ID and API key]'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

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.