Webhook Endpoints
curl --request POST \
--url https://api.viarosandbox.com/v1/webhook_endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"events": [
{}
],
"description": "<string>"
}
'import requests
url = "https://api.viarosandbox.com/v1/webhook_endpoints"
payload = {
"url": "<string>",
"events": [{}],
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', events: [{}], description: '<string>'})
};
fetch('https://api.viarosandbox.com/v1/webhook_endpoints', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.viarosandbox.com/v1/webhook_endpoints",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => '<string>',
'events' => [
[
]
],
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.viarosandbox.com/v1/webhook_endpoints"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"events\": [\n {}\n ],\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.viarosandbox.com/v1/webhook_endpoints")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"events\": [\n {}\n ],\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.viarosandbox.com/v1/webhook_endpoints")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"events\": [\n {}\n ],\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyDeveloper Platform
Webhook Endpoints
Register and manage HTTP endpoints to receive real-time webhook event notifications.
POST
/
webhook_endpoints
Webhook Endpoints
curl --request POST \
--url https://api.viarosandbox.com/v1/webhook_endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"events": [
{}
],
"description": "<string>"
}
'import requests
url = "https://api.viarosandbox.com/v1/webhook_endpoints"
payload = {
"url": "<string>",
"events": [{}],
"description": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', events: [{}], description: '<string>'})
};
fetch('https://api.viarosandbox.com/v1/webhook_endpoints', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.viarosandbox.com/v1/webhook_endpoints",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => '<string>',
'events' => [
[
]
],
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.viarosandbox.com/v1/webhook_endpoints"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"events\": [\n {}\n ],\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.viarosandbox.com/v1/webhook_endpoints")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"events\": [\n {}\n ],\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.viarosandbox.com/v1/webhook_endpoints")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"events\": [\n {}\n ],\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyYou can configure webhook endpoints via the API to be notified about events that happen in your Pursar account, such as successful mobile money charges, completed payouts, or updated customer identity sessions.
Create a Webhook Endpoint
string
required
The HTTPS URL where Pursar should deliver event payloads.
array
required
The list of event types to subscribe to (e.g.
["charge.successful", "payment_intent.succeeded", "payout.paid"]). Use ["*"] to subscribe to all events.string
An optional description of what this endpoint is used for.
Code Examples
curl -X POST https://api.viarosandbox.com/v1/webhook_endpoints \
-u sk_test_uLsofsae3tB9Izwgeuy0Mxbh4JIxUPSG: \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/api/webhooks/pursar",
"description": "Primary backend webhook listener",
"events": [
"charge.successful",
"payment_intent.succeeded",
"payout.paid"
]
}'
import requests
url = "https://api.viarosandbox.com/v1/webhook_endpoints"
auth = ("sk_test_uLsofsae3tB9Izwgeuy0Mxbh4JIxUPSG", "")
payload = {
"url": "https://example.com/api/webhooks/pursar",
"description": "Primary backend webhook listener",
"events": ["charge.successful", "payment_intent.succeeded", "payout.paid"]
}
response = requests.post(url, auth=auth, json=payload)
print(response.json())
const axios = require('axios');
async function createWebhookEndpoint() {
const response = await axios.post(
'https://api.viarosandbox.com/v1/webhook_endpoints',
{
url: 'https://example.com/api/webhooks/pursar',
description: 'Primary backend webhook listener',
events: ['charge.successful', 'payment_intent.succeeded', 'payout.paid']
},
{
auth: {
username: 'sk_test_uLsofsae3tB9Izwgeuy0Mxbh4JIxUPSG',
password: ''
}
}
);
console.log(response.data);
}
createWebhookEndpoint();
Response
The
secret field (whsec_...) is the endpoint’s unique HMAC signing secret. Store it securely on your server to verify incoming webhook signatures.{
"id": "we_1a2b3c4d5e6f",
"object": "webhook_endpoint",
"url": "https://example.com/api/webhooks/pursar",
"description": "Primary backend webhook listener",
"status": "enabled",
"secret": "whsec_7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c",
"events": [
"charge.successful",
"payment_intent.succeeded",
"payout.paid"
],
"created_at": "2026-11-06T12:00:00Z"
}
List Webhook Endpoints
GET /webhook_endpoints
Returns a list of all configured webhook endpoints.
cURL
curl -G https://api.viarosandbox.com/v1/webhook_endpoints \
-u sk_test_uLsofsae3tB9Izwgeuy0Mxbh4JIxUPSG:

