curl --request GET \
--url https://api.safarapi.com/api/partner/v1/metrics/commercial \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.safarapi.com/api/partner/v1/metrics/commercial"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.safarapi.com/api/partner/v1/metrics/commercial', 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.safarapi.com/api/partner/v1/metrics/commercial",
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.safarapi.com/api/partner/v1/metrics/commercial"
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.safarapi.com/api/partner/v1/metrics/commercial")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.safarapi.com/api/partner/v1/metrics/commercial")
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_bodyCommercial performance over a period
Business view of the channel over an arbitrary period, complementing the
operational /dashboard: volume, your own revenue, effective take rate,
average basket and cancellations measured in value.
Metrics are computed on bookings created within the period whose status
became firm, that is CONFIRMED, COMPLETED, CANCELLED, REFUND_PENDING
or REFUNDED. Bookings still PENDING or PAYMENT_PROCESSING are excluded,
since they may never be paid.
gross_merchandise_value is the total charged to customers and therefore
includes your surcharge. partner_revenue is what you keep, commission share
plus surcharge. Cancellation figures cover the cancelled subset of the same
bookings, valued at their original customer price, so
cancellation_rate_percent is a share of value and not a share of headcount.
The period is capped at 366 days. Read-only.
curl --request GET \
--url https://api.safarapi.com/api/partner/v1/metrics/commercial \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.safarapi.com/api/partner/v1/metrics/commercial"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.safarapi.com/api/partner/v1/metrics/commercial', 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.safarapi.com/api/partner/v1/metrics/commercial",
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.safarapi.com/api/partner/v1/metrics/commercial"
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.safarapi.com/api/partner/v1/metrics/commercial")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.safarapi.com/api/partner/v1/metrics/commercial")
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_bodyAuthorizations
API key authentication. Issued by the Safariat admin or via the partner portal. The secret is shown only once at generation.
Production sk_live_* keys must additionally sign every write request
(POST/PUT/DELETE) with the X-Timestamp and X-Signature headers.
Sandbox sk_test_* keys are exempt from request signing: X-Signature and
X-Timestamp are not required for writes in the sandbox (so the developer-portal
"Try it" playground works end to end). The Idempotency-Key header remains
required on writes in both environments.
Query Parameters
First day of the period, inclusive.
Last day of the period, inclusive.
Response
Commercial snapshot for the requested period.
Show child attributes
Show child attributes
Firm bookings created within the period.
Adults plus children across those bookings.
Total charged to customers, your surcharge included.
Show child attributes
Show child attributes
What you keep = commission share + surcharge.
Show child attributes
Show child attributes
Total reversed to Safariat over the period.
Show child attributes
Show child attributes
partner_revenue / gross_merchandise_value, as a percentage with two decimals. 0.00 on an empty period.
"1.67"
Gross merchandise value divided by the number of bookings.
Show child attributes
Show child attributes
Two decimals. 0.00 on an empty period.
"2.29"
Original customer price of the cancelled bookings.
Show child attributes
Show child attributes
Share of value, not of headcount.
"7.09"
Ordered by decreasing booking count. unspecified groups cancellations recorded
without a reason. Only the reason code is reported: any free-text note you attach
when cancelling is stripped, so the breakdown stays aggregated by cause rather than
fragmenting into one row per note.
Show child attributes
Show child attributes