Calculate shipping rates
Returns quotes from every courier serving the route, sorted by price then
courier tier. The platform commission is already included in
total_price. Each quote_id is valid for 2 minutes and is required to
create a shipment.
Precise pricing by location. For each endpoint you may pass zone (a named
pricing area), exact lat/lng coordinates, or a free-form place string —
coordinates take precedence, then a place name is resolved to coordinates
automatically. When coordinates are supplied, each courier’s price is matched to
the bounded service area the point falls in (more accurate than a city name alone).
city is always required as the coarse filter.
Door-delivery distance charge. When delivery_method is last_mile (door
delivery) and the destination lies beyond a courier’s service area, the quote may
include a distance_overage — a courier-set surcharge for distance past the area,
shown in breakdown.distance_overage. Pickup-station deliveries are never charged
this surcharge.
curl --request POST \
--url https://api.tybritelabs.com/logistics/v1/rates/calculate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"origin": {
"city": "<string>",
"zone": "<string>",
"place": "<string>",
"lat": 123,
"lng": 123
},
"destination": {
"city": "<string>",
"zone": "<string>",
"place": "<string>",
"lat": 123,
"lng": 123
},
"weight_kg": 5,
"declared_value": 123,
"delivery_method": "last_mile",
"special_flags": [
"fragile"
]
}
'import requests
url = "https://api.tybritelabs.com/logistics/v1/rates/calculate"
payload = {
"origin": {
"city": "<string>",
"zone": "<string>",
"place": "<string>",
"lat": 123,
"lng": 123
},
"destination": {
"city": "<string>",
"zone": "<string>",
"place": "<string>",
"lat": 123,
"lng": 123
},
"weight_kg": 5,
"declared_value": 123,
"delivery_method": "last_mile",
"special_flags": ["fragile"]
}
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({
origin: {city: '<string>', zone: '<string>', place: '<string>', lat: 123, lng: 123},
destination: {city: '<string>', zone: '<string>', place: '<string>', lat: 123, lng: 123},
weight_kg: 5,
declared_value: 123,
delivery_method: 'last_mile',
special_flags: ['fragile']
})
};
fetch('https://api.tybritelabs.com/logistics/v1/rates/calculate', 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.tybritelabs.com/logistics/v1/rates/calculate",
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([
'origin' => [
'city' => '<string>',
'zone' => '<string>',
'place' => '<string>',
'lat' => 123,
'lng' => 123
],
'destination' => [
'city' => '<string>',
'zone' => '<string>',
'place' => '<string>',
'lat' => 123,
'lng' => 123
],
'weight_kg' => 5,
'declared_value' => 123,
'delivery_method' => 'last_mile',
'special_flags' => [
'fragile'
]
]),
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.tybritelabs.com/logistics/v1/rates/calculate"
payload := strings.NewReader("{\n \"origin\": {\n \"city\": \"<string>\",\n \"zone\": \"<string>\",\n \"place\": \"<string>\",\n \"lat\": 123,\n \"lng\": 123\n },\n \"destination\": {\n \"city\": \"<string>\",\n \"zone\": \"<string>\",\n \"place\": \"<string>\",\n \"lat\": 123,\n \"lng\": 123\n },\n \"weight_kg\": 5,\n \"declared_value\": 123,\n \"delivery_method\": \"last_mile\",\n \"special_flags\": [\n \"fragile\"\n ]\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.tybritelabs.com/logistics/v1/rates/calculate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"origin\": {\n \"city\": \"<string>\",\n \"zone\": \"<string>\",\n \"place\": \"<string>\",\n \"lat\": 123,\n \"lng\": 123\n },\n \"destination\": {\n \"city\": \"<string>\",\n \"zone\": \"<string>\",\n \"place\": \"<string>\",\n \"lat\": 123,\n \"lng\": 123\n },\n \"weight_kg\": 5,\n \"declared_value\": 123,\n \"delivery_method\": \"last_mile\",\n \"special_flags\": [\n \"fragile\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tybritelabs.com/logistics/v1/rates/calculate")
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 \"origin\": {\n \"city\": \"<string>\",\n \"zone\": \"<string>\",\n \"place\": \"<string>\",\n \"lat\": 123,\n \"lng\": 123\n },\n \"destination\": {\n \"city\": \"<string>\",\n \"zone\": \"<string>\",\n \"place\": \"<string>\",\n \"lat\": 123,\n \"lng\": 123\n },\n \"weight_kg\": 5,\n \"declared_value\": 123,\n \"delivery_method\": \"last_mile\",\n \"special_flags\": [\n \"fragile\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"quotes": [
{
"quote_id": "quote_1c80aeaced2846beb4d6a02ecd08ce19",
"courier_id": "6a2d4db2-c385-47ba-a146-a96856f6b199",
"courier_name": "Sendy",
"courier_tier": "gold",
"service_level": "standard",
"total_price": 291.5,
"currency": "KES",
"estimated_delivery_hours": 24,
"estimated_delivery_date": "2026-08-25T08:51:56.474317+00:00",
"breakdown": {
"base_rate": 220,
"weight_surcharge": 45,
"zone_addon": 0,
"service_multiplier": 1,
"special_surcharges": "[]",
"distance_overage": 0,
"courier_subtotal": 265,
"platform_fee": 26.5
},
"valid_until": "2026-08-24T08:53:56.474317+00:00"
},
{
"quote_id": "quote_0008992ff6114ec8b5a5c9e888cc3377",
"courier_id": "6a2d4db2-c385-47ba-a146-a96856f6b199",
"courier_name": "Sendy",
"courier_tier": "gold",
"service_level": "same_day",
"total_price": 772.2,
"currency": "KES",
"estimated_delivery_hours": 6,
"estimated_delivery_date": "2026-08-24T14:51:56.474317+00:00",
"breakdown": {
"base_rate": 300,
"weight_surcharge": 100,
"zone_addon": 50,
"service_multiplier": 1.2,
"special_surcharges": "[]",
"distance_overage": 0,
"courier_subtotal": 702,
"platform_fee": 70.2
},
"valid_until": "2026-08-24T08:53:56.474317+00:00"
},
{
"quote_id": "quote_59e736831904450cbd29408a511d83b3",
"courier_id": "180f9109-0cd9-439d-8cba-9c7442515455",
"courier_name": "G4S",
"courier_tier": "gold",
"service_level": "express",
"total_price": 676.5,
"currency": "KES",
"estimated_delivery_hours": 8,
"estimated_delivery_date": "2026-08-24T16:51:56.474317+00:00",
"breakdown": {
"base_rate": 350,
"weight_surcharge": 60,
"zone_addon": 0,
"service_multiplier": 1.5,
"special_surcharges": "[]",
"distance_overage": 0,
"courier_subtotal": 615,
"platform_fee": 61.5
},
"valid_until": "2026-08-24T08:53:56.474317+00:00"
},
{
"quote_id": "quote_008dcc973c5744539c9b6608022f7477",
"courier_id": "180f9109-0cd9-439d-8cba-9c7442515455",
"courier_name": "G4S",
"courier_tier": "gold",
"service_level": "standard",
"total_price": 264,
"currency": "KES",
"estimated_delivery_hours": 24,
"estimated_delivery_date": "2026-08-25T08:51:56.474317+00:00",
"breakdown": {
"base_rate": 200,
"weight_surcharge": 40,
"zone_addon": 0,
"service_multiplier": 1,
"special_surcharges": "[]",
"distance_overage": 0,
"courier_subtotal": 240,
"platform_fee": 24
},
"valid_until": "2026-08-24T08:53:56.474317+00:00"
}
],
"meta": {
"request_id": "req_e7e41a955ae2417a82c5053c",
"count": 4
}
}Authorizations
Body
curl --request POST \
--url https://api.tybritelabs.com/logistics/v1/rates/calculate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"origin": {
"city": "<string>",
"zone": "<string>",
"place": "<string>",
"lat": 123,
"lng": 123
},
"destination": {
"city": "<string>",
"zone": "<string>",
"place": "<string>",
"lat": 123,
"lng": 123
},
"weight_kg": 5,
"declared_value": 123,
"delivery_method": "last_mile",
"special_flags": [
"fragile"
]
}
'import requests
url = "https://api.tybritelabs.com/logistics/v1/rates/calculate"
payload = {
"origin": {
"city": "<string>",
"zone": "<string>",
"place": "<string>",
"lat": 123,
"lng": 123
},
"destination": {
"city": "<string>",
"zone": "<string>",
"place": "<string>",
"lat": 123,
"lng": 123
},
"weight_kg": 5,
"declared_value": 123,
"delivery_method": "last_mile",
"special_flags": ["fragile"]
}
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({
origin: {city: '<string>', zone: '<string>', place: '<string>', lat: 123, lng: 123},
destination: {city: '<string>', zone: '<string>', place: '<string>', lat: 123, lng: 123},
weight_kg: 5,
declared_value: 123,
delivery_method: 'last_mile',
special_flags: ['fragile']
})
};
fetch('https://api.tybritelabs.com/logistics/v1/rates/calculate', 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.tybritelabs.com/logistics/v1/rates/calculate",
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([
'origin' => [
'city' => '<string>',
'zone' => '<string>',
'place' => '<string>',
'lat' => 123,
'lng' => 123
],
'destination' => [
'city' => '<string>',
'zone' => '<string>',
'place' => '<string>',
'lat' => 123,
'lng' => 123
],
'weight_kg' => 5,
'declared_value' => 123,
'delivery_method' => 'last_mile',
'special_flags' => [
'fragile'
]
]),
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.tybritelabs.com/logistics/v1/rates/calculate"
payload := strings.NewReader("{\n \"origin\": {\n \"city\": \"<string>\",\n \"zone\": \"<string>\",\n \"place\": \"<string>\",\n \"lat\": 123,\n \"lng\": 123\n },\n \"destination\": {\n \"city\": \"<string>\",\n \"zone\": \"<string>\",\n \"place\": \"<string>\",\n \"lat\": 123,\n \"lng\": 123\n },\n \"weight_kg\": 5,\n \"declared_value\": 123,\n \"delivery_method\": \"last_mile\",\n \"special_flags\": [\n \"fragile\"\n ]\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.tybritelabs.com/logistics/v1/rates/calculate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"origin\": {\n \"city\": \"<string>\",\n \"zone\": \"<string>\",\n \"place\": \"<string>\",\n \"lat\": 123,\n \"lng\": 123\n },\n \"destination\": {\n \"city\": \"<string>\",\n \"zone\": \"<string>\",\n \"place\": \"<string>\",\n \"lat\": 123,\n \"lng\": 123\n },\n \"weight_kg\": 5,\n \"declared_value\": 123,\n \"delivery_method\": \"last_mile\",\n \"special_flags\": [\n \"fragile\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tybritelabs.com/logistics/v1/rates/calculate")
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 \"origin\": {\n \"city\": \"<string>\",\n \"zone\": \"<string>\",\n \"place\": \"<string>\",\n \"lat\": 123,\n \"lng\": 123\n },\n \"destination\": {\n \"city\": \"<string>\",\n \"zone\": \"<string>\",\n \"place\": \"<string>\",\n \"lat\": 123,\n \"lng\": 123\n },\n \"weight_kg\": 5,\n \"declared_value\": 123,\n \"delivery_method\": \"last_mile\",\n \"special_flags\": [\n \"fragile\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"quotes": [
{
"quote_id": "quote_1c80aeaced2846beb4d6a02ecd08ce19",
"courier_id": "6a2d4db2-c385-47ba-a146-a96856f6b199",
"courier_name": "Sendy",
"courier_tier": "gold",
"service_level": "standard",
"total_price": 291.5,
"currency": "KES",
"estimated_delivery_hours": 24,
"estimated_delivery_date": "2026-08-25T08:51:56.474317+00:00",
"breakdown": {
"base_rate": 220,
"weight_surcharge": 45,
"zone_addon": 0,
"service_multiplier": 1,
"special_surcharges": "[]",
"distance_overage": 0,
"courier_subtotal": 265,
"platform_fee": 26.5
},
"valid_until": "2026-08-24T08:53:56.474317+00:00"
},
{
"quote_id": "quote_0008992ff6114ec8b5a5c9e888cc3377",
"courier_id": "6a2d4db2-c385-47ba-a146-a96856f6b199",
"courier_name": "Sendy",
"courier_tier": "gold",
"service_level": "same_day",
"total_price": 772.2,
"currency": "KES",
"estimated_delivery_hours": 6,
"estimated_delivery_date": "2026-08-24T14:51:56.474317+00:00",
"breakdown": {
"base_rate": 300,
"weight_surcharge": 100,
"zone_addon": 50,
"service_multiplier": 1.2,
"special_surcharges": "[]",
"distance_overage": 0,
"courier_subtotal": 702,
"platform_fee": 70.2
},
"valid_until": "2026-08-24T08:53:56.474317+00:00"
},
{
"quote_id": "quote_59e736831904450cbd29408a511d83b3",
"courier_id": "180f9109-0cd9-439d-8cba-9c7442515455",
"courier_name": "G4S",
"courier_tier": "gold",
"service_level": "express",
"total_price": 676.5,
"currency": "KES",
"estimated_delivery_hours": 8,
"estimated_delivery_date": "2026-08-24T16:51:56.474317+00:00",
"breakdown": {
"base_rate": 350,
"weight_surcharge": 60,
"zone_addon": 0,
"service_multiplier": 1.5,
"special_surcharges": "[]",
"distance_overage": 0,
"courier_subtotal": 615,
"platform_fee": 61.5
},
"valid_until": "2026-08-24T08:53:56.474317+00:00"
},
{
"quote_id": "quote_008dcc973c5744539c9b6608022f7477",
"courier_id": "180f9109-0cd9-439d-8cba-9c7442515455",
"courier_name": "G4S",
"courier_tier": "gold",
"service_level": "standard",
"total_price": 264,
"currency": "KES",
"estimated_delivery_hours": 24,
"estimated_delivery_date": "2026-08-25T08:51:56.474317+00:00",
"breakdown": {
"base_rate": 200,
"weight_surcharge": 40,
"zone_addon": 0,
"service_multiplier": 1,
"special_surcharges": "[]",
"distance_overage": 0,
"courier_subtotal": 240,
"platform_fee": 24
},
"valid_until": "2026-08-24T08:53:56.474317+00:00"
}
],
"meta": {
"request_id": "req_e7e41a955ae2417a82c5053c",
"count": 4
}
}
