Introduction
This section describes the WebVola payment gateway API.
WebVola API is easy to implement in your business software. Our API is well formatted URLs, accepts cURL requests, returns JSON responses.
You can use the API in test mode, which does not affect your live data. The API key is use to authenticate the request and determines the request is valid payment or not. For test mode just use the sandbox URL and In case of live mode use the live URL from section Initiate Payment .
Supported Currencies
This section describes the currencies supported by WebVola
WebVola allows to make transaction with below currencies. Any new currency may update in future.
| Currency Name | Currency Symbol | Currency Code |
|---|---|---|
| United States Dollar | $ | USD |
| EURO | Є | EUR |
| Malagasy Ariary | Ar | MGA |
| GBP | £ | GPB |
| Canadian Dollar | C$ | CAD |
| Swiss Franc | ? | CHF |
| JPY | � | JPY |
| CNY | CN� | CNY |
| Bitcoin | BTC | BTC |
| Ethereum | ? | ETH |
| Tether | ? | USDT |
| BNB | BNB | BNB |
| Dogecoin | � | DOGE |
| USDC | USDC | USDC |
| TRON | TRX | TRX |
| Litecoin | ? | LTC |
| Bitcoin Cash | ? | BCH |
Get The Api Key
This section describes how you can get your api key.
Login to your WebVola merchant account. 'If you don\'t have any ? ('Click Here')
Next step is to find the Api Key menu in your dashboard sidebar. Click the menu.
The api keys can be found there which is Public key and Secret key. Use these keys to initiate the API request. Every time you can generate new API key by clicking Generate Api Key button. Remember do not share these keys with anyone.
Initiate Payment
This section describes the process of initaiing the payment.
To initiate the payment follow the example code and be careful with the perameters. You will need to make request with these following API end points.
Live End Point: https://www.webvola.com/payment/initiate
Test End Point: https://www.webvola.com/sandbox/payment/initiate
Test Mode Mail: test_mode@mail.com
Test Mode Verification Code: 222666
Request Method: POST
Request to the end point with the following parameters below.
| Param Name | Param Type | Description |
|---|---|---|
| public_key | string (50) | Required Your Public API key |
| identifier | string (20) | Required Identifier is basically for identify payment at your end |
| currency | string (4) | Required Currency Code, Must be in Upper Case. e.g. USD,EUR |
| amount | decimal | Required Payment amount. |
| details | string (100) | Required Details of your payment or transaction. |
| ipn_url | string | Required The url of instant payment notification. |
| success_url | string | Required Payment success redirect url. |
| cancel_url | string | Required Payment cancel redirect url. |
| site_logo | string/url | Required Your business site logo. |
| checkout_theme | string | Optional Checkout form theme dark/light. Default theme is light |
| customer_name | string (30) | Required Customer name. |
| customer_email | string (30) | Required Customer valid email. |
curl -X POST https://webvola.com/payment/initiate \
-H "Content-Type: application/json" \
-d '{
"identifier": "DFU80XZIKS",
"currency": "USD",
"amount": 100.00,
"details": "Purchase T-shirt",
"ipn_url": "http://example.com/ipn_url.php",
"cancel_url": "http://example.com/cancel_url.php",
"success_url": "http://example.com/success_url.php",
"public_key": "your_public_key",
"site_logo": "https://webvola.com/assets/images/logoIcon/logo.png",
"checkout_theme": "dark",
"customer_name": "John Doe",
"customer_email": "john@mail.com"
}'
const axios = require('axios');
const url = "https://webvola.com/payment/initiate";
// For test: const url = "https://webvola.com/sandbox/payment/initiate";
const payload = {
identifier: "DFU80XZIKS",
currency: "USD",
amount: 100.00,
details: "Purchase T-shirt",
ipn_url: "http://example.com/ipn_url.php",
cancel_url: "http://example.com/cancel_url.php",
success_url: "http://example.com/success_url.php",
public_key: "your_public_key",
site_logo: "https://webvola.com/assets/images/logoIcon/logo.png",
checkout_theme: "dark",
customer_name: "John Doe",
customer_email: "john@mail.com"
};
axios.post(url, payload)
.then(response => console.log(response.data))
.catch(error => console.error(error));
require 'uri'
require 'net/http'
url = URI("https://webvola.com/payment/initiate")
# For test: url = URI("https://webvola.com/sandbox/payment/initiate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request.body = {
identifier: "DFU80XZIKS",
currency: "USD",
amount: 100.00,
details: "Purchase T-shirt",
ipn_url: "http://example.com/ipn_url.php",
cancel_url: "http://example.com/cancel_url.php",
success_url: "http://example.com/success_url.php",
public_key: "your_public_key",
site_logo: "https://webvola.com/assets/images/logoIcon/logo.png",
checkout_theme: "dark",
customer_name: "John Doe",
customer_email: "john@mail.com"
}.to_json
response = http.request(request)
puts response.read_body
<?php
$parameters = [
'identifier' => 'DFU80XZIKS',
'currency' => 'USD',
'amount' => 100.00,
'details' => 'Purchase T-shirt',
'ipn_url' => 'http://example.com/ipn_url.php',
'cancel_url' => 'http://example.com/cancel_url.php',
'success_url' => 'http://example.com/success_url.php',
'public_key' => 'your_public_key',
'site_logo' => 'https://webvola.com/assets/images/logoIcon/logo.png',
'checkout_theme' => 'dark',
'customer_name' => 'John Doe',
'customer_email' => 'john@mail.com',
];
// live end point
$url = "https://webvola.com/payment/initiate";
// test end point
// $url = "https://webvola.com/sandbox/payment/initiate";
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $parameters);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
// $result contains the response back.
?>
import requests
url = "https://webvola.com/payment/initiate"
# For test: url = "https://webvola.com/sandbox/payment/initiate"
payload = {
"identifier": "DFU80XZIKS",
"currency": "USD",
"amount": 100.00,
"details": "Purchase T-shirt",
"ipn_url": "http://example.com/ipn_url.php",
"cancel_url": "http://example.com/cancel_url.php",
"success_url": "http://example.com/success_url.php",
"public_key": "your_public_key",
"site_logo": "https://webvola.com/assets/images/logoIcon/logo.png",
"checkout_theme": "dark",
"customer_name": "John Doe",
"customer_email": "john@mail.com"
}
response = requests.post(url, data=payload)
print(response.json())
/* Requires libcurl */
#include <curl/curl.h>
int main() {
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://webvola.com/payment/initiate");
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "identifier=DFU80XZIKS¤cy=USD&amount=100.00&details=Purchase+T-shirt&ipn_url=http://example.com/ipn_url.php&cancel_url=http://example.com/cancel_url.php&success_url=http://example.com/success_url.php&public_key=your_public_key&site_logo=https://webvola.com/assets/images/logoIcon/logo.png&checkout_theme=dark&customer_name=John+Doe&customer_email=john@mail.com");
CURLcode res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
return 0;
}
using System.Net.Http;
using System.Collections.Generic;
var client = new HttpClient();
var values = new Dictionary<string, string> {
{"identifier", "DFU80XZIKS"},
{"currency", "USD"},
{"amount", "100.00"},
{"details", "Purchase T-shirt"},
{"ipn_url", "http://example.com/ipn_url.php"},
{"cancel_url", "http://example.com/cancel_url.php"},
{"success_url", "http://example.com/success_url.php"},
{"public_key", "your_public_key"},
{"site_logo", "https://webvola.com/assets/images/logoIcon/logo.png"},
{"checkout_theme", "dark"},
{"customer_name", "John Doe"},
{"customer_email", "john@mail.com"}
};
var content = new FormUrlEncodedContent(values);
var response = await client.PostAsync("https://webvola.com/payment/initiate", content);
var responseString = await response.Content.ReadAsStringAsync();
// Use cpr (https://github.com/libcpr/cpr)
#include <cpr/cpr.h>
int main() {
auto r = cpr::Post(cpr::Url{"https://webvola.com/payment/initiate"},
cpr::Payload{
{"identifier", "DFU80XZIKS"},
{"currency", "USD"},
{"amount", "100.00"},
{"details", "Purchase T-shirt"},
{"ipn_url", "http://example.com/ipn_url.php"},
{"cancel_url", "http://example.com/cancel_url.php"},
{"success_url", "http://example.com/success_url.php"},
{"public_key", "your_public_key"},
{"site_logo", "https://webvola.com/assets/images/logoIcon/logo.png"},
{"checkout_theme", "dark"},
{"customer_name", "John Doe"},
{"customer_email", "john@mail.com"}
});
std::cout << r.text << std::endl;
}
package main
import (
"net/http"
"net/url"
"strings"
"io/ioutil"
"fmt"
)
func main() {
data := url.Values{
"identifier": {"DFU80XZIKS"},
"currency": {"USD"},
"amount": {"100.00"},
"details": {"Purchase T-shirt"},
"ipn_url": {"http://example.com/ipn_url.php"},
"cancel_url": {"http://example.com/cancel_url.php"},
"success_url": {"http://example.com/success_url.php"},
"public_key": {"your_public_key"},
"site_logo": {"https://webvola.com/assets/images/logoIcon/logo.png"},
"checkout_theme": {"dark"},
"customer_name": {"John Doe"},
"customer_email": {"john@mail.com"},
}
resp, _ := http.Post(
"https://webvola.com/payment/initiate",
"application/x-www-form-urlencoded",
strings.NewReader(data.Encode()))
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
POST /payment/initiate HTTP/1.1
Host: webvola.com
Content-Type: application/x-www-form-urlencoded
identifier=DFU80XZIKS¤cy=USD&amount=100.00&details=Purchase+T-shirt&ipn_url=http://example.com/ipn_url.php&cancel_url=http://example.com/cancel_url.php&success_url=http://example.com/success_url.php&public_key=your_public_key&site_logo=https://webvola.com/assets/images/logoIcon/logo.png&checkout_theme=dark&customer_name=John+Doe&customer_email=john@mail.com
import java.net.*;
import java.io.*;
public class Main {
public static void main(String[] args) throws Exception {
URL url = new URL("https://webvola.com/payment/initiate");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("POST");
con.setDoOutput(true);
String data = "identifier=DFU80XZIKS¤cy=USD&amount=100.00&details=Purchase+T-shirt&ipn_url=http://example.com/ipn_url.php&cancel_url=http://example.com/cancel_url.php&success_url=http://example.com/success_url.php&public_key=your_public_key&site_logo=https://webvola.com/assets/images/logoIcon/logo.png&checkout_theme=dark&customer_name=John+Doe&customer_email=john@mail.com";
OutputStream os = con.getOutputStream();
os.write(data.getBytes());
os.flush();
os.close();
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String line;
while ((line = in.readLine()) != null) {
System.out.println(line);
}
in.close();
}
}
fetch("https://webvola.com/payment/initiate", {
method: "POST",
headers: {"Content-Type": "application/x-www-form-urlencoded"},
body: "identifier=DFU80XZIKS¤cy=USD&amount=100.00&details=Purchase+T-shirt&ipn_url=http://example.com/ipn_url.php&cancel_url=http://example.com/cancel_url.php&success_url=http://example.com/success_url.php&public_key=your_public_key&site_logo=https://webvola.com/assets/images/logoIcon/logo.png&checkout_theme=dark&customer_name=John+Doe&customer_email=john@mail.com"
})
.then(response => response.json())
.then(data => console.log(data));
{
"identifier": "DFU80XZIKS",
"currency": "USD",
"amount": 100.00,
"details": "Purchase T-shirt",
"ipn_url": "http://example.com/ipn_url.php",
"cancel_url": "http://example.com/cancel_url.php",
"success_url": "http://example.com/success_url.php",
"public_key": "your_public_key",
"site_logo": "https://webvola.com/assets/images/logoIcon/logo.png",
"checkout_theme": "dark",
"customer_name": "John Doe",
"customer_email": "john@mail.com"
}
// Uses OkHttp
import okhttp3.*
val client = OkHttpClient()
val body = FormBody.Builder()
.add("identifier", "DFU80XZIKS")
.add("currency", "USD")
.add("amount", "100.00")
.add("details", "Purchase T-shirt")
.add("ipn_url", "http://example.com/ipn_url.php")
.add("cancel_url", "http://example.com/cancel_url.php")
.add("success_url", "http://example.com/success_url.php")
.add("public_key", "your_public_key")
.add("site_logo", "https://webvola.com/assets/images/logoIcon/logo.png")
.add("checkout_theme", "dark")
.add("customer_name", "John Doe")
.add("customer_email", "john@mail.com")
.build()
val request = Request.Builder()
.url("https://webvola.com/payment/initiate")
.post(body)
.build()
val response = client.newCall(request).execute()
println(response.body?.string())
(* Use Cohttp_lwt_unix *)
open Cohttp_lwt_unix
open Cohttp
open Lwt.Infix
let () =
let uri = Uri.of_string "https://webvola.com/payment/initiate" in
let headers = Header.init_with "Content-Type" "application/x-www-form-urlencoded" in
let body = "identifier=DFU80XZIKS¤cy=USD&amount=100.00&details=Purchase+T-shirt&ipn_url=http://example.com/ipn_url.php&cancel_url=http://example.com/cancel_url.php&success_url=http://example.com/success_url.php&public_key=your_public_key&site_logo=https://webvola.com/assets/images/logoIcon/logo.png&checkout_theme=dark&customer_name=John+Doe&customer_email=john@mail.com" in
let _ =
Client.post ~headers ~body:(Cohttp_lwt.Body.of_string body) uri
>>= fun (resp, body) ->
Cohttp_lwt.Body.to_string body >|= fun body -> print_endline body
in ()
// Uses NSURLSession
NSURL *url = [NSURL URLWithString:@"https://webvola.com/payment/initiate"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
NSString *body = @"identifier=DFU80XZIKS¤cy=USD&amount=100.00&details=Purchase+T-shirt&ipn_url=http://example.com/ipn_url.php&cancel_url=http://example.com/cancel_url.php&success_url=http://example.com/success_url.php&public_key=your_public_key&site_logo=https://webvola.com/assets/images/logoIcon/logo.png&checkout_theme=dark&customer_name=John+Doe&customer_email=john@mail.com";
[request setHTTPBody:[body dataUsingEncoding:NSUTF8StringEncoding]];
NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
NSLog(@"%@", [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]);
}];
[task resume];
$url = "https://webvola.com/payment/initiate"
$body = @{
identifier = "DFU80XZIKS"
currency = "USD"
amount = 100.00
details = "Purchase T-shirt"
ipn_url = "http://example.com/ipn_url.php"
cancel_url = "http://example.com/cancel_url.php"
success_url = "http://example.com/success_url.php"
public_key = "your_public_key"
site_logo = "https://webvola.com/assets/images/logoIcon/logo.png"
checkout_theme = "dark"
customer_name = "John Doe"
customer_email = "john@mail.com"
}
Invoke-RestMethod -Uri $url -Method Post -Body $body
library(httr)
url <- "https://webvola.com/payment/initiate"
body <- list(
identifier = "DFU80XZIKS",
currency = "USD",
amount = 100.00,
details = "Purchase T-shirt",
ipn_url = "http://example.com/ipn_url.php",
cancel_url = "http://example.com/cancel_url.php",
success_url = "http://example.com/success_url.php",
public_key = "your_public_key",
site_logo = "https://webvola.com/assets/images/logoIcon/logo.png",
checkout_theme = "dark",
customer_name = "John Doe",
customer_email = "john@mail.com"
)
response <- POST(url, body = body, encode = "form")
content(response, "text")
import Foundation
let url = URL(string: "https://webvola.com/payment/initiate")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
let body = "identifier=DFU80XZIKS¤cy=USD&amount=100.00&details=Purchase+T-shirt&ipn_url=http://example.com/ipn_url.php&cancel_url=http://example.com/cancel_url.php&success_url=http://example.com/success_url.php&public_key=your_public_key&site_logo=https://webvola.com/assets/images/logoIcon/logo.png&checkout_theme=dark&customer_name=John+Doe&customer_email=john@mail.com"
request.httpBody = body.data(using: .utf8)
let task = URLSession.shared.dataTask(with: request) { data, _, _ in
if let data = data { print(String(data: data, encoding: .utf8)!) }
}
task.resume()
(require '[clj-http.client :as client])
(client/post "https://webvola.com/payment/initiate"
{:form-params {:identifier "DFU80XZIKS"
:currency "USD"
:amount 100.00
:details "Purchase T-shirt"
:ipn_url "http://example.com/ipn_url.php"
:cancel_url "http://example.com/cancel_url.php"
:success_url "http://example.com/success_url.php"
:public_key "your_public_key"
:site_logo "https://webvola.com/assets/images/logoIcon/logo.png"
:checkout_theme "dark"
:customer_name "John Doe"
:customer_email "john@mail.com"}})
//Error Response.
{
"error": "true",
"message": "Invalid api key"
}
//Success Response.
{
"success": "ok",
"message": "Payment Initiated. Redirect to url.",
"url":"http://example.com/initiate/payment/checkout?payment_id=eJSAASDxdrt4DASDASVNASJA7893232432cvmdsamnvASF"
}
Validate The Payment and IPN
This section describes the process to get your instant payment notification.
To initiate the payment follow the example code and be careful with the perameters. You will need to make request with these following API end points.
End Point: Your business application ipn url.
Request Method: POST
You will get following parameters below.
| Param Name | Description |
|---|---|
| status | Payment success status. |
| identifier | Identifier is basically for identify payment at your end. |
| signature | A hash signature to verify your payment at your end. |
| data | Data contains some basic information with charges, amount, currency, payment transaction id etc. |
<?php
$status = $_POST['status'];
$signature = $_POST['signature'];
$identifier = $_POST['identifier'];
$data = $_POST['data'];
$customKey = $data['amount'].$identifier;
$secret = 'YOUR_SECRET_KEY';
$mySignature = strtoupper(hash_hmac('sha256', $customKey , $secret));
$myIdentifier = 'YOUR_GIVEN_IDENTIFIER';
if($status == "success" && $signature == $mySignature && $identifier == $myIdentifier){
// your operation logic
}
?>
import hashlib
import hmac
status = request.form['status']
signature = request.form['signature']
identifier = request.form['identifier']
data = request.form['data'] # Should be a dict
custom_key = str(data['amount']) + identifier
secret = b'YOUR_SECRET_KEY'
my_signature = hmac.new(secret, custom_key.encode(), hashlib.sha256).hexdigest().upper()
my_identifier = 'YOUR_GIVEN_IDENTIFIER'
if status == "success" and signature == my_signature and identifier == my_identifier:
# your operation logic
pass
const crypto = require('crypto');
const status = req.body.status;
const signature = req.body.signature;
const identifier = req.body.identifier;
const data = req.body.data; // {amount: ...}
const customKey = data.amount + identifier;
const secret = 'YOUR_SECRET_KEY';
const mySignature = crypto.createHmac('sha256', secret).update(customKey).digest('hex').toUpperCase();
const myIdentifier = 'YOUR_GIVEN_IDENTIFIER';
if (status === "success" && signature === mySignature && identifier === myIdentifier) {
// your operation logic
}
# For local manual test, to generate HMAC:
custom_key="100.00YOUR_GIVEN_IDENTIFIER"
secret="YOUR_SECRET_KEY"
signature=$(echo -n $custom_key | openssl dgst -sha256 -hmac $secret | sed 's/^.* //; s/[a-z]/\U&/g')
echo $signature
require 'openssl'
status = params['status']
signature = params['signature']
identifier = params['identifier']
data = params['data']
custom_key = "#{data['amount']}#{identifier}"
secret = 'YOUR_SECRET_KEY'
my_signature = OpenSSL::HMAC.hexdigest('sha256', secret, custom_key).upcase
my_identifier = 'YOUR_GIVEN_IDENTIFIER'
if status == "success" && signature == my_signature && identifier == my_identifier
# your operation logic
end
#include <openssl/hmac.h>
#include <string.h>
const char *status = getenv("STATUS");
const char *signature = getenv("SIGNATURE");
const char *identifier = getenv("IDENTIFIER");
const char *amount = getenv("AMOUNT"); // from data
char customKey[256];
sprintf(customKey, "%s%s", amount, identifier);
const char *secret = "YOUR_SECRET_KEY";
unsigned char* result;
unsigned int len = 32;
result = HMAC(EVP_sha256(), secret, strlen(secret), (unsigned char*)customKey, strlen(customKey), NULL, NULL);
// Convert result to hex uppercase and compare with received signature.
using System.Security.Cryptography;
using System.Text;
string status = Request.Form["status"];
string signature = Request.Form["signature"];
string identifier = Request.Form["identifier"];
string amount = Request.Form["amount"]; // from data
string customKey = amount + identifier;
string secret = "YOUR_SECRET_KEY";
using (var hmac = new HMACSHA256(Encoding.UTF8.GetBytes(secret)))
{
var hash = hmac.ComputeHash(Encoding.UTF8.GetBytes(customKey));
var mySignature = BitConverter.ToString(hash).Replace("-", "").ToUpper();
if (status == "success" && signature == mySignature && identifier == "YOUR_GIVEN_IDENTIFIER") {
// your operation logic
}
}
// Requires OpenSSL
#include <openssl/hmac.h>
#include <string>
// Build customKey and secret as above, use HMAC like in C.
(require '[clojure.data.codec.base64 :as b64])
(import '[javax.crypto Mac]
'[javax.crypto.spec SecretKeySpec])
(defn hmac-sha256 [secret data]
(let [mac (doto (Mac/getInstance "HmacSHA256")
(.init (SecretKeySpec. (.getBytes secret) "HmacSHA256")))]
(-> (.doFinal mac (.getBytes data))
(map #(format "%02X" (bit-and % 0xff)))
(apply str))))
; compare status, signature, etc.
import (
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
)
status := r.FormValue("status")
signature := r.FormValue("signature")
identifier := r.FormValue("identifier")
amount := r.FormValue("amount") // from data
customKey := amount + identifier
secret := []byte("YOUR_SECRET_KEY")
mac := hmac.New(sha256.New, secret)
mac.Write([]byte(customKey))
mySignature := strings.ToUpper(hex.EncodeToString(mac.Sum(nil)))
if status == "success" && signature == mySignature && identifier == "YOUR_GIVEN_IDENTIFIER" {
// your operation logic
}
POST /ipn HTTP/1.1
Host: yourserver.com
Content-Type: application/x-www-form-urlencoded
status=success&signature=GENERATED_SIGNATURE&identifier=YOUR_GIVEN_IDENTIFIER&data[amount]=100.00
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.util.Formatter;
String status = request.getParameter("status");
String signature = request.getParameter("signature");
String identifier = request.getParameter("identifier");
String amount = request.getParameter("amount");
String customKey = amount + identifier;
String secret = "YOUR_SECRET_KEY";
SecretKeySpec keySpec = new SecretKeySpec(secret.getBytes(), "HmacSHA256");
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(keySpec);
byte[] hash = mac.doFinal(customKey.getBytes());
StringBuilder sb = new StringBuilder();
for (byte b : hash) sb.append(String.format("%02X", b));
String mySignature = sb.toString();
if (status.equals("success") && signature.equals(mySignature) && identifier.equals("YOUR_GIVEN_IDENTIFIER")) {
// your operation logic
}
// See Node.js above; in browser JS, use SubtleCrypto API for HMAC if needed
{
"status": "success",
"signature": "GENERATED_SIGNATURE",
"identifier": "YOUR_GIVEN_IDENTIFIER",
"data": {
"amount": "100.00"
}
}
import javax.crypto.Mac
import javax.crypto.spec.SecretKeySpec
val status = request.getParameter("status")
val signature = request.getParameter("signature")
val identifier = request.getParameter("identifier")
val amount = request.getParameter("amount")
val customKey = "$amount$identifier"
val secret = "YOUR_SECRET_KEY"
val hmacSha256 = Mac.getInstance("HmacSHA256")
val keySpec = SecretKeySpec(secret.toByteArray(), "HmacSHA256")
hmacSha256.init(keySpec)
val hash = hmacSha256.doFinal(customKey.toByteArray())
val mySignature = hash.joinToString("") { "%02X".format(it) }
if (status == "success" && signature == mySignature && identifier == "YOUR_GIVEN_IDENTIFIER") {
// your operation logic
}
(* See digestif library for HMAC SHA256 in OCaml *)
// Use CCHmac for HMAC SHA256
$status = $Request.Form.status
$signature = $Request.Form.signature
$identifier = $Request.Form.identifier
$amount = $Request.Form.amount # from data
$customKey = $amount + $identifier
$secret = 'YOUR_SECRET_KEY'
$hmacsha256 = New-Object System.Security.Cryptography.HMACSHA256
$hmacsha256.Key = [Text.Encoding]::UTF8.GetBytes($secret)
$hashBytes = $hmacsha256.ComputeHash([Text.Encoding]::UTF8.GetBytes($customKey))
$mySignature = [BitConverter]::ToString($hashBytes) -replace "-", "" -replace "[a-z]", {$args[0].ToUpper()}
if ($status -eq "success" -and $signature -eq $mySignature -and $identifier -eq "YOUR_GIVEN_IDENTIFIER") {
# your operation logic
}
library(openssl)
status <- Sys.getenv("STATUS")
signature <- Sys.getenv("SIGNATURE")
identifier <- Sys.getenv("IDENTIFIER")
amount <- Sys.getenv("AMOUNT") # from data
custom_key <- paste0(amount, identifier)
secret <- "YOUR_SECRET_KEY"
my_signature <- toupper(hmac_sha256(custom_key, secret))
if (status == "success" && signature == my_signature && identifier == "YOUR_GIVEN_IDENTIFIER") {
# your operation logic
}
import CryptoKit
let status = ... // get from POST
let signature = ... // get from POST
let identifier = ... // get from POST
let amount = ... // get from POST data
let customKey = "\(amount)\(identifier)"
let key = SymmetricKey(data: "YOUR_SECRET_KEY".data(using: .utf8)!)
let hmac = HMAC<SHA256>.authenticationCode(for: customKey.data(using: .utf8)!, using: key)
let mySignature = hmac.map { String(format: "%02X", $0) }.joined()
if status == "success" && signature == mySignature && identifier == "YOUR_GIVEN_IDENTIFIER" {
// your operation logic
}
Universal Payment v1
Universal Payment is available only to enabled merchants. Issue or revoke a Universal Payment credential in the existing merchant dashboard under Payments. Send it from a server using Authorization: Bearer <credential> over HTTPS. Sandbox credentials access a separate namespace of records. Sandbox supports isolated test funding. It never debits live wallets or sends live webhooks.
Amounts are integer minor units of the selected currency. The API returns the currency and its scale. Send an Idempotency-Key of 16–128 letters, numbers, dots, dashes or underscores on every write. Repeating the same operation, target and JSON body returns the original result. Reusing a key for different data returns idempotency_conflict.
POST /api/v1/universal-payments
Content-Type: application/json
Authorization: Bearer <merchant credential>
Idempotency-Key: order-1241-create
{
"reference": "order-1241",
"description": "Refrigerator purchase",
"currency": "MGA",
"unit_amount": 800000,
"methods": ["wallet"],
"capabilities": ["remote", "progressive", "collaborative"],
"minimum": 10000
}
Successful requests return {"data":{...},"request_id":"..."}. Creation returns data.payment and data.checkout.url. Redirect the buyer to that URL and keep the credential on your server. Common error codes include unauthorized, payments_unavailable, validation_failed, purchase_not_found, purchase_immutable, reference_conflict, and funding_unavailable.
| Method and path relative to /api/v1/universal-payments | Purpose |
|---|---|
| GET /, POST /, POST /drafts | List, create open purchase, or create draft. List filters are reference and status. |
| GET /{id}, PATCH /{id}, POST /{id}/open | Detail, update draft terms, or publish a draft. Open purchases have immutable prices and options. |
| GET /{id}/progress, /{id}/attempts, /{id}/settlement | Check funding, participant attempts, or the settlement reference. |
| POST /{id}/links, DELETE /{id}/links/{linkId} | Create or revoke a link. Supply purpose (checkout, remote or contribution), optional verified payer account ID, and optional expiry. |
| POST /{id}/cancel, POST /{id}/attempts/{attemptId}/refunds | Cancel open funding or refund a confirmed wallet contribution in original currency. Supply an integer amount for refunds. Pending refund requires review and is not a successful refund. |
| GET /offers, POST /offers, POST /offers/{id}/publish, POST /offers/{id}/unpublish | Manage social commerce offers. Add title, optional image_url, quantity, delivery_amount, and optional reusable. A reusable offer issues a distinct purchase per order. |
remote allows an alternate payer to pay the full remainder. collaborative allows multiple participants and partial amounts. progressive allows partial funding over time, with optional minimum and expires_at (UTC). social enables an offer or branded checkout. multi_source permits staged source allocations. Production supports no new external rail. Sandbox checkout accepts sandbox_wallet, sandbox_card and sandbox_mobile and permits guest browsers. An operator can enable stripe_test in staging using eligible existing StripeV3 test settings.
Purchases progress from draft or open to partially funded, fully funded and settled. Eligible purchases may also expire or be cancelled. A browser redirect or a partially funded status is not confirmation of settlement. Incomplete purchases retain confirmed funding until each eligible original contribution is refunded.
For an operator-approved HTTPS destination, WebVola delivers purchase.settled with X-WebVola-Event, X-WebVola-Time and X-WebVola-Signature. Verify sha256= plus the hex HMAC-SHA256 of timestamp.event_id.raw_body using your signing secret. Verify timestamps, compare signatures in constant time and deduplicate by event ID before processing. Retry deliveries reuse the event ID. A 2xx response acknowledges receipt.
Test funding and product images
In the sandbox use two or more distinct test methods with multi_source enabled. Choose pending, success or failure in checkout. A pending simulation can be resolved on its browser-bound status page. Synthetic refunds use the original attempt. A Stripe test refund remains pending until reconciled with the processor.
Send a JPEG or PNG as image via multipart POST /api/v1/universal-payments/images. It returns the upload ID. Attach up to six owned IDs as images on a social purchase or offer. Use PATCH /offers/{id}/images to replace the offer image list. Previously issued purchases keep their own snapshot. The optional HTTPS image_url remains supported.
A merchant can opt into notifications for a targeted remote or contribution link with notify_recipient and the registered payer_id. Delivery depends on the existing configured templates and channels. Guest payers do not receive WebVola account notifications.
Smart Routing API v1
Use an environment-scoped Universal Payment bearer credential over HTTPS. Smart Routing requires Universal Payment and Smart Routing merchant eligibility, global recommendation availability, and a merchant opt-in. Send an Idempotency-Key on every write. Responses contain data and request_id or error.code and request_id.
| Method | Path under /api/v1/smart-routing | Operation |
|---|---|---|
| POST | /recommendations | Rank eligible methods and record a decision |
| POST | /gateways | Evaluate eligible methods for the same context |
| POST | /costs | Compare available costs for the same context |
| GET | /decisions/{id} | Retrieve a merchant-owned decision |
| GET | /decisions/{id}/alternatives | Retrieve alternatives from a decision |
| GET / PUT | /preferences | Read or replace environment-specific preferences |
| GET | /performance | Read merchant-specific gateway telemetry |
| POST | /purchases/{id}/attempts/{record}/failover | Find alternatives after a verified sandbox failure |
POST /api/v1/smart-routing/recommendations
Authorization: Bearer <sandbox-credential>
Content-Type: application/json
Idempotency-Key: order-1241-route-v1
{"amount":1000,"currency":"MGA","country":"MG","strategy":"local","methods":["sandbox_mobile","sandbox_card"]}
This abbreviated example omits scoring and metadata fields. A successful response contains a decision ID, currency and amount in minor units, strategy, objective, policy revision, recommendation, alternatives, score components, cost breakdown, and confirmation requirement. A valid request can return a null recommendation when no method meets the policy. A null cost or confirmation estimate indicates unavailable evidence.
{
"data": {
"id": "a19b61ab-bc44-4f57-9b02-99fbd8b73e3c",
"currency": "MGA", "amount": 1000, "strategy": "local",
"recommendation": {
"method": "sandbox_mobile", "health": "unknown",
"cost": {"status":"simulated","customer_total":1000,"merchant_net":1000},
"confirmation_seconds": null,
"reason": "Locally relevant for the supplied country and currency."
},
"alternatives": [{"method":"sandbox_card"}],
"confirmation_required": true
},
"request_id": "0388c857-7326-4a6a-8e22-1e239ac33505"
}
Strategies are lowest_cost, fastest, reliability, preferred, local, balanced, and custom. Send enabled, objective (customer_cost or merchant_net), optional strategy, and ordered priority and excluded arrays to the preferences endpoint. Policy and adapter restrictions apply before merchant preferences.
Pass an optional routing_strategy or routing_decision_id to Universal Payment create, draft, draft update, or offer creation. A referenced decision must be yours and match the currency, amount and accepted methods. Checkout evaluates current conditions for the actual contribution amount. A decision never authorizes payment or future retries.
For sandbox failover, submit an existing failed attempt and its purchase ID. Pending, unmatched, or otherwise unverified outcomes return routing_outcome_unverified. A recommendation preserves the purchase and confirmed contributions. Ask the customer to confirm the alternative through the existing checkout. Sandbox simulation supports paid, failed and pending outcomes with no live debit.
Common errors include unauthorized, payments_unavailable, routing_schema_unavailable, routing_unavailable, routing_preferences_unavailable, routing_decision_not_found, routing_decision_mismatch, failover_unavailable, currency_unavailable, validation_failed, idempotency_conflict and rate_limited.
Payment Recovery and Financial Events APIs
Download the OpenAPI specification
Issue a product credential in the merchant dashboard. Send it as a Bearer token over HTTPS. Read credentials permit GET requests. Write credentials also permit the product’s POST or PATCH operations. The credential selects the environment. Each API allows 120 requests per minute per merchant and applies an IP limit.
Payment Recovery
Recovery uses Universal Payment purchase IDs. Checkout requires a previously bound WebVola buyer and an eligible payment method. Amounts are integer minor units. Each recovery POST requires an Idempotency-Key of 16–128 ASCII letters, digits, periods, underscores or hyphens. Reuse a key only when retrying the same operation on the same purchase.
| Method | Path under /api/v1/payment-recovery | Purpose |
|---|---|---|
| GET | / | List recovery sessions |
| GET | /analytics | Count sessions by synchronized status |
| GET | /webhook-deliveries | List delivery status and attempts |
| GET | /purchases/{id}/eligibility | Check the original purchase |
| GET, POST | /purchases/{id}/session | Read recovery state or create a session |
| GET | /purchases/{id}/options | Inspect eligible recovery options |
| GET | /purchases/{id}/reconciliation | Check whether reconciliation is required |
| POST | /purchases/{id}/links | Issue a link for the bound buyer |
| POST | /purchases/{id}/cancel | Cancel recovery and revoke its link |
curl -H "Authorization: Bearer $RECOVERY_SANDBOX_TOKEN" \
-H "Idempotency-Key: sandbox-demo-link-001" -X POST \
"$WEBVOLA/api/v1/payment-recovery/purchases/$PURCHASE_ID/links"
A successful link response includes a data.checkout_url. Share it privately with the bound buyer. A new link revokes the previous one. Unresolved provider settlement blocks recovery checkout. A cancelled recovery leaves the original payment and its funding records intact.
Financial Events
Ask the event organizer to share the event totals with your merchant account through Linked applications. Use the association UUID returned by the list endpoint. Financial Events access is available for live Traditional Event associations. Offline and masked voucher status require an additional organizer grant. Metadata edits require explicit organizer permission, a write credential and an idempotency key. Monetary values are decimal strings expressed in the event currency.
| Method | Path under /api/v1/financial-events | Purpose |
|---|---|---|
| GET | /invitation-templates | List configured Traditional invitation template labels |
| GET | /types | List supported public Traditional Event types |
| GET | / | List authorized associations |
| GET | /{id} | Read authorized event details |
| GET | /{id}/summary | Read confirmed contribution totals and target |
| GET | /{id}/offline-status | Read offline contribution receipt counts and the active reference |
| GET | /{id}/voucher-status | Read ceremonial voucher status and its masked reference |
| PATCH | /{id} | Update the name or description of an active linked event |
$url = getenv('WEBVOLA').'/api/v1/financial-events/'.getenv('EVENT_GRANT').'/summary';
$handle = curl_init($url);
curl_setopt_array($handle, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer '.getenv('EVENT_TOKEN')],
]);
$result = json_decode(curl_exec($handle), true, flags: JSON_THROW_ON_ERROR);
// Run on your server. Keep merchant secrets off customer devices.
const response = await fetch(process.env.WEBVOLA + '/api/v1/financial-events', {
headers: { Authorization: 'Bearer ' + process.env.EVENT_TOKEN }
});
const result = await response.json();
A response contains data or error.code and a request_id. Typical errors include 401 for credentials or scope, 404 for inaccessible records, 409 for conflicts, 429 for rate limiting and 503 for unavailable product access.
Recovery webhooks
Subscribe in the merchant recovery policy. Eligible live events use the administrator-approved Universal Payment HTTPS endpoint and signing secret. The product emits recovery.created, recovery.started, recovery.partially_funded, recovery.reconciliation_required, recovery.completed, recovery.expired and recovery.cancelled.
Check that X-WebVola-Time is recent. Compute HMAC-SHA256 over the timestamp, a period, X-WebVola-Event, another period and the exact body. Compare in constant time with the hexadecimal value in X-WebVola-Signature after its sha256= prefix. Store processed event IDs before acknowledging a delivery. Retries carry the same event ID and a fresh timestamp.
Recovery campaigns, offline commercial payments, Financial Events payment sessions and Financial Events webhooks are pending implementation.
