Basic auth

Once you’ve created an account with Viva Wallet, you can use basic auth to use our solutions.

How to authenticate using basic auth

With basic auth, you pass your Viva Wallet credentials (Merchant ID and API Key) in each request to our APIs. You can pass your credentials as a Base64-encoded header or as parameters in an HTTP call.

When you pass your credentials in the header, you must Base64-encode them. The following is an example of an encoded HTTP basic auth header:

Authorization: Basic ZmJmMWUwOTAtNjVkZS00Yzc1LWI1ODAtZDlkOWJjNDk0YWQyOldEdi1WKw==

With a client such as cURL, you pass your encoded credentials in the header with the -H option, as the following example shows:

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 'Authorization: Basic [Base64-encoded Merchant ID and API key]'
  -H 'Content-Type: application/json'
  -d '{
  "tags": [
    "Sample string 1",
    "Sample string 2",
    "Sample string 3"
  ],
  "email": "customer@domain.com",
  "phone": "2117604000",
  "fullName": "Customer name",
  "paymentTimeOut": 86400,
  "requestLang": "en-GB",
  "maxInstallments": 12,
  "allowRecurring": true,
  "isPreAuth": true,
  "amount": 100,
  "merchantTrns": "Your reference",
  "customerTrns": "Short description of items/services purchased to display to your customer"
}'

Running the above from the command line should result in a response containing an order code generated by the Create payment order call from our Payment API.

Basic auth and Postman

If using Postman, under Authorization you select Basic Auth and enter the following:

Access Credentials

Further information

Check out the related tutorials below for more details about basic authentication:

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.