Sales Analytics
Monthly revenue trend
Powers the Revenue vs target line chart on the Overview screen and the Commission vs revenue trend chart on the Commissions screen.
Returns one data point per calendar month for the requested year, filling months with zero revenue as 0.00 so the frontend can render a continuous series without gaps.
GET
/
api
/
v1
/
analytics
/
sales
/
trend
Monthly revenue trend
curl --request GET \
--url https://api.capedigital.co.ke/commercial/api/v1/analytics/sales/trend \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.capedigital.co.ke/commercial/api/v1/analytics/sales/trend"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.capedigital.co.ke/commercial/api/v1/analytics/sales/trend', 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.capedigital.co.ke/commercial/api/v1/analytics/sales/trend",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.capedigital.co.ke/commercial/api/v1/analytics/sales/trend"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.capedigital.co.ke/commercial/api/v1/analytics/sales/trend")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.capedigital.co.ke/commercial/api/v1/analytics/sales/trend")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
[
{
"month_label": "Jan",
"month_start": "2026-01-01",
"total_contracted_revenue": "18200000.00"
},
{
"month_label": "Feb",
"month_start": "2026-02-01",
"total_contracted_revenue": "17800000.00"
},
{
"month_label": "Mar",
"month_start": "2026-03-01",
"total_contracted_revenue": "22400000.00"
},
{
"month_label": "Apr",
"month_start": "2026-04-01",
"total_contracted_revenue": "19100000.00"
},
{
"month_label": "May",
"month_start": "2026-05-01",
"total_contracted_revenue": "21400000.00"
}
]
]Authorizations
Enter your JWT token in the format: Bearer
Query Parameters
Four-digit year, e.g. 2026.
⌘I
Monthly revenue trend
curl --request GET \
--url https://api.capedigital.co.ke/commercial/api/v1/analytics/sales/trend \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.capedigital.co.ke/commercial/api/v1/analytics/sales/trend"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.capedigital.co.ke/commercial/api/v1/analytics/sales/trend', 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.capedigital.co.ke/commercial/api/v1/analytics/sales/trend",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.capedigital.co.ke/commercial/api/v1/analytics/sales/trend"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.capedigital.co.ke/commercial/api/v1/analytics/sales/trend")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.capedigital.co.ke/commercial/api/v1/analytics/sales/trend")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
[
{
"month_label": "Jan",
"month_start": "2026-01-01",
"total_contracted_revenue": "18200000.00"
},
{
"month_label": "Feb",
"month_start": "2026-02-01",
"total_contracted_revenue": "17800000.00"
},
{
"month_label": "Mar",
"month_start": "2026-03-01",
"total_contracted_revenue": "22400000.00"
},
{
"month_label": "Apr",
"month_start": "2026-04-01",
"total_contracted_revenue": "19100000.00"
},
{
"month_label": "May",
"month_start": "2026-05-01",
"total_contracted_revenue": "21400000.00"
}
]
]