curl --request POST \
--url https://developer.haulstow.co/v1/quotes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"pickup": {
"latitude": 5.6037,
"longitude": -0.187
},
"dropoff": {
"latitude": 5.6698,
"longitude": -0.1695
},
"vehicle_type": "bike"
}
'import requests
url = "https://developer.haulstow.co/v1/quotes"
payload = {
"pickup": {
"latitude": 5.6037,
"longitude": -0.187
},
"dropoff": {
"latitude": 5.6698,
"longitude": -0.1695
},
"vehicle_type": "bike"
}
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({
pickup: {latitude: 5.6037, longitude: -0.187},
dropoff: {latitude: 5.6698, longitude: -0.1695},
vehicle_type: 'bike'
})
};
fetch('https://developer.haulstow.co/v1/quotes', 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://developer.haulstow.co/v1/quotes",
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([
'pickup' => [
'latitude' => 5.6037,
'longitude' => -0.187
],
'dropoff' => [
'latitude' => 5.6698,
'longitude' => -0.1695
],
'vehicle_type' => 'bike'
]),
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://developer.haulstow.co/v1/quotes"
payload := strings.NewReader("{\n \"pickup\": {\n \"latitude\": 5.6037,\n \"longitude\": -0.187\n },\n \"dropoff\": {\n \"latitude\": 5.6698,\n \"longitude\": -0.1695\n },\n \"vehicle_type\": \"bike\"\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://developer.haulstow.co/v1/quotes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"pickup\": {\n \"latitude\": 5.6037,\n \"longitude\": -0.187\n },\n \"dropoff\": {\n \"latitude\": 5.6698,\n \"longitude\": -0.1695\n },\n \"vehicle_type\": \"bike\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer.haulstow.co/v1/quotes")
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 \"pickup\": {\n \"latitude\": 5.6037,\n \"longitude\": -0.187\n },\n \"dropoff\": {\n \"latitude\": 5.6698,\n \"longitude\": -0.1695\n },\n \"vehicle_type\": \"bike\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"statusCode": 200,
"message": "Quote calculated",
"data": {
"environment": "live",
"simulated": false,
"vehicle_type": "bike",
"currency": "GHS",
"distance_km": 8.4,
"distance_source": "road",
"fee": 40,
"requires_custom_quote": false,
"load_tier": null,
"load_tier_label": null,
"pricing_source": "band"
}
}Create a delivery quote
Calculates a quote from pickup and drop-off coordinates. Send either
pickup coordinates or a saved pickup_location_id, not both. For a
minivan, send weight_kg and volume_m3 so the trip is priced on the
right load tier; a load over the largest tier is refused with
422 MANUAL_QUOTE_REQUIRED. If your business is on the preferred rate,
a drop-off within the preferred radius of the hub comes back at the
flat preferred price with pricing_source: preferred_rate. This
operation does not create or reserve a delivery and does not require an
Idempotency-Key.
curl --request POST \
--url https://developer.haulstow.co/v1/quotes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"pickup": {
"latitude": 5.6037,
"longitude": -0.187
},
"dropoff": {
"latitude": 5.6698,
"longitude": -0.1695
},
"vehicle_type": "bike"
}
'import requests
url = "https://developer.haulstow.co/v1/quotes"
payload = {
"pickup": {
"latitude": 5.6037,
"longitude": -0.187
},
"dropoff": {
"latitude": 5.6698,
"longitude": -0.1695
},
"vehicle_type": "bike"
}
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({
pickup: {latitude: 5.6037, longitude: -0.187},
dropoff: {latitude: 5.6698, longitude: -0.1695},
vehicle_type: 'bike'
})
};
fetch('https://developer.haulstow.co/v1/quotes', 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://developer.haulstow.co/v1/quotes",
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([
'pickup' => [
'latitude' => 5.6037,
'longitude' => -0.187
],
'dropoff' => [
'latitude' => 5.6698,
'longitude' => -0.1695
],
'vehicle_type' => 'bike'
]),
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://developer.haulstow.co/v1/quotes"
payload := strings.NewReader("{\n \"pickup\": {\n \"latitude\": 5.6037,\n \"longitude\": -0.187\n },\n \"dropoff\": {\n \"latitude\": 5.6698,\n \"longitude\": -0.1695\n },\n \"vehicle_type\": \"bike\"\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://developer.haulstow.co/v1/quotes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"pickup\": {\n \"latitude\": 5.6037,\n \"longitude\": -0.187\n },\n \"dropoff\": {\n \"latitude\": 5.6698,\n \"longitude\": -0.1695\n },\n \"vehicle_type\": \"bike\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer.haulstow.co/v1/quotes")
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 \"pickup\": {\n \"latitude\": 5.6037,\n \"longitude\": -0.187\n },\n \"dropoff\": {\n \"latitude\": 5.6698,\n \"longitude\": -0.1695\n },\n \"vehicle_type\": \"bike\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"statusCode": 200,
"message": "Quote calculated",
"data": {
"environment": "live",
"simulated": false,
"vehicle_type": "bike",
"currency": "GHS",
"distance_km": 8.4,
"distance_source": "road",
"fee": 40,
"requires_custom_quote": false,
"load_tier": null,
"load_tier_label": null,
"pricing_source": "band"
}
}Authorizations
Headers
Body
Total weight of the parcel in kilograms. Only read for minivan: with
volume_m3 it decides the load tier the trip is priced on (the higher
of the two). Omit both and the smallest tier applies. A weight over the
largest tier is refused with 422 MANUAL_QUOTE_REQUIRED. Ignored for
bike.
0 <= x <= 1000080
