Get sales summary
curl --request GET \
--url https://api.khaime.com/api/v1/analytics/sales \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.khaime.com/api/v1/analytics/sales"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.khaime.com/api/v1/analytics/sales', 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.khaime.com/api/v1/analytics/sales",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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.khaime.com/api/v1/analytics/sales"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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.khaime.com/api/v1/analytics/sales")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.khaime.com/api/v1/analytics/sales")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyStore Data
Get sales summary
Revenue, refunds, orders and average order value for a date range.
GET
/
api
/
v1
/
analytics
/
sales
Get sales summary
curl --request GET \
--url https://api.khaime.com/api/v1/analytics/sales \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.khaime.com/api/v1/analytics/sales"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.khaime.com/api/v1/analytics/sales', 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.khaime.com/api/v1/analytics/sales",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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.khaime.com/api/v1/analytics/sales"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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.khaime.com/api/v1/analytics/sales")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.khaime.com/api/v1/analytics/sales")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyRevenue, refunds, orders and average order value for a date range, with the previous period of the same length. Available on every plan.
Call this from your server with a
pk_ key. See Store data overview for keys, errors and how to read empty values.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
date_from | string | Yes | First day, YYYY-MM-DD. |
date_to | string | Yes | Last day, included, YYYY-MM-DD. |
Request
curl -H "X-API-Key: $KHAIME_API_KEY" \
"https://api.khaime.com/api/v1/analytics/sales?date_from=2026-10-01&date_to=2026-10-31"
Response
{
"message": "Sales summary retrieved",
"success": true,
"status": true,
"data": {
"environment": "live",
"date_from": "2026-10-01",
"date_to": "2026-10-31",
"total_revenue_usd": 1160.71,
"total_refunds_usd": 45,
"net_revenue_usd": 1115.71,
"total_orders": 14,
"avg_order_value_usd": 82.91,
"comparison": {
"revenue_change_pct": 18.4,
"orders_change_pct": 16.67,
"avg_order_value_change_pct": 1.5,
"refunds_change_pct": null,
"previous_revenue_usd": 980,
"previous_orders": 12,
"previous_avg_order_value_usd": 81.67,
"previous_refunds_usd": 0
},
"revenue_by_day": [
{
"date": "2026-10-01",
"amount": 120.5,
"orders": 2
}
]
}
}
Read it correctly
- Amounts here are in whole US dollars, converted from what was charged. The other endpoints use hundredths of the original currency.
- A
*_change_pctisnullwhen the previous period was empty.
