curl --request POST \
--url https://api.paywithlocus.com/api/wrapped/credits/locus-travel/flight-search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"origin": "<string>",
"destination": "<string>",
"departureDate": "2023-12-25",
"returnDate": "2023-12-25",
"adults": 1,
"children": 0,
"infants": 0,
"cabinClass": "economy",
"currency": "USD",
"optimize": [],
"preferredAirlines": [
"<string>"
],
"excludedAirlines": [
"<string>"
],
"preferredAirports": [
"<string>"
],
"excludedAirports": [
"<string>"
],
"maxStops": 1,
"minLayoverMinutes": 720,
"maxLayoverMinutes": 1440,
"maxDurationMinutes": 5055,
"maxPrice": 123,
"departAfter": "<string>",
"departBefore": "<string>",
"arriveAfter": "<string>",
"arriveBefore": "<string>",
"maxResults": 25,
"maxProviders": 6,
"providers": [],
"maxCredits": "<string>",
"externalUserId": "<string>",
"attribution": {}
}
'import requests
url = "https://api.paywithlocus.com/api/wrapped/credits/locus-travel/flight-search"
payload = {
"origin": "<string>",
"destination": "<string>",
"departureDate": "2023-12-25",
"returnDate": "2023-12-25",
"adults": 1,
"children": 0,
"infants": 0,
"cabinClass": "economy",
"currency": "USD",
"optimize": [],
"preferredAirlines": ["<string>"],
"excludedAirlines": ["<string>"],
"preferredAirports": ["<string>"],
"excludedAirports": ["<string>"],
"maxStops": 1,
"minLayoverMinutes": 720,
"maxLayoverMinutes": 1440,
"maxDurationMinutes": 5055,
"maxPrice": 123,
"departAfter": "<string>",
"departBefore": "<string>",
"arriveAfter": "<string>",
"arriveBefore": "<string>",
"maxResults": 25,
"maxProviders": 6,
"providers": [],
"maxCredits": "<string>",
"externalUserId": "<string>",
"attribution": {}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"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>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
origin: '<string>',
destination: '<string>',
departureDate: '2023-12-25',
returnDate: '2023-12-25',
adults: 1,
children: 0,
infants: 0,
cabinClass: 'economy',
currency: 'USD',
optimize: [],
preferredAirlines: ['<string>'],
excludedAirlines: ['<string>'],
preferredAirports: ['<string>'],
excludedAirports: ['<string>'],
maxStops: 1,
minLayoverMinutes: 720,
maxLayoverMinutes: 1440,
maxDurationMinutes: 5055,
maxPrice: 123,
departAfter: '<string>',
departBefore: '<string>',
arriveAfter: '<string>',
arriveBefore: '<string>',
maxResults: 25,
maxProviders: 6,
providers: [],
maxCredits: '<string>',
externalUserId: '<string>',
attribution: {}
})
};
fetch('https://api.paywithlocus.com/api/wrapped/credits/locus-travel/flight-search', 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.paywithlocus.com/api/wrapped/credits/locus-travel/flight-search",
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' => '<string>',
'destination' => '<string>',
'departureDate' => '2023-12-25',
'returnDate' => '2023-12-25',
'adults' => 1,
'children' => 0,
'infants' => 0,
'cabinClass' => 'economy',
'currency' => 'USD',
'optimize' => [
],
'preferredAirlines' => [
'<string>'
],
'excludedAirlines' => [
'<string>'
],
'preferredAirports' => [
'<string>'
],
'excludedAirports' => [
'<string>'
],
'maxStops' => 1,
'minLayoverMinutes' => 720,
'maxLayoverMinutes' => 1440,
'maxDurationMinutes' => 5055,
'maxPrice' => 123,
'departAfter' => '<string>',
'departBefore' => '<string>',
'arriveAfter' => '<string>',
'arriveBefore' => '<string>',
'maxResults' => 25,
'maxProviders' => 6,
'providers' => [
],
'maxCredits' => '<string>',
'externalUserId' => '<string>',
'attribution' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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.paywithlocus.com/api/wrapped/credits/locus-travel/flight-search"
payload := strings.NewReader("{\n \"origin\": \"<string>\",\n \"destination\": \"<string>\",\n \"departureDate\": \"2023-12-25\",\n \"returnDate\": \"2023-12-25\",\n \"adults\": 1,\n \"children\": 0,\n \"infants\": 0,\n \"cabinClass\": \"economy\",\n \"currency\": \"USD\",\n \"optimize\": [],\n \"preferredAirlines\": [\n \"<string>\"\n ],\n \"excludedAirlines\": [\n \"<string>\"\n ],\n \"preferredAirports\": [\n \"<string>\"\n ],\n \"excludedAirports\": [\n \"<string>\"\n ],\n \"maxStops\": 1,\n \"minLayoverMinutes\": 720,\n \"maxLayoverMinutes\": 1440,\n \"maxDurationMinutes\": 5055,\n \"maxPrice\": 123,\n \"departAfter\": \"<string>\",\n \"departBefore\": \"<string>\",\n \"arriveAfter\": \"<string>\",\n \"arriveBefore\": \"<string>\",\n \"maxResults\": 25,\n \"maxProviders\": 6,\n \"providers\": [],\n \"maxCredits\": \"<string>\",\n \"externalUserId\": \"<string>\",\n \"attribution\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.paywithlocus.com/api/wrapped/credits/locus-travel/flight-search")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"origin\": \"<string>\",\n \"destination\": \"<string>\",\n \"departureDate\": \"2023-12-25\",\n \"returnDate\": \"2023-12-25\",\n \"adults\": 1,\n \"children\": 0,\n \"infants\": 0,\n \"cabinClass\": \"economy\",\n \"currency\": \"USD\",\n \"optimize\": [],\n \"preferredAirlines\": [\n \"<string>\"\n ],\n \"excludedAirlines\": [\n \"<string>\"\n ],\n \"preferredAirports\": [\n \"<string>\"\n ],\n \"excludedAirports\": [\n \"<string>\"\n ],\n \"maxStops\": 1,\n \"minLayoverMinutes\": 720,\n \"maxLayoverMinutes\": 1440,\n \"maxDurationMinutes\": 5055,\n \"maxPrice\": 123,\n \"departAfter\": \"<string>\",\n \"departBefore\": \"<string>\",\n \"arriveAfter\": \"<string>\",\n \"arriveBefore\": \"<string>\",\n \"maxResults\": 25,\n \"maxProviders\": 6,\n \"providers\": [],\n \"maxCredits\": \"<string>\",\n \"externalUserId\": \"<string>\",\n \"attribution\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paywithlocus.com/api/wrapped/credits/locus-travel/flight-search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"origin\": \"<string>\",\n \"destination\": \"<string>\",\n \"departureDate\": \"2023-12-25\",\n \"returnDate\": \"2023-12-25\",\n \"adults\": 1,\n \"children\": 0,\n \"infants\": 0,\n \"cabinClass\": \"economy\",\n \"currency\": \"USD\",\n \"optimize\": [],\n \"preferredAirlines\": [\n \"<string>\"\n ],\n \"excludedAirlines\": [\n \"<string>\"\n ],\n \"preferredAirports\": [\n \"<string>\"\n ],\n \"excludedAirports\": [\n \"<string>\"\n ],\n \"maxStops\": 1,\n \"minLayoverMinutes\": 720,\n \"maxLayoverMinutes\": 1440,\n \"maxDurationMinutes\": 5055,\n \"maxPrice\": 123,\n \"departAfter\": \"<string>\",\n \"departBefore\": \"<string>\",\n \"arriveAfter\": \"<string>\",\n \"arriveBefore\": \"<string>\",\n \"maxResults\": 25,\n \"maxProviders\": 6,\n \"providers\": [],\n \"maxCredits\": \"<string>\",\n \"externalUserId\": \"<string>\",\n \"attribution\": {}\n}"
response = http.request(request)
puts response.read_body{
"object": "locus.travel_flight_search",
"capability": "travel.flight_search",
"routerVersion": "<string>",
"runId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"search": {
"origin": "<string>",
"destination": "<string>",
"departureDate": "2023-12-25",
"returnDate": "2023-12-25",
"adults": 1,
"children": 0,
"infants": 0,
"cabinClass": "economy",
"currency": "USD",
"optimize": [
"cost"
],
"preferredAirlines": [
"<string>"
],
"excludedAirlines": [
"<string>"
],
"preferredAirports": [
"<string>"
],
"excludedAirports": [
"<string>"
],
"maxStops": 1,
"minLayoverMinutes": 720,
"maxLayoverMinutes": 1440,
"maxDurationMinutes": 5055,
"maxPrice": 123,
"departAfter": "<string>",
"departBefore": "<string>",
"arriveAfter": "<string>",
"arriveBefore": "<string>",
"maxResults": 25,
"maxProviders": 6,
"providers": [
"aircanada"
],
"maxCredits": "<string>",
"externalUserId": "<string>",
"attribution": {}
},
"appliedOptimizations": [
"cost"
],
"partial": true,
"warnings": [
"<string>"
],
"providers": [
{
"providerId": "<string>",
"providerName": "<string>",
"status": "succeeded",
"latencyMs": 1,
"itineraryCount": 1,
"surfacedItineraryCount": 1,
"uniqueSurfacedItineraryCount": 1,
"tailLatencyContributionMs": 1,
"chargedCredits": "<string>",
"errorCode": "<string>",
"estimatedCostUsd": 1
}
],
"itineraries": [
{
"id": "<string>",
"score": 123,
"legs": [
{
"origin": {
"code": "<string>",
"name": "<string>",
"city": "<string>"
},
"destination": {
"code": "<string>",
"name": "<string>",
"city": "<string>"
},
"departure": "<string>",
"arrival": "<string>",
"stopCount": 1,
"segments": [
{
"origin": {
"code": "<string>",
"name": "<string>",
"city": "<string>"
},
"destination": {
"code": "<string>",
"name": "<string>",
"city": "<string>"
},
"departure": "<string>",
"arrival": "<string>",
"durationMinutes": 1,
"flightNumber": "<string>",
"marketingCarrier": {
"code": "<string>",
"name": "<string>"
},
"operatingCarrier": {
"code": "<string>",
"name": "<string>"
},
"aircraft": "<string>"
}
],
"durationMinutes": 1,
"intermediateAirports": [
{
"code": "<string>",
"name": "<string>",
"city": "<string>"
}
],
"layoverDurationsMinutes": [
1
]
}
],
"offers": [
{
"amount": 1,
"currency": "<string>",
"providerId": "<string>",
"providerName": "<string>",
"formatted": "<string>",
"bookingUrl": "<string>",
"linkType": "booking",
"seller": "<string>",
"cabinClass": "economy",
"refundable": true
}
],
"tags": [
"<string>"
],
"confidence": {
"score": 123,
"sourceCount": 2,
"scheduleAgreement": "single_source",
"priceSpreadPercent": 1
},
"sources": [
{
"providerId": "<string>",
"providerName": "<string>",
"rank": 1,
"providerItineraryId": "<string>"
}
],
"sourceCount": 2,
"bookability": {
"status": "booking_link_available",
"offerCount": 1,
"bookingLinkOfferCount": 1,
"searchHandoffOfferCount": 1,
"currency": "<string>",
"cheapestBookableAmount": 1
},
"providerItineraryId": "<string>",
"selfTransfer": true,
"baggage": "<string>",
"seatsRemaining": 1
}
],
"itineraryCount": 1,
"bookability": {
"bookableItineraryCount": 1,
"searchHandoffItineraryCount": 1,
"bookingLinkOfferCount": 1,
"searchHandoffOfferCount": 1,
"offerCount": 1
},
"feedback": {
"method": "POST",
"route": "<string>",
"runId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"billing": {
"chargedCredits": "<string>",
"successfulProviders": 1,
"attemptedProviders": 1
}
}{
"object": "locus.travel_flight_search.pending",
"capability": "travel.flight_search",
"runId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "processing",
"message": "<string>",
"providers": [
{
"providerId": "<string>",
"providerName": "<string>",
"status": "succeeded",
"latencyMs": 1
}
],
"billing": {
"chargedCredits": "<string>"
}
}Search flights across selected providers
Feature-gated system-managed capability router. Locus plans eligible providers, executes them concurrently, normalizes and deduplicates itineraries, ranks offers, and returns aggregate billing. Use the preview route first when you need an estimate. A narrower request maxCredits or credential-level ceiling prevents dispatch when the aggregate estimate is too high. Retries must reuse the same Idempotency-Key and identical logical request; a 202 response means one or more child providers are still processing, so retry with the same key.
curl --request POST \
--url https://api.paywithlocus.com/api/wrapped/credits/locus-travel/flight-search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"origin": "<string>",
"destination": "<string>",
"departureDate": "2023-12-25",
"returnDate": "2023-12-25",
"adults": 1,
"children": 0,
"infants": 0,
"cabinClass": "economy",
"currency": "USD",
"optimize": [],
"preferredAirlines": [
"<string>"
],
"excludedAirlines": [
"<string>"
],
"preferredAirports": [
"<string>"
],
"excludedAirports": [
"<string>"
],
"maxStops": 1,
"minLayoverMinutes": 720,
"maxLayoverMinutes": 1440,
"maxDurationMinutes": 5055,
"maxPrice": 123,
"departAfter": "<string>",
"departBefore": "<string>",
"arriveAfter": "<string>",
"arriveBefore": "<string>",
"maxResults": 25,
"maxProviders": 6,
"providers": [],
"maxCredits": "<string>",
"externalUserId": "<string>",
"attribution": {}
}
'import requests
url = "https://api.paywithlocus.com/api/wrapped/credits/locus-travel/flight-search"
payload = {
"origin": "<string>",
"destination": "<string>",
"departureDate": "2023-12-25",
"returnDate": "2023-12-25",
"adults": 1,
"children": 0,
"infants": 0,
"cabinClass": "economy",
"currency": "USD",
"optimize": [],
"preferredAirlines": ["<string>"],
"excludedAirlines": ["<string>"],
"preferredAirports": ["<string>"],
"excludedAirports": ["<string>"],
"maxStops": 1,
"minLayoverMinutes": 720,
"maxLayoverMinutes": 1440,
"maxDurationMinutes": 5055,
"maxPrice": 123,
"departAfter": "<string>",
"departBefore": "<string>",
"arriveAfter": "<string>",
"arriveBefore": "<string>",
"maxResults": 25,
"maxProviders": 6,
"providers": [],
"maxCredits": "<string>",
"externalUserId": "<string>",
"attribution": {}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"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>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
origin: '<string>',
destination: '<string>',
departureDate: '2023-12-25',
returnDate: '2023-12-25',
adults: 1,
children: 0,
infants: 0,
cabinClass: 'economy',
currency: 'USD',
optimize: [],
preferredAirlines: ['<string>'],
excludedAirlines: ['<string>'],
preferredAirports: ['<string>'],
excludedAirports: ['<string>'],
maxStops: 1,
minLayoverMinutes: 720,
maxLayoverMinutes: 1440,
maxDurationMinutes: 5055,
maxPrice: 123,
departAfter: '<string>',
departBefore: '<string>',
arriveAfter: '<string>',
arriveBefore: '<string>',
maxResults: 25,
maxProviders: 6,
providers: [],
maxCredits: '<string>',
externalUserId: '<string>',
attribution: {}
})
};
fetch('https://api.paywithlocus.com/api/wrapped/credits/locus-travel/flight-search', 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.paywithlocus.com/api/wrapped/credits/locus-travel/flight-search",
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' => '<string>',
'destination' => '<string>',
'departureDate' => '2023-12-25',
'returnDate' => '2023-12-25',
'adults' => 1,
'children' => 0,
'infants' => 0,
'cabinClass' => 'economy',
'currency' => 'USD',
'optimize' => [
],
'preferredAirlines' => [
'<string>'
],
'excludedAirlines' => [
'<string>'
],
'preferredAirports' => [
'<string>'
],
'excludedAirports' => [
'<string>'
],
'maxStops' => 1,
'minLayoverMinutes' => 720,
'maxLayoverMinutes' => 1440,
'maxDurationMinutes' => 5055,
'maxPrice' => 123,
'departAfter' => '<string>',
'departBefore' => '<string>',
'arriveAfter' => '<string>',
'arriveBefore' => '<string>',
'maxResults' => 25,
'maxProviders' => 6,
'providers' => [
],
'maxCredits' => '<string>',
'externalUserId' => '<string>',
'attribution' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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.paywithlocus.com/api/wrapped/credits/locus-travel/flight-search"
payload := strings.NewReader("{\n \"origin\": \"<string>\",\n \"destination\": \"<string>\",\n \"departureDate\": \"2023-12-25\",\n \"returnDate\": \"2023-12-25\",\n \"adults\": 1,\n \"children\": 0,\n \"infants\": 0,\n \"cabinClass\": \"economy\",\n \"currency\": \"USD\",\n \"optimize\": [],\n \"preferredAirlines\": [\n \"<string>\"\n ],\n \"excludedAirlines\": [\n \"<string>\"\n ],\n \"preferredAirports\": [\n \"<string>\"\n ],\n \"excludedAirports\": [\n \"<string>\"\n ],\n \"maxStops\": 1,\n \"minLayoverMinutes\": 720,\n \"maxLayoverMinutes\": 1440,\n \"maxDurationMinutes\": 5055,\n \"maxPrice\": 123,\n \"departAfter\": \"<string>\",\n \"departBefore\": \"<string>\",\n \"arriveAfter\": \"<string>\",\n \"arriveBefore\": \"<string>\",\n \"maxResults\": 25,\n \"maxProviders\": 6,\n \"providers\": [],\n \"maxCredits\": \"<string>\",\n \"externalUserId\": \"<string>\",\n \"attribution\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.paywithlocus.com/api/wrapped/credits/locus-travel/flight-search")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"origin\": \"<string>\",\n \"destination\": \"<string>\",\n \"departureDate\": \"2023-12-25\",\n \"returnDate\": \"2023-12-25\",\n \"adults\": 1,\n \"children\": 0,\n \"infants\": 0,\n \"cabinClass\": \"economy\",\n \"currency\": \"USD\",\n \"optimize\": [],\n \"preferredAirlines\": [\n \"<string>\"\n ],\n \"excludedAirlines\": [\n \"<string>\"\n ],\n \"preferredAirports\": [\n \"<string>\"\n ],\n \"excludedAirports\": [\n \"<string>\"\n ],\n \"maxStops\": 1,\n \"minLayoverMinutes\": 720,\n \"maxLayoverMinutes\": 1440,\n \"maxDurationMinutes\": 5055,\n \"maxPrice\": 123,\n \"departAfter\": \"<string>\",\n \"departBefore\": \"<string>\",\n \"arriveAfter\": \"<string>\",\n \"arriveBefore\": \"<string>\",\n \"maxResults\": 25,\n \"maxProviders\": 6,\n \"providers\": [],\n \"maxCredits\": \"<string>\",\n \"externalUserId\": \"<string>\",\n \"attribution\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paywithlocus.com/api/wrapped/credits/locus-travel/flight-search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"origin\": \"<string>\",\n \"destination\": \"<string>\",\n \"departureDate\": \"2023-12-25\",\n \"returnDate\": \"2023-12-25\",\n \"adults\": 1,\n \"children\": 0,\n \"infants\": 0,\n \"cabinClass\": \"economy\",\n \"currency\": \"USD\",\n \"optimize\": [],\n \"preferredAirlines\": [\n \"<string>\"\n ],\n \"excludedAirlines\": [\n \"<string>\"\n ],\n \"preferredAirports\": [\n \"<string>\"\n ],\n \"excludedAirports\": [\n \"<string>\"\n ],\n \"maxStops\": 1,\n \"minLayoverMinutes\": 720,\n \"maxLayoverMinutes\": 1440,\n \"maxDurationMinutes\": 5055,\n \"maxPrice\": 123,\n \"departAfter\": \"<string>\",\n \"departBefore\": \"<string>\",\n \"arriveAfter\": \"<string>\",\n \"arriveBefore\": \"<string>\",\n \"maxResults\": 25,\n \"maxProviders\": 6,\n \"providers\": [],\n \"maxCredits\": \"<string>\",\n \"externalUserId\": \"<string>\",\n \"attribution\": {}\n}"
response = http.request(request)
puts response.read_body{
"object": "locus.travel_flight_search",
"capability": "travel.flight_search",
"routerVersion": "<string>",
"runId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"search": {
"origin": "<string>",
"destination": "<string>",
"departureDate": "2023-12-25",
"returnDate": "2023-12-25",
"adults": 1,
"children": 0,
"infants": 0,
"cabinClass": "economy",
"currency": "USD",
"optimize": [
"cost"
],
"preferredAirlines": [
"<string>"
],
"excludedAirlines": [
"<string>"
],
"preferredAirports": [
"<string>"
],
"excludedAirports": [
"<string>"
],
"maxStops": 1,
"minLayoverMinutes": 720,
"maxLayoverMinutes": 1440,
"maxDurationMinutes": 5055,
"maxPrice": 123,
"departAfter": "<string>",
"departBefore": "<string>",
"arriveAfter": "<string>",
"arriveBefore": "<string>",
"maxResults": 25,
"maxProviders": 6,
"providers": [
"aircanada"
],
"maxCredits": "<string>",
"externalUserId": "<string>",
"attribution": {}
},
"appliedOptimizations": [
"cost"
],
"partial": true,
"warnings": [
"<string>"
],
"providers": [
{
"providerId": "<string>",
"providerName": "<string>",
"status": "succeeded",
"latencyMs": 1,
"itineraryCount": 1,
"surfacedItineraryCount": 1,
"uniqueSurfacedItineraryCount": 1,
"tailLatencyContributionMs": 1,
"chargedCredits": "<string>",
"errorCode": "<string>",
"estimatedCostUsd": 1
}
],
"itineraries": [
{
"id": "<string>",
"score": 123,
"legs": [
{
"origin": {
"code": "<string>",
"name": "<string>",
"city": "<string>"
},
"destination": {
"code": "<string>",
"name": "<string>",
"city": "<string>"
},
"departure": "<string>",
"arrival": "<string>",
"stopCount": 1,
"segments": [
{
"origin": {
"code": "<string>",
"name": "<string>",
"city": "<string>"
},
"destination": {
"code": "<string>",
"name": "<string>",
"city": "<string>"
},
"departure": "<string>",
"arrival": "<string>",
"durationMinutes": 1,
"flightNumber": "<string>",
"marketingCarrier": {
"code": "<string>",
"name": "<string>"
},
"operatingCarrier": {
"code": "<string>",
"name": "<string>"
},
"aircraft": "<string>"
}
],
"durationMinutes": 1,
"intermediateAirports": [
{
"code": "<string>",
"name": "<string>",
"city": "<string>"
}
],
"layoverDurationsMinutes": [
1
]
}
],
"offers": [
{
"amount": 1,
"currency": "<string>",
"providerId": "<string>",
"providerName": "<string>",
"formatted": "<string>",
"bookingUrl": "<string>",
"linkType": "booking",
"seller": "<string>",
"cabinClass": "economy",
"refundable": true
}
],
"tags": [
"<string>"
],
"confidence": {
"score": 123,
"sourceCount": 2,
"scheduleAgreement": "single_source",
"priceSpreadPercent": 1
},
"sources": [
{
"providerId": "<string>",
"providerName": "<string>",
"rank": 1,
"providerItineraryId": "<string>"
}
],
"sourceCount": 2,
"bookability": {
"status": "booking_link_available",
"offerCount": 1,
"bookingLinkOfferCount": 1,
"searchHandoffOfferCount": 1,
"currency": "<string>",
"cheapestBookableAmount": 1
},
"providerItineraryId": "<string>",
"selfTransfer": true,
"baggage": "<string>",
"seatsRemaining": 1
}
],
"itineraryCount": 1,
"bookability": {
"bookableItineraryCount": 1,
"searchHandoffItineraryCount": 1,
"bookingLinkOfferCount": 1,
"searchHandoffOfferCount": 1,
"offerCount": 1
},
"feedback": {
"method": "POST",
"route": "<string>",
"runId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"billing": {
"chargedCredits": "<string>",
"successfulProviders": 1,
"attemptedProviders": 1
}
}{
"object": "locus.travel_flight_search.pending",
"capability": "travel.flight_search",
"runId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "processing",
"message": "<string>",
"providers": [
{
"providerId": "<string>",
"providerName": "<string>",
"status": "succeeded",
"latencyMs": 1
}
],
"billing": {
"chargedCredits": "<string>"
}
}Authorizations
Tenant secret key (lcr_…). Server-side only.
Headers
Required only when the end-user JWT carries sid. Send the original high-entropy session value; sid is its SHA-256 fingerprint. Ignored for secret-key authentication.
16 - 128^[A-Za-z0-9][A-Za-z0-9._:-]{15,127}$One key per logical travel search. Reuse it with an identical request to replay or finish the run.
Optional end-user identity for a tenant secret or sandbox key. It must agree with body externalUserId when both are present. Case-sensitive immutable ID in the tenant namespace. Prefer an identity-provider subject, not an email address.
1 - 200^[A-Za-z0-9][A-Za-z0-9._:@/-]{0,199}$Body
Preferred and excluded values cannot overlap. minLayoverMinutes cannot exceed maxLayoverMinutes. Defaults are selected from optimize when optional depth controls are absent.
IATA code or place name. Three-letter codes are normalized to uppercase.
2 - 120Must differ from origin.
2 - 120Real calendar date in YYYY-MM-DD form.
Optional return date on or after departureDate.
1 <= x <= 90 <= x <= 8Cannot exceed adults. Total travelers cannot exceed nine.
0 <= x <= 4economy, premium_economy, business, first ^[A-Za-z]{3}$Cost favors fewer inexpensive sources, quality increases depth, and context favors compact agent-readable output.
3cost, quality, context 201 - 100201 - 100201 - 100201 - 1000 <= x <= 30 <= x <= 14400 <= x <= 288030 <= x <= 10080Maximum itinerary price in currency.
x <= 10000000^(?:[01]\d|2[0-3]):[0-5]\d$^(?:[01]\d|2[0-3]):[0-5]\d$^(?:[01]\d|2[0-3]):[0-5]\d$^(?:[01]\d|2[0-3]):[0-5]\d$1 <= x <= 501 <= x <= 11Optional explicit provider selection, still narrowed by credential, catalog, availability, and request compatibility.
11aircanada, duffel, stabletravel, almosafer, flightconnections, justfly, kayak_hk, skyscanner, skiplagged, trip, united Aggregate no-dispatch ceiling for all selected child calls, in account credits.
^(?:0*[1-9]\d*)(?:\.\d{1,6})?$|^0*\.0*[1-9]\d{0,5}$Case-sensitive immutable ID in the tenant namespace. Prefer an identity-provider subject, not an email address.
1 - 200^[A-Za-z0-9][A-Za-z0-9._:@/-]{0,199}$Optional JSON attribution copied to child calls.
Response
Normalized, ranked flight search with provider outcomes and aggregate billing
Preferred and excluded values cannot overlap. minLayoverMinutes cannot exceed maxLayoverMinutes. Defaults are selected from optimize when optional depth controls are absent.
Show child attributes
Show child attributes
cost, quality, context True when at least one selected provider did not produce a complete successful result.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
x >= 0Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes