curl --request POST \
--url https://api.safarapi.com/api/partner/v1/quotes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-Signature: <x-signature>' \
--header 'X-Timestamp: <x-timestamp>' \
--data '
{
"adventure_slug": "marrakech-3-jours-desert-sandbox",
"rate_pack_id": "4a700002-0000-4000-8000-0000000000f2",
"start_date": "2026-07-12",
"rooms": [
{
"adults": 2,
"children": [
{
"age": 8
},
{
"age": 12
}
]
}
]
}
'import requests
url = "https://api.safarapi.com/api/partner/v1/quotes"
payload = {
"adventure_slug": "marrakech-3-jours-desert-sandbox",
"rate_pack_id": "4a700002-0000-4000-8000-0000000000f2",
"start_date": "2026-07-12",
"rooms": [
{
"adults": 2,
"children": [{ "age": 8 }, { "age": 12 }]
}
]
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"X-Timestamp": "<x-timestamp>",
"X-Signature": "<x-signature>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'X-Timestamp': '<x-timestamp>',
'X-Signature': '<x-signature>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
adventure_slug: 'marrakech-3-jours-desert-sandbox',
rate_pack_id: '4a700002-0000-4000-8000-0000000000f2',
start_date: '2026-07-12',
rooms: [{adults: 2, children: [{age: 8}, {age: 12}]}]
})
};
fetch('https://api.safarapi.com/api/partner/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://api.safarapi.com/api/partner/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([
'adventure_slug' => 'marrakech-3-jours-desert-sandbox',
'rate_pack_id' => '4a700002-0000-4000-8000-0000000000f2',
'start_date' => '2026-07-12',
'rooms' => [
[
'adults' => 2,
'children' => [
[
'age' => 8
],
[
'age' => 12
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"X-Signature: <x-signature>",
"X-Timestamp: <x-timestamp>"
],
]);
$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.safarapi.com/api/partner/v1/quotes"
payload := strings.NewReader("{\n \"adventure_slug\": \"marrakech-3-jours-desert-sandbox\",\n \"rate_pack_id\": \"4a700002-0000-4000-8000-0000000000f2\",\n \"start_date\": \"2026-07-12\",\n \"rooms\": [\n {\n \"adults\": 2,\n \"children\": [\n {\n \"age\": 8\n },\n {\n \"age\": 12\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("X-Timestamp", "<x-timestamp>")
req.Header.Add("X-Signature", "<x-signature>")
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.safarapi.com/api/partner/v1/quotes")
.header("Idempotency-Key", "<idempotency-key>")
.header("X-Timestamp", "<x-timestamp>")
.header("X-Signature", "<x-signature>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"adventure_slug\": \"marrakech-3-jours-desert-sandbox\",\n \"rate_pack_id\": \"4a700002-0000-4000-8000-0000000000f2\",\n \"start_date\": \"2026-07-12\",\n \"rooms\": [\n {\n \"adults\": 2,\n \"children\": [\n {\n \"age\": 8\n },\n {\n \"age\": 12\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.safarapi.com/api/partner/v1/quotes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["X-Timestamp"] = '<x-timestamp>'
request["X-Signature"] = '<x-signature>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"adventure_slug\": \"marrakech-3-jours-desert-sandbox\",\n \"rate_pack_id\": \"4a700002-0000-4000-8000-0000000000f2\",\n \"start_date\": \"2026-07-12\",\n \"rooms\": [\n {\n \"adults\": 2,\n \"children\": [\n {\n \"age\": 8\n },\n {\n \"age\": 12\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyCreate a price-locked quote
Computes the net price for a traveler composition on a specific slot. The price is
locked for 30 minutes: POST /bookings with this quote_id uses the computed
price even if the rate pack’s rate has changed in the meantime.
After 30 min the quote_id is invalidated and POST /bookings returns
quote.expired. The bank must then create a new quote at the current rate.
Every age in rooms[].children[].age is classified against the adventure’s age_brackets
before pricing: at or below infant_max_age an infant, up to child_max_age a child,
above it an adult paying the adult rate. The rate pack tells you in advance what the
classification will cost you, through children_allowed, infants_allowed, child_price,
infant_price, max_children and max_infants, so a composition can be checked against
GET /adventures/{slug} without issuing a quote.
Four 400 codes come from that composition: adventure.children.not.accepted,
adventure.infants.not.accepted, adventure.children.max.exceeded and
adventure.infants.max.exceeded. A fifth, adventure.room.occupancy.exceeded, is raised
when a room holds more travellers than its max_occupancy, infants excepted.
Example values are illustrative: take a real adventure_slug and
rate_pack_id from GET /adventures / GET /adventures/{slug} (in the
sandbox, slugs carry a -sandbox suffix).
curl --request POST \
--url https://api.safarapi.com/api/partner/v1/quotes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-Signature: <x-signature>' \
--header 'X-Timestamp: <x-timestamp>' \
--data '
{
"adventure_slug": "marrakech-3-jours-desert-sandbox",
"rate_pack_id": "4a700002-0000-4000-8000-0000000000f2",
"start_date": "2026-07-12",
"rooms": [
{
"adults": 2,
"children": [
{
"age": 8
},
{
"age": 12
}
]
}
]
}
'import requests
url = "https://api.safarapi.com/api/partner/v1/quotes"
payload = {
"adventure_slug": "marrakech-3-jours-desert-sandbox",
"rate_pack_id": "4a700002-0000-4000-8000-0000000000f2",
"start_date": "2026-07-12",
"rooms": [
{
"adults": 2,
"children": [{ "age": 8 }, { "age": 12 }]
}
]
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"X-Timestamp": "<x-timestamp>",
"X-Signature": "<x-signature>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'X-Timestamp': '<x-timestamp>',
'X-Signature': '<x-signature>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
adventure_slug: 'marrakech-3-jours-desert-sandbox',
rate_pack_id: '4a700002-0000-4000-8000-0000000000f2',
start_date: '2026-07-12',
rooms: [{adults: 2, children: [{age: 8}, {age: 12}]}]
})
};
fetch('https://api.safarapi.com/api/partner/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://api.safarapi.com/api/partner/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([
'adventure_slug' => 'marrakech-3-jours-desert-sandbox',
'rate_pack_id' => '4a700002-0000-4000-8000-0000000000f2',
'start_date' => '2026-07-12',
'rooms' => [
[
'adults' => 2,
'children' => [
[
'age' => 8
],
[
'age' => 12
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"X-Signature: <x-signature>",
"X-Timestamp: <x-timestamp>"
],
]);
$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.safarapi.com/api/partner/v1/quotes"
payload := strings.NewReader("{\n \"adventure_slug\": \"marrakech-3-jours-desert-sandbox\",\n \"rate_pack_id\": \"4a700002-0000-4000-8000-0000000000f2\",\n \"start_date\": \"2026-07-12\",\n \"rooms\": [\n {\n \"adults\": 2,\n \"children\": [\n {\n \"age\": 8\n },\n {\n \"age\": 12\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("X-Timestamp", "<x-timestamp>")
req.Header.Add("X-Signature", "<x-signature>")
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.safarapi.com/api/partner/v1/quotes")
.header("Idempotency-Key", "<idempotency-key>")
.header("X-Timestamp", "<x-timestamp>")
.header("X-Signature", "<x-signature>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"adventure_slug\": \"marrakech-3-jours-desert-sandbox\",\n \"rate_pack_id\": \"4a700002-0000-4000-8000-0000000000f2\",\n \"start_date\": \"2026-07-12\",\n \"rooms\": [\n {\n \"adults\": 2,\n \"children\": [\n {\n \"age\": 8\n },\n {\n \"age\": 12\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.safarapi.com/api/partner/v1/quotes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["X-Timestamp"] = '<x-timestamp>'
request["X-Signature"] = '<x-signature>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"adventure_slug\": \"marrakech-3-jours-desert-sandbox\",\n \"rate_pack_id\": \"4a700002-0000-4000-8000-0000000000f2\",\n \"start_date\": \"2026-07-12\",\n \"rooms\": [\n {\n \"adults\": 2,\n \"children\": [\n {\n \"age\": 8\n },\n {\n \"age\": 12\n }\n ]\n }\n ]\n}"
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.
Headers
Opaque, client-generated string unique per logical operation (a UUID v4 is
recommended but any non-blank value up to 255 chars is accepted). Same key +
same body = the cached response is returned with the Idempotent-Replayed: true
header. Same key + different body = 409 Conflict. Retained for 24 h.
255Unix timestamp in seconds at the time the request is issued. Validity window
±5 minutes — beyond that the request is rejected. Required for production
sk_live_* keys only; not required for sandbox sk_test_* keys.
hex(HMAC_SHA256(secret, "{X-Timestamp}\n{METHOD}\n{path}\n{body}")).
The path includes the query string. The body is the exact JSON representation
sent — any reformatting invalidates the signature. Required for production
sk_live_* keys only; not required for sandbox sk_test_* keys.
^[a-f0-9]{64}$Body
^[a-z0-9-]+$1 - 10 elementsShow child attributes
Show child attributes
Required on an EXPERIENCE whose rate pack exposes start_times
(partner.quote.starttime.required otherwise). Optional on a TRIP, whose departure hour
is informative. In both cases a value that is not one of the pack start_times is
rejected (partner.quote.starttime.not.available). Returned as null for a pack that
exposes no start time, flexible packs included.
^[0-2][0-9]:[0-5][0-9]$Response
Quote created
Revenue breakdown (locked price; indicative = false, sandbox_surcharge = 0).
pricing.amount_due_to_safariat is the amount-match anchor for booking creation.
Show child attributes
Show child attributes
Priced lines making up the quote. travelers is always present; room_supplement appears
when the booked room types carry a supplement. The lines sum to the gross price found in
pricing.
Show child attributes
Show child attributes
30-minute TTL after creation.
Show child attributes
Show child attributes