Validate Fare & Lock Price
curl --request POST \
--url https://api.travomatrix.com/api/v1/flight/fare/validate \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"search_id": "SEARCH_123",
"signature": "SIG_XYZ",
"pax": {
"adult": 1
}
}
'import requests
url = "https://api.travomatrix.com/api/v1/flight/fare/validate"
payload = {
"search_id": "SEARCH_123",
"signature": "SIG_XYZ",
"pax": { "adult": 1 }
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({search_id: 'SEARCH_123', signature: 'SIG_XYZ', pax: {adult: 1}})
};
fetch('https://api.travomatrix.com/api/v1/flight/fare/validate', 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.travomatrix.com/api/v1/flight/fare/validate",
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([
'search_id' => 'SEARCH_123',
'signature' => 'SIG_XYZ',
'pax' => [
'adult' => 1
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.travomatrix.com/api/v1/flight/fare/validate"
payload := strings.NewReader("{\n \"search_id\": \"SEARCH_123\",\n \"signature\": \"SIG_XYZ\",\n \"pax\": {\n \"adult\": 1\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.travomatrix.com/api/v1/flight/fare/validate")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"search_id\": \"SEARCH_123\",\n \"signature\": \"SIG_XYZ\",\n \"pax\": {\n \"adult\": 1\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.travomatrix.com/api/v1/flight/fare/validate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"search_id\": \"SEARCH_123\",\n \"signature\": \"SIG_XYZ\",\n \"pax\": {\n \"adult\": 1\n }\n}"
response = http.request(request)
puts response.read_body{
"fare_token": "<string>",
"offer": {
"offer_id": "<string>",
"search_id": "<string>",
"signature": "<string>",
"airline": "<string>",
"segments": [
{
"carrier": "<string>",
"flight_no": "<string>",
"origin": "<string>",
"dest": "<string>",
"dep_time": "2023-11-07T05:31:56Z",
"arr_time": "2023-11-07T05:31:56Z",
"booking_class": "<string>",
"seats_available": 123
}
],
"best_price_paise": 123,
"currency": "<string>",
"pricing_breakdown": {
"base_fare": 123,
"taxes": 123,
"commission": 123,
"ota_markup": 123,
"agent_markup": 123,
"net_fare": 123,
"final_price": 123
},
"expires_at": "2023-11-07T05:31:56Z"
}
}Core Booking
Step 2: Validate Fare
POST
/
flight
/
fare
/
validate
Validate Fare & Lock Price
curl --request POST \
--url https://api.travomatrix.com/api/v1/flight/fare/validate \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"search_id": "SEARCH_123",
"signature": "SIG_XYZ",
"pax": {
"adult": 1
}
}
'import requests
url = "https://api.travomatrix.com/api/v1/flight/fare/validate"
payload = {
"search_id": "SEARCH_123",
"signature": "SIG_XYZ",
"pax": { "adult": 1 }
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({search_id: 'SEARCH_123', signature: 'SIG_XYZ', pax: {adult: 1}})
};
fetch('https://api.travomatrix.com/api/v1/flight/fare/validate', 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.travomatrix.com/api/v1/flight/fare/validate",
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([
'search_id' => 'SEARCH_123',
'signature' => 'SIG_XYZ',
'pax' => [
'adult' => 1
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.travomatrix.com/api/v1/flight/fare/validate"
payload := strings.NewReader("{\n \"search_id\": \"SEARCH_123\",\n \"signature\": \"SIG_XYZ\",\n \"pax\": {\n \"adult\": 1\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.travomatrix.com/api/v1/flight/fare/validate")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"search_id\": \"SEARCH_123\",\n \"signature\": \"SIG_XYZ\",\n \"pax\": {\n \"adult\": 1\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.travomatrix.com/api/v1/flight/fare/validate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"search_id\": \"SEARCH_123\",\n \"signature\": \"SIG_XYZ\",\n \"pax\": {\n \"adult\": 1\n }\n}"
response = http.request(request)
puts response.read_body{
"fare_token": "<string>",
"offer": {
"offer_id": "<string>",
"search_id": "<string>",
"signature": "<string>",
"airline": "<string>",
"segments": [
{
"carrier": "<string>",
"flight_no": "<string>",
"origin": "<string>",
"dest": "<string>",
"dep_time": "2023-11-07T05:31:56Z",
"arr_time": "2023-11-07T05:31:56Z",
"booking_class": "<string>",
"seats_available": 123
}
],
"best_price_paise": 123,
"currency": "<string>",
"pricing_breakdown": {
"base_fare": 123,
"taxes": 123,
"commission": 123,
"ota_markup": 123,
"agent_markup": 123,
"net_fare": 123,
"final_price": 123
},
"expires_at": "2023-11-07T05:31:56Z"
}
}Before you can book, you must lock the price. We’ve removed the bloated schema definitions from this view so you can focus solely on executing the step.
Request Setup
string
required
Paste the
search_id from Step 1.string
required
Paste the
signature from Step 1.Instructions
- Paste the
search_idandsignatureyou copied from Step 1 into the fields above (or directly in the JSON on the right). - Hit the Send button.
Requirement: The provider has now locked this price for 15 minutes. Copy the
fare_token from the response. You will need it to create the booking.Authorizations
Headers
Unique correlation ID for tracing.
⌘I