API Reference

Get Token

Token creation for accessing all apis

Get Token API provides an access token as a response. This token can be used to access other APIs as authorization parameter.

📘

Get Token Endpoint (POST Format)

Endpoint: https://vivaropay.live/api/v1.0.0-beta/getToken

Request Header

Include the following request headers:

ParameterValueRequired
Content-Typeapplication/jsonYES
Acceptapplication/jsonNO

Request Parameters

Include the following request parameters

ParameterTypeRequiredDescription
client_keyStringYESClient Key – Provided by VivaroPay after registration
secret_keyStringYESSecret Key – Provided by VivaroPay after registration

Example Code

curl --location 'https://vivaropay.live/api/v1.0.0-beta/getToken' \
--header 'Content-Type: application/json' \
--data '{
  "client_key": "YOUR CLIENT KEY",
  "secret_key": "YOUR SECRET KEY"
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://vivaropay.live/api/v1.0.0-beta/getToken',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
  "client_key": "YOUR CLIENT KEY",
  "secret_key": "YOUR SECRET KEY"
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Success Response

{
	"status": true,
	"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJUb2tlbiIsImlhdCI6MTcwNjg0OTYyNCwiZXhwIjoxNzA2ODUzMjI0LCJkYXRhIjoiZmFlMjRmZGQ1Y2VlNWJkMzc1NThmNWU3OWRmOGVlZTBjNjI4YWUwNzViZjUxZThmOGVjY2FmYzdhMTdmM2YwNTBjZmM2OGUzNzEwOWE3YWZlYTBmOGZlN2ViOThmZTUyNjc1NDBhNWMwZjI4ZGQxNDY5NWM0NGFlZjEwOTk5ZmFJNmVrOUVJR3hBbytaT09tcXNHNXZJWUtsdnJqSGxRZ2dycW1TK2FJRXc9PSJ9.OMRcJf7sLGjxGF5vbMRedyTUZeDIA4pPuLzac3SKd5U",
	"expire": 3600,
	"statusMessage": "Token generated"
}