FlightRatesAPI v2.1.0
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
The FlightRatesAPI is the premier real-time fare intelligence API for the air travel industry. Every day, our API is trusted by airlines worldwide to provide billions of rows of up-to-date and highly accurate competitive pricing data in real-time. With its flexibility and scalability, the FlightRatesAPI is the go- to solution for accessing comprehensive fare information for any airline. It covers essential details such as Origin & Destination, Fare Booking Code, Schedules, Taxes, Fare Rules, and Point of Sale. Users can customize delivery intervals to precisely meet their specific requirements.
The FlightRatesAPI endpoints may broadly be categorized into the following modules:
- User - Gaining Access to the API
- References - Get data related to various dependencies
- Entity Information - Search for Sources available for data collection
- Flight rates Information - Consume the provided Flightrates data
- Hooks - Define web hooks for direct data delivery
- Shops - A Flight Shop is essentially a well-defined template of ODs, Sources, and other information for requesting data collection
- Real Time Execution - Enables users to trigger a real-time shop
- Historical Rates - Retrieve past data regarding the value or rate of a metric over time.
- Schedules - Manage data delivery schedules
Web: Aggregate Intelligence Inc.
Authentication
Authorization
Every request sent to the Reputation API must be authenticated with an access token. You can obtain an access token when you log-in using the credentials provided to you in your ReputationAPI packet. An access token is valid for 24 hours from the time it is generated.
The access token must be appended to the 'Authorization Header' as depicted in the example below:
If 'A90324XXZUZUgpO0dd6npHcM83CJ...' is your access token, every request must contain the following header:
Authorization: Bearer A90324XXZUZUgpO0dd6npHcM83CJ...
Usage Workflow
Base URLs:
- API Key (Bearer)
- Parameter Name: Authorization, in: header.
User
User Login
Code samples
# You can also use wget
curl -X POST /api/v1/login \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST /api/v1/login HTTP/1.1
Content-Type: application/json
Accept: application/json
const inputBody = '{
"handle": "myuser",
"password": "supersecret"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v1/login',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post '/api/v1/login',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/api/v1/login', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v1/login', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/login");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "/api/v1/login", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /login
User Login
The POST /login endpoint is used to authenticate and log in a user. It allows users to provide their credentials and obtain an access token, which can be used to authorize subsequent requests to protected resources within the system.
The access token is valid for 24 hours from the time of issue.
Mandatory Fields: "handle", "password"
Body parameter
{
"handle": "myuser",
"password": "supersecret"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | userReq | true | none |
Example responses
200 Response
{
"error": false,
"handle": "myuser",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY2Y2MxZWYyYjhjYTk5MTE3MTdkYmQ2YyIsIl9pZCI6IjY2Y2MxZWYyYjhjYTk5MTE3MTdkYmQ2YyIsImZ1bGxOYW1lIjoiZGV2IHRlYW0iLCJlbWFpbCI6ImRldnRlYW1AZ2dyZWdhdGVpbnRlbGxpZ2VuY2UuaW4iLCJwaG9uZSI6IjkzNDU5MDI0ODkiLCJ1c2VyTmFtZSI6ImRldnRlYW0iLCJ2YWxpZFRpbGwiOiIyMDI5LTAzLTIwVDAwOjAwOjAwLjAwMFoiLCJpYXQiOjE3Mjc5MzU5NDcsImV4cCI6MTcyODAyMjM0N30.73J6U7UR6uLXlux_DbEp2jkkkmenOLahr7i7c0xCzyg"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | userResp |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
User Details
Code samples
# You can also use wget
curl -X GET /api/v1/profile \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
GET /api/v1/profile HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/profile',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.get '/api/v1/profile',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.get('/api/v1/profile', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/profile', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/profile");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/profile", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /profile
User Details
The GET /user endpoint retrieves the user's account details, including the number of calls consumed so far for the current month.
Example responses
200 Response
{
"error": false,
"user": {
"name": {
"first": "Flight",
"last": "Rates",
"full": "Flight Rates"
},
"_id": "6507eacf83f9b7f200e541ab",
"_primaryAirline": "601bb896f764ad17a4b71e74",
"targetSite": "http://localhost:3000/targetsite",
"isTableau": true,
"userName": "user@flightrates.com",
"email": "user@flightrates.com",
"isActiveStatus": true,
"customerType": "demo",
"validTill": "2025-03-20T00:00:00.000Z",
"id": "6507eacf83f9b7f200e541ab"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | userDetailsResp |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
References
Get Airlines
Code samples
# You can also use wget
curl -X GET /api/v1/references/airlines \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
GET /api/v1/references/airlines HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/references/airlines',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.get '/api/v1/references/airlines',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.get('/api/v1/references/airlines', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/references/airlines', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/references/airlines");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/references/airlines", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /references/airlines
The list of all the Airlines as available.
The GET /references/airlines endpoint is used to retrieve a complete list of airlines available in our system. It provides information about each airline, including its unique identifier, source name, display name, airline code and active status.
The GET request to retrieve the airline data does not require any parameters. Simply make a GET request to the endpoint mentioned above.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
page | query | integer | false | The page number to retrieve. |
size | query | integer | false | The number of items to be displayed per page. |
Example responses
200 Response
{
"error": false,
"airlines": [
{
"_id": "64af967793f9120fb0de17e2",
"sourceName": "TAR Aerolíneas Airline",
"displayName": "TAR Aerolíneas Airline",
"code": 623,
"isActiveStatus": true,
"id": "63ff432ce2276fc08e64f794"
}
],
"totalData": 10282,
"totalPages": 10282,
"page": 1,
"size": 1
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | airlinesResp |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
Get Airports
Code samples
# You can also use wget
curl -X GET /api/v1/references/airports \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
GET /api/v1/references/airports HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/references/airports',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.get '/api/v1/references/airports',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.get('/api/v1/references/airports', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/references/airports', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/references/airports");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/references/airports", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /references/airports
The list of all the Airports
This API method enables you to retrieve a comprehensive list of data about all airports in our database, including the airport name, airport IATA code and the city and country where each airport is located.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
page | query | integer | false | The page number to retrieve. |
size | query | integer | false | The number of items to be displayed per page. |
codes | query | string | false | The code(s) you want to search for. |
Example responses
200 Response
{
"error": false,
"airports": [
{
"_id": "64ae8d14d06e77f95bff13bc",
"airportName": "Netaji Subhas Chandra Bose International Airport",
"city": "Kolkata",
"airportCode": "CCU",
"isActiveStatus": true,
"id": "63ff432ce2276fc08e64f794"
}
],
"totalData": 10282,
"totalPages": 10282,
"page": 1,
"size": 1
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | airportsResp |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
Get Cabin Classes
Code samples
# You can also use wget
curl -X GET /api/v1/references/cabinclasses \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
GET /api/v1/references/cabinclasses HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/references/cabinclasses',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.get '/api/v1/references/cabinclasses',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.get('/api/v1/references/cabinclasses', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/references/cabinclasses', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/references/cabinclasses");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/references/cabinclasses", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /references/cabinclasses
List of all the Cabin Classes.
Cabin classes indicate the cabin name you want to choose to make a request for.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
page | query | integer | false | The page number to retrieve. |
size | query | integer | false | The number of items to be displayed per page. |
Example responses
200 Response
{
"error": false,
"cabinclasses": [
{
"_id": "6013a6abf553c71d4dfbe92d",
"code": 3,
"name": "First Class",
"isActiveStatus": true,
"id": "63ff432ce2276fc08e64f794"
}
],
"totalData": 10282,
"totalPages": 10282,
"page": 1,
"size": 1
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | cabinclassResp |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
Get POSes
Code samples
# You can also use wget
curl -X GET /api/v1/references/poses \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
GET /api/v1/references/poses HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/references/poses',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.get '/api/v1/references/poses',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.get('/api/v1/references/poses', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/references/poses', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/references/poses");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/references/poses", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /references/poses
List of POS(s)
POS (Point of sale) is a region or a country from which the fares are to be extracted from. For example an airline based out of Europe may be interested in European POS to see the same prices as their European customers.
The GET /references/poses API endpoint provides a complete list of points of sale (POS) available in our system. Users can access this endpoint to obtain the complete list of country, city and code of all POS available in our system.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
page | query | integer | false | The page number to retrieve. |
size | query | integer | false | The number of items to be displayed per page. |
Example responses
200 Response
{
"error": false,
"posses": [
{
"_id": "64007076257289970c6db570",
"posCode": 0,
"code": "POS/0",
"region": "Asia",
"countryCode": "IN",
"countryName": "India",
"isActiveStatus": true,
"id": "63ff432ce2276fc08e64f794"
}
],
"totalData": 10282,
"totalPages": 10282,
"page": 1,
"size": 1
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | posResp |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
Get Currencies
Code samples
# You can also use wget
curl -X GET /api/v1/references/currencies \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
GET /api/v1/references/currencies HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/references/currencies',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.get '/api/v1/references/currencies',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.get('/api/v1/references/currencies', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/references/currencies', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/references/currencies");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/references/currencies", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /references/currencies
List of the Currencies
Currency refers to the currency the fare is to be extracted from. The API endpoint provides a list of all available in our database currencies. Users can access this endpoint to identify and retrieve the complete list of currencies and their codes offered in our database.
The GET request to retrieve the currencies data does not require any parameters. Simply make a GET request to the endpoint mentioned above.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
page | query | integer | false | The page number to retrieve. |
size | query | integer | false | The number of items to be displayed per page. |
Example responses
200 Response
{
"error": false,
"currencies": [
{
"_id": "64ae7d3ed06e77f95bff04e7",
"iso": "DZD",
"symbol": "DZD",
"isActiveStatus": true,
"id": "63ff432ce2276fc08e64f794"
}
],
"totalData": 10282,
"totalPages": 10282,
"page": 1,
"size": 1
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | currencyResp |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
Get Timezones
Code samples
# You can also use wget
curl -X GET /api/v1/references/timezones \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
GET /api/v1/references/timezones HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/references/timezones',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.get '/api/v1/references/timezones',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.get('/api/v1/references/timezones', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/references/timezones', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/references/timezones");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/references/timezones", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /references/timezones
List of Timezones
Timezone refers to the local time of departure or arrival. The API endpoint provides a list of all available in our database time zones and countries. Users can access this endpoint to identify and retrieve the complete list of timezones offered in our database.
The GET request to retrieve the timezones data does not require any parameters. Simply make a GET request to the endpoint mentioned above.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
page | query | integer | false | The page number to retrieve. |
size | query | integer | false | The number of items to be displayed per page. |
Example responses
200 Response
{
"error": false,
"timezones": [
{
"_id": "64ae7e58d06e77f95bff061e",
"timezone": "Asia/Kolkata",
"countryCode": "IST",
"countryName": "India",
"gmtOffSet": "5:30",
"abbr": "IST",
"isActiveStatus": true,
"id": "63ff432ce2276fc08e64f794"
}
],
"totalData": 10282,
"totalPages": 10282,
"page": 1,
"size": 1
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | timezonesResp |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
Get Sources
Code samples
# You can also use wget
curl -X GET /api/v1/references/sources \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
GET /api/v1/references/sources HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/references/sources',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.get '/api/v1/references/sources',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.get('/api/v1/references/sources', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/references/sources', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/references/sources");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/references/sources", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /references/sources
List of all the Sources
This endpoint returns a collection of websites/sources from which the data is obtained. It also has the details such as code, and channel type
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
page | query | integer | false | The page number to retrieve. |
size | query | integer | false | The number of items to be displayed per page. |
Example responses
200 Response
{
"error": false,
"sourceResp": [
{
"_id": "64ae65cfd06e77f95bfefdec",
"source": "Gulf Air",
"code": "117",
"status": 1,
"channel": "Direct",
"vertical": "flightrates",
"isDeleted": false,
"isActiveStatus": true,
"userAirlineCode": 13
}
],
"totalData": 10282,
"totalPages": 10282,
"page": 1,
"size": 1
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | sourceResp |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
Hooks
Create Hook
Code samples
# You can also use wget
curl -X POST /api/v1/hook \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
POST /api/v1/hook HTTP/1.1
Content-Type: application/json
Accept: application/json
const inputBody = '{
"endPoint": "//my-hook",
"authType": "jwt",
"userId": "63fda531bde67155fc46fb4",
"pwdTxt": "uuxx",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6I",
"hookType": "dbs",
"isActiveStatus": true,
"_shop": "63fdc414cccc3592d31b3ac8"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/hook',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.post '/api/v1/hook',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.post('/api/v1/hook', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v1/hook', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/hook");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "/api/v1/hook", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /hook
Create a new Hook
Hooks or Webhooks are user-defined HTTP callbacks or endpoints that allow applications to send real-time notifications or data to a specified URL when a particular event or trigger occurs. By making a POST request to this endpoint, users can provide the necessary parameters and details in the request body to define a new hook. This includes information such as the endpoint, authtype, userId and any other relevant parameters or configurations.
Mandatory Fields - "endPoint", "hookType", "isActiveStatus" and "_shop"
Body parameter
{
"endPoint": "//my-hook",
"authType": "jwt",
"userId": "63fda531bde67155fc46fb4",
"pwdTxt": "uuxx",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6I",
"hookType": "dbs",
"isActiveStatus": true,
"_shop": "63fdc414cccc3592d31b3ac8"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | hooksPostReq | true | none |
Example responses
200 Response
{
"error": false,
"hook": {
"_user": "63fda531bde67155fc46fb41",
"userName": "user@flightrates.com",
"endPoint": "//my-hook",
"authType": "jwt",
"userId": "63fda531bde67155fc46fb4",
"pwdTxt": "demo1",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6I",
"hookType": "dbs",
"isActiveStatus": true,
"_shop": "63fdc414cccc3592d31b3ac8",
"vertical": "flightrates",
"isCustomerCreated": true,
"id": "63ff246fb2482db1c660e310"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | hooksPostResp |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
Get Hooks
Code samples
# You can also use wget
curl -X GET /api/v1/hooks \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
GET /api/v1/hooks HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/hooks',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.get '/api/v1/hooks',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.get('/api/v1/hooks', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/hooks', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/hooks");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/hooks", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /hooks
List of all Hooks
Hooks or Webhooks are user-defined HTTP callbacks or endpoints that allow applications to send real-time notifications or data to a specified URL when a particular event or trigger occurs. This API provides a list and details of all user hooks. Users can access this endpoint to obtain details about each hook, including the hook username, userid, authtype and other relevant information.
Upon a successful request, the system will respond with a JSON object containing all information of all hooks.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
page | query | integer | false | The page number to retrieve. |
size | query | integer | false | The number of items to be displayed per page. |
Example responses
200 Response
{
"error": false,
"hooks": [
{
"_id": "63ff246fb2482db1c660e310",
"_user": "63fda531bde67155fc46fb41",
"userName": "user@flightrates.com",
"endPoint": "//latest",
"authType": "Personal",
"userId": "RM123",
"pwdTxt": "uuxx",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6I",
"hookType": "dbs",
"isActiveStatus": true,
"_shop": "63fdc414cccc3592d31b3ac8",
"vertical": "flightrates",
"isCustomerCreated": true,
"id": "63ff246fb2482db1c660e310"
}
],
"totalData": 1,
"totalPages": 1,
"page": 1,
"size": 1
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | hooksFindResp |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
Get Hook
Code samples
# You can also use wget
curl -X GET /api/v1/hook/{hooksId} \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
GET /api/v1/hook/{hooksId} HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/hook/{hooksId}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.get '/api/v1/hook/{hooksId}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.get('/api/v1/hook/{hooksId}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/hook/{hooksId}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/hook/{hooksId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/hook/{hooksId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /hook/{hooksId}
Get a single Hook
This API provides details of a specific user hook. By providing the hook ID in the request, users can obtain details about the hook, including the hook username, userid, authtype and other relevant information.
Mandatory Fields - "hooksId"
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
hooksId | path | string(string) | true | none |
Example responses
200 Response
{
"error": false,
"hook": {
"_id": "63ff246fb2482db1c660e310",
"_user": "63fda531bde67155fc46fb41",
"userName": "user@flightrates.com",
"endPoint": "//my-hook",
"authType": "jwt",
"userId": "63fda531bde67155fc46fb4",
"pwdTxt": "demo1",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6I",
"hookType": "dbs",
"isActiveStatus": true,
"_shop": "63fdc414cccc3592d31b3ac8",
"vertical": "flightrates",
"isCustomerCreated": true,
"id": "63ff246fb2482db1c660e310"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | hooksGetResp |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
404 | Not Found | Not found. | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
Delete Hook
Code samples
# You can also use wget
curl -X DELETE /api/v1/hook/{hooksId} \
-H 'Authorization: API_KEY'
DELETE /api/v1/hook/{hooksId} HTTP/1.1
const headers = {
'Authorization':'API_KEY'
};
fetch('/api/v1/hook/{hooksId}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Authorization' => 'API_KEY'
}
result = RestClient.delete '/api/v1/hook/{hooksId}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Authorization': 'API_KEY'
}
r = requests.delete('/api/v1/hook/{hooksId}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','/api/v1/hook/{hooksId}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/hook/{hooksId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "/api/v1/hook/{hooksId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /hook/{hooksId}
Delete a single Hook
By using this endpoint the user can delete a single hook.
Mandatory Fields - "hooksId"
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
hooksId | path | string(string) | true | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | Ok, data deleted | None |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
404 | Not Found | Not found. | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
Shops
Create Shop
Code samples
# You can also use wget
curl -X POST /api/v1/shop \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
POST /api/v1/shop HTTP/1.1
Content-Type: application/json
Accept: application/json
const inputBody = '{
"_OD": [
{
"_flyFrom": "62b943e4dd59913b61a6b15b",
"_flyTo": "62b943e4dd59913b61a6b15c"
}
],
"_sources": [
"6239aec26c3c588d8f64ecfc"
],
"_alternateSources": [
"61515e50b77f75890e8acbaf"
],
"_cabinClasses": [
"6013a6abf553c71d4dfbe92d"
],
"_carriers": [
"6013a6abf553c71d4dfbe92d"
],
"isRoundTrip": false,
"los": 1,
"horizons": [
"0",
"3-10",
"02/05/2025",
"10/06/2025-10/08/2025"
],
"pax": {
"adults": 1,
"infants": 0,
"children": 0
},
"noOfStops": "1",
"duration": {
"hour": 40,
"minute": 30
},
"fareType": "Doctors",
"startDate": "2019-08-24",
"_pos": "62a2e3ca581567e3cd67ce1a",
"_currency": "5fa104806304832acf9c67f5",
"shopName": "Flightshop name",
"deliveryMode": [
"db"
],
"isActiveStatus": true
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/shop',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.post '/api/v1/shop',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.post('/api/v1/shop', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v1/shop', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/shop");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "/api/v1/shop", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /shop
Create a new Shop
A shop is a set of specific parameters that form a request to extract fares. A shop will have parameters like route, source, horizon of days to extract, etc. The user gets to include the requirement details of “what” and “how” the shopping to be done.
This API method serves the purpose of adding a new flight shop to the user's system. It offers a convenient way to specify the required parameters. Upon a successful request, the system will create the new shop and provide a confirmation response with shops unique ID.
Mandatory Fields:
- _OD: Origin-Destination pairs for the shop. The value should be in the format origin code followed by destination code (e.g., JFKLAX|LAXJFK). Multiple pairs should be separated by |.
- _sources: The ID of the source associated with the shop. Multiple sources should be separated by | (e.g., 64ae65cfd06e77f95bfefd8d|64ae95cfd06e77f95bfefd8d).
- _alternateSources: The ID of any alternate source for the shop. Multiple alternate sources should be separated by |.
- _cabinClasses: The ID of the cabin classes associated with the shop. Multiple cabin classes should be separated by |.
- _carriers: The ID of the carriers associated with the shop. Multiple carriers should be separated by |.
- isRoundTrip: A boolean value indicating whether the trip is round-trip (true) or not (false).
- los: Length of stay for the trip. Should be a number.
- horizons: Specifies the time frame for fare extraction. Can include a date, date range, or number range, separated by |.
- pax: The number of adult passengers. Should be a valid number.
- noOfStops: Number of stops for the flight. Should be one of 0, 1, 2, 3, or 3+.
- fareType: Type of fare. Options include Regular, Defence, Doctors, Senior Citizen, Students.
- duration_hour: The duration of the flight in hours.
- duration_minute: The duration of the flight in minutes.
- startDate: The start date of the shop's activity in the format YYYY-MM-DD.
- _pos: The point of sale associated with the shop. Should be active.
- _currency: The currency to be used for fare extraction. Should be active.
- shopName: The name of the shop. Should be a valid string and must be unique.
- deliveryMode: The delivery mode for the shop’s services. Valid options include Webhook and db, and multiple modes should be separated by |.
- isActiveStatus: Boolean value indicating whether the shop is active (true or false).
This format ensures all necessary parameters are covered with detailed explanations to facilitate a new shop creation via the API.
Body parameter
{
"_OD": [
{
"_flyFrom": "62b943e4dd59913b61a6b15b",
"_flyTo": "62b943e4dd59913b61a6b15c"
}
],
"_sources": [
"6239aec26c3c588d8f64ecfc"
],
"_alternateSources": [
"61515e50b77f75890e8acbaf"
],
"_cabinClasses": [
"6013a6abf553c71d4dfbe92d"
],
"_carriers": [
"6013a6abf553c71d4dfbe92d"
],
"isRoundTrip": false,
"los": 1,
"horizons": [
"0",
"3-10",
"02/05/2025",
"10/06/2025-10/08/2025"
],
"pax": {
"adults": 1,
"infants": 0,
"children": 0
},
"noOfStops": "1",
"duration": {
"hour": 40,
"minute": 30
},
"fareType": "Doctors",
"startDate": "2019-08-24",
"_pos": "62a2e3ca581567e3cd67ce1a",
"_currency": "5fa104806304832acf9c67f5",
"shopName": "Flightshop name",
"deliveryMode": [
"db"
],
"isActiveStatus": true
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | shopsPostReq | true | none |
Example responses
200 Response
{
"error": false,
"shop": {
"_OD": [
{
"OD": "MAKZIA",
"_flyFrom": "62b943e4dd59913b61a6b15b",
"_flyTo": "62b943e4dd59913b61a6b15c"
}
],
"_sources": [
"6239aec26c3c588d8f64ecfc"
],
"_alternateSources": [
"61515e50b77f75890e8acbaf"
],
"_cabinClasses": [
"6013a6abf553c71d4dfbe92d"
],
"_carriers": [
"6013a6abf553c71d4dfbe92d"
],
"isRoundTrip": true,
"horizons": [
"0",
"3-10",
"02/05/2025",
"10/06/2025-10/08/2025"
],
"pax": {
"adults": 1,
"children": 0,
"infants": 0
},
"duration": {
"hour": 30,
"minute": 35
},
"fareType": "Doctors",
"noOfStops": "1",
"startDate": "2019-08-24",
"_pos": "62a2e3ca581567e3cd67ce1a",
"_currency": "5fa104806304832acf9c67f5",
"shopName": "Flightshop name",
"_user": "6411b27b79d2c995fc689c4b",
"userName": "user@flightrates.com",
"vertical": "flightrates",
"posName": "POS/123",
"los": 1,
"deliveryMode": [
"db"
],
"isActiveStatus": true,
"_id": "64b7c6c54c5f10de6f433ca6",
"isCustomerCreated": true,
"createdAt": "2023-03-10T06:30:25.288Z",
"id": "640ace815353bdb6454e191b"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | shopsPostResp |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
Bulk Shop Upload
Code samples
# You can also use wget
curl -X POST /api/v1/shops/bulk \
-H 'Content-Type: multipart/form-data' \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
POST /api/v1/shops/bulk HTTP/1.1
Content-Type: multipart/form-data
Accept: application/json
const inputBody = '{
"file": "string"
}';
const headers = {
'Content-Type':'multipart/form-data',
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/shops/bulk',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.post '/api/v1/shops/bulk',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'multipart/form-data',
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.post('/api/v1/shops/bulk', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v1/shops/bulk', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/shops/bulk");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"multipart/form-data"},
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "/api/v1/shops/bulk", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /shops/bulk
Bulk Shop upload
The bulk shops endpoint enables users to create multiple shops at once. The sample data and template for the bulk upload can be downloaded from the “GET /shops/bulk/sample” endpoint.
The CSV file should include the following headers: - _sources: The ID of the source associated with the shop. If more the one should be separated by | (64ae65cfd06e77f95bfefd8d|64ae95cfd06e77f95bfefd8d). - _alternateSources: The ID of the source associated with the shop. If more the one should be separated by | (64ae65cfd06e77f95bfefd8d|64ae95cfd06e77f95bfefd8d). - isRoundTrip: Boolean value indicating whether it's round-trip or not (true or false). - los: Length of stay, must be a number. - _cabinClasses: The ID of the cabinclasses associated with the shop. If more the one should be separated by | (64ae65cfd06e77f95bfefd8d|64ae95cfd06e77f95bfefd8d). - Number of adult passengers. - pax_children: Number of children passengers. - pax_infants: Number of infant passengers. - pos: Should be active. - _currency: Should be active. - OD: Origin-Destination pairs for the shop, separated by |. Each pair should be in the format: origin code followed by destination code (e.g., JFKLAX). - _carriers: The ID of the sources associated with the shop. If more the one should be separated by | (64ae65cfd06e77f95bfefd8d|64ae95cfd06e77f95bfefd8d) and the channel should be Direct only. - isActiveStatus: Boolean value indicating whether the shop is active (true or false). - horizons: Values containing date, date range, number, or number range, separated by |. - noOfStops: Number of stops for the flight. Should be one of 0, 1, 2, 3, or 3+. - fareType: Type of fare. Should be one of the following options: Regular, Defence, Doctors, Senior Citizen, Students. - duration_hour: Duration in hours. - duration_minute: Duration in minutes. - startDate: The start date of the shop's activity (format: YYYY-MM-DD). - shopName: The name of the shop. Should be valid string and should be unique. - deliveryMode: Delivery mode of the shop's services. Should be a valid string, and if more than one mode, they should be separated by | (Webhook|db).
Body parameter
file: string
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» file | body | string(binary) | true | The CSV file to upload. |
Example responses
200 Response
{
"error": false,
"statusCode": 200,
"msg": "Successfully Uploaded !!",
"shopName": [
"Flightshopname1",
"Flightshopname2",
"Flightshopname3"
],
"errorLog": []
}
Not Found
{
"error": true,
"statusCode": 404,
"message": "User not found or inactive."
}
{
"error": true,
"statusCode": 404,
"message": "No shop found to be created!"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | Inline |
400 | Bad Request | Bad Request | Inline |
401 | Unauthorized | Unauthorized | Inline |
404 | Not Found | Not Found | Inline |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» error | boolean | false | none | none |
» statusCode | integer | false | none | none |
» msg | string | false | none | none |
» shopName | [string] | false | none | none |
» errorLog | [string] | false | none | none |
Status Code 400
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» error | boolean | false | none | none |
» statusCode | integer | false | none | none |
» msg | string | false | none | none |
» errorLog | [string] | false | none | none |
Status Code 401
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» error | string | false | none | none |
» message | string | false | none | none |
Status Code 404
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» error | boolean | false | none | none |
» statusCode | integer | false | none | none |
» message | string | false | none | none |
Status Code 500
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» error | string | false | none | none |
» message | string | false | none | none |
Status Shop
Code samples
# You can also use wget
curl -X GET /api/v1/shop/status/{shopId} \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
GET /api/v1/shop/status/{shopId} HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/shop/status/{shopId}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.get '/api/v1/shop/status/{shopId}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.get('/api/v1/shop/status/{shopId}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/shop/status/{shopId}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/shop/status/{shopId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/shop/status/{shopId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /shop/status/{shopId}
Get the status of a single Shop
By providing the shop ID in the request, this API endpoint allows users to retrieve the status of a specific flight shop, whether the shop is active or not. Only the active shops are included for the extraction and delivery.
Mandatory Fields - "shopId"
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
shopId | path | string(string) | true | Shop Id |
Example responses
200 Response
{
"error": false,
"status": "IN_PROGRESS"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | shopStatusRes |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
404 | Not Found | No data found. | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
Get Shops
Code samples
# You can also use wget
curl -X GET /api/v1/shops \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
GET /api/v1/shops HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/shops',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.get '/api/v1/shops',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.get('/api/v1/shops', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/shops', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/shops");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/shops", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /shops
List of all the Shops
This API endpoint returns a list of all active shops in the account. No parameters are required for the GET request to retrieve the shop list. Users can specify the number of items per page in the request URL, and the page count parameter allows navigation through multiple pages to access the complete list of shops.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
page | query | integer | false | The page number to retrieve. |
size | query | integer | false | The number of items to be displayed per page. |
Example responses
200 Response
{
"error": false,
"shops": [
{
"_OD": [
{
"OD": "YXUYIB",
"_flyFrom": "62b943e4dd59913b61a6b15b",
"_flyTo": "62b943e4dd59913b61a6b15c"
}
],
"_sources": [
"6239aec26c3c588d8f64ecfc"
],
"_alternateSources": [
"61515e50b77f75890e8acbaf"
],
"_cabinClasses": [
"6013a6abf553c71d4dfbe92d"
],
"_carriers": [
"6013a6abf553c71d4dfbe92d"
],
"isRoundTrip": true,
"horizons": [
"0",
"3-10",
"02/05/2025",
"10/06/2025-10/08/2025"
],
"pax": {
"adults": 1,
"infants": 0,
"children": 0
},
"noOfStops": "1",
"los": 1,
"duration": {
"hour": 30,
"minute": 33
},
"fareType": "Regular",
"startDate": "2019-08-24",
"_pos": "62a2e3ca581567e3cd67ce1a",
"_currency": "5fa104806304832acf9c67f5",
"shopName": "Flightshop name",
"_user": "6411b27b79d2c995fc689c4b",
"userName": "user@flightrates.com",
"vertical": "flightrates",
"posName": "POS/123",
"isCustomerCreated": true,
"deliveryMode": [
"db"
],
"isActiveStatus": true,
"_id": "66fbd773cfa2fa105752dc26",
"createdAt": "2023-03-10T06:30:25.288Z",
"updatedAt": "2023-03-10T06:30:25.288Z",
"id": "640ace815353bdb6454e191b"
}
],
"totalData": 3,
"totalPages": 2,
"page": 1,
"size": 2
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | shopsFindResp |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
Get Shop by name
Code samples
# You can also use wget
curl -X GET /api/v1/shop/name/{shopName} \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
GET /api/v1/shop/name/{shopName} HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/shop/name/{shopName}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.get '/api/v1/shop/name/{shopName}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.get('/api/v1/shop/name/{shopName}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/shop/name/{shopName}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/shop/name/{shopName}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/shop/name/{shopName}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /shop/name/{shopName}
Get a list of shops by name
The API endpoint allows the user to search a shop and its details using the shop name.
Mandatory Fields - "shopName"
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
page | query | integer | false | The page number to retrieve. |
size | query | integer | false | The number of items to be displayed per page. |
shopName | path | string(string) | true | The Name of the Shop |
Example responses
200 Response
{
"error": false,
"shops": [
{
"_OD": [
{
"OD": "YXUYIB",
"_flyFrom": "62b943e4dd59913b61a6b15b",
"_flyTo": "62b943e4dd59913b61a6b15c"
}
],
"_sources": [
"6239aec26c3c588d8f64ecfc"
],
"_alternateSources": [
"61515e50b77f75890e8acbaf"
],
"_cabinClasses": [
"6013a6abf553c71d4dfbe92d"
],
"_carriers": [
"6013a6abf553c71d4dfbe92d"
],
"isRoundTrip": true,
"horizons": [
"0",
"3-10",
"02/05/2025",
"10/06/2025-10/08/2025"
],
"pax": {
"adults": 1,
"infants": 0,
"children": 0
},
"noOfStops": "1",
"los": 1,
"duration": {
"hour": 30,
"minute": 33
},
"fareType": "Regular",
"startDate": "2019-08-24",
"_pos": "62a2e3ca581567e3cd67ce1a",
"_currency": "5fa104806304832acf9c67f5",
"shopName": "Flightshop name",
"_user": "6411b27b79d2c995fc689c4b",
"userName": "user@flightrates.com",
"vertical": "flightrates",
"posName": "POS/123",
"isCustomerCreated": true,
"deliveryMode": [
"db"
],
"isActiveStatus": true,
"_id": "66fbd773cfa2fa105752dc26",
"createdAt": "2023-03-10T06:30:25.288Z",
"updatedAt": "2023-03-10T06:30:25.288Z",
"id": "640ace815353bdb6454e191b"
}
],
"totalData": 3,
"totalPages": 2,
"page": 1,
"size": 2
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | shopsFindResp |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
Bulk Shop Sample
Code samples
# You can also use wget
curl -X GET /api/v1/shops/bulk/sample \
-H 'Accept: text/csv' \
-H 'Authorization: API_KEY'
GET /api/v1/shops/bulk/sample HTTP/1.1
Accept: text/csv
const headers = {
'Accept':'text/csv',
'Authorization':'API_KEY'
};
fetch('/api/v1/shops/bulk/sample',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'text/csv',
'Authorization' => 'API_KEY'
}
result = RestClient.get '/api/v1/shops/bulk/sample',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'text/csv',
'Authorization': 'API_KEY'
}
r = requests.get('/api/v1/shops/bulk/sample', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'text/csv',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/shops/bulk/sample', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/shops/bulk/sample");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"text/csv"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/shops/bulk/sample", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /shops/bulk/sample
Sample for Bulk Shop Upload
This endpoint provides a sample CSV file for bulk shop uploads. Users can download the sample file to understand the required structure and fields needed for a successful bulk upload of shop data.
Example responses
A successful response indicating the sample file is available for download.
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | A successful response indicating the sample file is available for download. | string |
400 | Bad Request | Request data failed validation(s) | None |
404 | Not Found | No shop was found by userid: _id. | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | An error occurred while fetching shops. | None |
Response Headers
Status | Header | Type | Format | Description |
---|---|---|---|---|
200 | Content-Disposition | string | Indicates the file name of the CSV download. | |
200 | Content-Type | string | The MIME type of the returned file. |
Bulk Shop Download
Code samples
# You can also use wget
curl -X GET /api/v1/shops/download \
-H 'Accept: text/csv' \
-H 'Authorization: API_KEY'
GET /api/v1/shops/download HTTP/1.1
Accept: text/csv
const headers = {
'Accept':'text/csv',
'Authorization':'API_KEY'
};
fetch('/api/v1/shops/download',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'text/csv',
'Authorization' => 'API_KEY'
}
result = RestClient.get '/api/v1/shops/download',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'text/csv',
'Authorization': 'API_KEY'
}
r = requests.get('/api/v1/shops/download', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'text/csv',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/shops/download', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/shops/download");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"text/csv"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/shops/download", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /shops/download
Bulk Shop Download
The API endpoint allows users to bulk download all the active shops and its associated details for the account in a CSV file. This file also can be used to edit the shops in bulk.
Note: Use a comma as the separator option; do not use tab as a separator option.
Example responses
A CSV file containing all shops.
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | A CSV file containing all shops. | string |
400 | Bad Request | Request data failed validation(s) | None |
404 | Not Found | No shop was found by userid: _id. | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | An error occurred while fetching shops. | None |
Response Headers
Status | Header | Type | Format | Description |
---|---|---|---|---|
200 | Content-Disposition | string | Indicates the file name of the CSV download. | |
200 | Content-Type | string | The MIME type of the returned file. |
Get Shop
Code samples
# You can also use wget
curl -X GET /api/v1/shop/{shopId} \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
GET /api/v1/shop/{shopId} HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/shop/{shopId}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.get '/api/v1/shop/{shopId}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.get('/api/v1/shop/{shopId}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/shop/{shopId}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/shop/{shopId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/shop/{shopId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /shop/{shopId}
Get a single Shop
The API endpoint provides a list of details of specific shops on your account. Users can access this endpoint to identify and retrieve the complete details of the shop. To obtain the shop details, send a GET request to the specified endpoint, replacing {shopId} in the URL with the actual ID of the shop.
Mandatory Fields - "shopId"
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
shopId | path | string(string) | true | The ID of the Shop |
Example responses
200 Response
{
"error": false,
"shop": {
"_OD": [
{
"OD": "YXZAMI",
"_flyFrom": "62b943e4dd59913b61a6b15b",
"_flyTo": "62b943e4dd59913b61a6b15c"
}
],
"_sources": [
"6239aec26c3c588d8f64ecfc"
],
"_alternateSources": [
"61515e50b77f75890e8acbaf"
],
"_cabinClasses": [
"6013a6abf553c71d4dfbe92d"
],
"horizons": [
"0",
"3-10",
"02/05/2025",
"10/06/2025-10/08/2025"
],
"_carriers": [
"6013a6abf553c71d4dfbe92d"
],
"isRoundTrip": true,
"los": 1,
"pax": {
"adults": 1,
"infants": 0,
"children": 0
},
"duration": {
"hour": 30,
"minute": 20
},
"fareType": "Regular",
"startDate": "2019-08-24",
"_pos": "62a2e3ca581567e3cd67ce1a",
"_currency": "5fa104806304832acf9c67f5",
"shopName": "Flightshop name",
"_user": "6411b27b79d2c995fc689c4b",
"userName": "user@flightrates.com",
"vertical": "flightrates",
"posName": "POS/123",
"deliveryMode": [
"db"
],
"isActiveStatus": true,
"_id": "640ace815353bdb6454e191b",
"isCustomerCreated": true,
"createdAt": "2023-03-10T06:30:25.288Z",
"updatedAt": "2023-03-10T06:30:25.288Z",
"id": "640ace815353bdb6454e191b"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | shopsGetResp |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
Update Shop
Code samples
# You can also use wget
curl -X PUT /api/v1/shop/{shopId} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
PUT /api/v1/shop/{shopId} HTTP/1.1
Content-Type: application/json
Accept: application/json
const inputBody = '{
"_OD": [
{
"OD": "YXZMAI",
"_flyFrom": "62b943e4dd59913b61a6b15b",
"_flyTo": "62b943e4dd59913b61a6b15c"
}
],
"_sources": [
"6239aec26c3c588d8f64ecfc"
],
"_alternateSources": [
"61515e50b77f75890e8acbaf"
],
"_cabinClasses": [
"6013a6abf553c71d4dfbe92d"
],
"_carriers": [
"6013a6abf553c71d4dfbe92d"
],
"isRoundTrip": false,
"los": 1,
"horizons": [
"0",
"3-10",
"02/05/2025",
"10/06/2025-10/08/2025"
],
"pax": {
"adults": 1,
"infants": 0,
"children": 0
},
"noOfStops": "1",
"duration": {
"hour": 40,
"minute": 30
},
"fareType": "Doctors",
"_pos": "62a2e3ca581567e3cd67ce1a",
"_currency": "5fa104806304832acf9c67f5",
"shopName": "Flightshop name",
"deliveryMode": [
"db"
],
"isActiveStatus": true
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/shop/{shopId}',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.put '/api/v1/shop/{shopId}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.put('/api/v1/shop/{shopId}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PUT','/api/v1/shop/{shopId}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/shop/{shopId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "/api/v1/shop/{shopId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /shop/{shopId}
Update the existing Shop
This API endpoint allows users to edit an existing shop by providing the shop ID, one shop at a time (market removal is not supported through this method). The request body must follow the specified format.
Mandatory Fields - "shopId"
Body parameter
{
"_OD": [
{
"OD": "YXZMAI",
"_flyFrom": "62b943e4dd59913b61a6b15b",
"_flyTo": "62b943e4dd59913b61a6b15c"
}
],
"_sources": [
"6239aec26c3c588d8f64ecfc"
],
"_alternateSources": [
"61515e50b77f75890e8acbaf"
],
"_cabinClasses": [
"6013a6abf553c71d4dfbe92d"
],
"_carriers": [
"6013a6abf553c71d4dfbe92d"
],
"isRoundTrip": false,
"los": 1,
"horizons": [
"0",
"3-10",
"02/05/2025",
"10/06/2025-10/08/2025"
],
"pax": {
"adults": 1,
"infants": 0,
"children": 0
},
"noOfStops": "1",
"duration": {
"hour": 40,
"minute": 30
},
"fareType": "Doctors",
"_pos": "62a2e3ca581567e3cd67ce1a",
"_currency": "5fa104806304832acf9c67f5",
"shopName": "Flightshop name",
"deliveryMode": [
"db"
],
"isActiveStatus": true
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
shopId | path | string(string) | true | none |
body | body | shopPutReq | true | none |
Example responses
200 Response
{
"error": false,
"shop": {
"_OD": [
{
"OD": "MXAIZS",
"_flyFrom": "62b943e4dd59913b61a6b15b",
"_flyTo": "62b943e4dd59913b61a6b15c"
}
],
"_sources": [
"6239aec26c3c588d8f64ecfc"
],
"_alternateSources": [
"61515e50b77f75890e8acbaf"
],
"_cabinClasses": [
"6013a6abf553c71d4dfbe92d"
],
"_carriers": [
"6013a6abf553c71d4dfbe92d"
],
"horizons": [
"0",
"3-10",
"02/05/2025",
"10/06/2025-10/08/2025"
],
"isRoundTrip": true,
"los": 1,
"pax": {
"adults": 1,
"infants": 0,
"children": 0
},
"duration": {
"hour": 32,
"minute": 40
},
"fareType": "Regular",
"startDate": "2019-08-24",
"_pos": "62a2e3ca581567e3cd67ce1a",
"_currency": "5fa104806304832acf9c67f5",
"shopName": "Flightshop name",
"_user": "6411b27b79d2c995fc689c4b",
"userName": "user@flightrates.com",
"vertical": "flightrates",
"posName": "POS/123",
"deliveryMode": [
"db"
],
"isActiveStatus": true,
"_id": "640ace815353bdb6454e191b",
"isCustomerCreated": true,
"createdAt": "2023-03-10T06:30:25.288Z",
"updatedAt": "2023-03-10T06:30:25.288Z",
"id": "640ace815353bdb6454e191b"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | shopPutResp |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
Delete Shop
Code samples
# You can also use wget
curl -X DELETE /api/v1/shop/{shopId} \
-H 'Authorization: API_KEY'
DELETE /api/v1/shop/{shopId} HTTP/1.1
const headers = {
'Authorization':'API_KEY'
};
fetch('/api/v1/shop/{shopId}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Authorization' => 'API_KEY'
}
result = RestClient.delete '/api/v1/shop/{shopId}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Authorization': 'API_KEY'
}
r = requests.delete('/api/v1/shop/{shopId}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','/api/v1/shop/{shopId}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/shop/{shopId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "/api/v1/shop/{shopId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /shop/{shopId}
Delete the existing Shop
This API endpoint enables users to delete an existing shop by providing the shop ID. Only one shop can be deleted per request. Once deleted, the shop's status will be updated to inactive in our system.
Mandatory Fields - "shopId"
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
shopId | path | string(string) | true | The ID of the Shop |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | Ok, data deleted | None |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
404 | Not Found | Not found. | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
Bulk Shop Update
Code samples
# You can also use wget
curl -X PUT /api/v1/shops/bulkupdate \
-H 'Content-Type: multipart/form-data' \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
PUT /api/v1/shops/bulkupdate HTTP/1.1
Content-Type: multipart/form-data
Accept: application/json
const inputBody = '{
"file": "string"
}';
const headers = {
'Content-Type':'multipart/form-data',
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/shops/bulkupdate',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.put '/api/v1/shops/bulkupdate',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'multipart/form-data',
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.put('/api/v1/shops/bulkupdate', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PUT','/api/v1/shops/bulkupdate', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/shops/bulkupdate");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"multipart/form-data"},
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "/api/v1/shops/bulkupdate", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /shops/bulkupdate
Bulk Shop update
This endpoint allows users to edit multiple shops in bulk. A CSV file containing the shop details for modification can be downloaded from the “/shops/download” endpoint. Modifications should follow the provided instructions, and only the updated shop details should be uploaded to this endpoint.
The CSV file should include the following headers: - _id: The ID of the shop to identify which shop to update. - _sources: The ID of the source associated with the shop. If more the one should be separated by | (64ae65cfd06e77f95bfefd8d|64ae95cfd06e77f95bfefd8d). - _alternateSources: The ID of the source associated with the shop. If more the one should be separated by | (64ae65cfd06e77f95bfefd8d|64ae95cfd06e77f95bfefd8d). - isRoundTrip: Boolean value indicating whether it's round-trip or not (true or false). - los: Length of stay, must be a number. - _cabinClasses: The ID of the cabinclasses associated with the shop. If more the one should be separated by | (64ae65cfd06e77f95bfefd8d|64ae95cfd06e77f95bfefd8d). - pax_adult: Number of adult passengers. - pax_children: Number of children passengers. - pax_infants: Number of infant passengers. - pos: Should be active. - _currency: Should be active. - OD: Origin-Destination pairs for the shop, separated by |. Each pair should be in the format: origin code followed by destination code (e.g., JFKLAX). - _carriers: The ID of the sources associated with the shop. If more the one should be separated by | (64ae65cfd06e77f95bfefd8d|64ae95cfd06e77f95bfefd8d) and the channel should be Direct only. - isActiveStatus: Boolean value indicating whether the shop is active (true or false). - horizons: Values containing date, date range, number, or number range, separated by |. - noOfStops: Number of stops for the flight. Should be one of 0, 1, 2, 3, or 3+. - fareType: Type of fare. Should be one of the following options: Regular, Defence, Doctors, Senior Citizen, Students. - duration_hour: Duration in hours. - duration_minute: Duration in minutes. - startDate: The start date of the shop's activity (format: YYYY-MM-DD). - shopName: The name of the shop. Should be valid string and should be unique. - deliveryMode: Delivery mode of the shop's services. Should be a valid string, and if more than one mode, they should be separated by | (Webhook|db).
Body parameter
file: string
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» file | body | string(binary) | true | The CSV file to upload. |
Example responses
200 Response
{
"error": false,
"statusCode": 200,
"msg": "Shop successfully updated, shops count: 3",
"shopID": [
"1",
"2",
"3"
],
"errorLog": []
}
Not Found
{
"error": true,
"statusCode": 404,
"message": "No shop found to be updated!"
}
{
"error": true,
"statusCode": 404,
"message": "User not found or inactive."
}
{
"error": true,
"statusCode": 404,
"message": "Empty CSV!"
}
{
"error": true,
"statusCode": 404,
"message": "No data found!"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | Inline |
400 | Bad Request | Bad Request | Inline |
401 | Unauthorized | Unauthorized | Inline |
404 | Not Found | Not Found | Inline |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» error | boolean | false | none | none |
» statusCode | integer | false | none | none |
» msg | string | false | none | none |
» shopID | [string] | false | none | none |
» errorLog | [string] | false | none | none |
Status Code 400
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» error | boolean | false | none | none |
» statusCode | integer | false | none | none |
» msg | string | false | none | none |
» errorLog | [string] | false | none | none |
Status Code 401
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» error | string | false | none | none |
» message | string | false | none | none |
Status Code 404
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» error | boolean | false | none | none |
» statusCode | integer | false | none | none |
» message | string | false | none | none |
Status Code 500
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» error | string | false | none | none |
» message | string | false | none | none |
Delete Market From Shop
Code samples
# You can also use wget
curl -X DELETE /api/v1/shops/markets/remove \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
DELETE /api/v1/shops/markets/remove HTTP/1.1
Content-Type: application/json
Accept: application/json
const inputBody = '{
"shopName": "Flightshop name",
"markets": [
"CCUDEL",
"DELCCU",
"MAADEL"
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/shops/markets/remove',
{
method: 'DELETE',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.delete '/api/v1/shops/markets/remove',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.delete('/api/v1/shops/markets/remove', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','/api/v1/shops/markets/remove', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/shops/markets/remove");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "/api/v1/shops/markets/remove", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /shops/markets/remove
Remove markets from a shop
This DELETE method helps the users to remove markets or routes from a shop. One or multiple markets can be removed from the shop by using the shop ID.
Body parameter
{
"shopName": "Flightshop name",
"markets": [
"CCUDEL",
"DELCCU",
"MAADEL"
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» shopName | body | string | true | The name of the shop |
» markets | body | [string] | true | The markets to remove |
Example responses
200 Response
{
"error": false,
"message": "Markets (ODs) removed successfully."
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Markets removed successfully | Inline |
400 | Bad Request | Invalid request | Inline |
401 | Unauthorized | Authentication Failed! | None |
404 | Not Found | Shop not found or already deleted | Inline |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» error | boolean | false | none | Whether an error occurred |
» message | string | false | none | The response message |
Status Code 400
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» error | boolean | false | none | Whether an error occurred |
» message | string | false | none | The error message |
Status Code 404
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» error | boolean | false | none | Whether an error occurred |
» message | string | false | none | The error message |
Delete Multiple Shops
Code samples
# You can also use wget
curl -X DELETE /api/v1/shops/bulkdelete \
-H 'Content-Type: application/json' \
-H 'Authorization: API_KEY'
DELETE /api/v1/shops/bulkdelete HTTP/1.1
Content-Type: application/json
const inputBody = '{
"shopIds": [
"shopId1",
"shopId2",
"shopId3"
]
}';
const headers = {
'Content-Type':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/shops/bulkdelete',
{
method: 'DELETE',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.delete '/api/v1/shops/bulkdelete',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.delete('/api/v1/shops/bulkdelete', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','/api/v1/shops/bulkdelete', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/shops/bulkdelete");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "/api/v1/shops/bulkdelete", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /shops/bulkdelete
Delete multiple shops
The user can delete one or multiple shops with this endpoint. When the shops are deleted, the status of the shops will be moved to inactive in our systems.
Mandatory Fields - "shopIds"
Body parameter
{
"shopIds": [
"shopId1",
"shopId2",
"shopId3"
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» shopIds | body | [string] | false | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | Successfully deleted shops | None |
400 | Bad Request | Invalid request payload | None |
401 | Unauthorized | Unauthorized - authentication failed | None |
404 | Not Found | Not found. | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal server error | None |
Real Time Execution
Post Shop
Code samples
# You can also use wget
curl -X POST /api/v1/realtime \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
POST /api/v1/realtime HTTP/1.1
Content-Type: application/json
Accept: application/json
const inputBody = '{
"_OD": [
{
"_flyFrom": "62b943e4dd59913b61a6b15b",
"_flyTo": "62b943e4dd59913b61a6b15c"
}
],
"_source": "64ae65cfd06e77f95bfefd8c",
"_cabinClasses": [
"6013a6abf553c71d4dfbe92d"
],
"_carriers": [
"64ae65cfd06e77f95bfefe36"
],
"isRoundTrip": false,
"los": 1,
"horizons": [
"0",
"3-10",
"02/05/2025",
"10/06/2025-10/08/2025"
],
"pax": {
"adults": 1,
"infants": 0,
"children": 0
},
"noOfStops": "1",
"duration": {
"hour": 40,
"minute": 30
},
"fareType": "Doctors",
"_pos": "62a2e3ca581567e3cd67ce1a",
"_currency": "5fa104806304832acf9c67f5",
"deliveryMode": [
"db"
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/realtime',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.post '/api/v1/realtime',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.post('/api/v1/realtime', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v1/realtime', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/realtime");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "/api/v1/realtime", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /realtime
Create Real Time Shop
Real time is a method to extract fare information from sources straight after posting the method.This API endpoint enables users to trigger a real-time shop.
Mandatory Fields - "_OD", "_source", "_cabinClasses", "_carriers", "isRoundTrip", "los", "horizons", "pax", "noOfStops", "fareType", "_pos", "_currency", "deliveryMode"
Body parameter
{
"_OD": [
{
"_flyFrom": "62b943e4dd59913b61a6b15b",
"_flyTo": "62b943e4dd59913b61a6b15c"
}
],
"_source": "64ae65cfd06e77f95bfefd8c",
"_cabinClasses": [
"6013a6abf553c71d4dfbe92d"
],
"_carriers": [
"64ae65cfd06e77f95bfefe36"
],
"isRoundTrip": false,
"los": 1,
"horizons": [
"0",
"3-10",
"02/05/2025",
"10/06/2025-10/08/2025"
],
"pax": {
"adults": 1,
"infants": 0,
"children": 0
},
"noOfStops": "1",
"duration": {
"hour": 40,
"minute": 30
},
"fareType": "Doctors",
"_pos": "62a2e3ca581567e3cd67ce1a",
"_currency": "5fa104806304832acf9c67f5",
"deliveryMode": [
"db"
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | realtimePostReq | true | none |
Example responses
201 Response
{
"error": false,
"shopId": "651e6ee1f2b198a44b2cbbf8",
"timestamp": 1696493285635
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Success | realtimePostRes |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
Historical Rates
Get Historical Rates
Code samples
# You can also use wget
curl -X POST /api/v1/historical \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
POST /api/v1/historical HTTP/1.1
Content-Type: application/json
Accept: application/json
const inputBody = '{
"_shop": "653a22273761fad12e498947",
"collectedAt": "2023-11-17",
"page": 1,
"size": 100
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/historical',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.post '/api/v1/historical',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.post('/api/v1/historical', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v1/historical', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/historical");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "/api/v1/historical", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /historical
Check historical rates by shop id
"Historical rates" typically refer to past or archived data regarding the value or rate of a particular metric or variable over time. The term is often used in various contexts to describe the historical record of rates for different things..
Mandatory Fields - "_shop", "collectedAt", "page", "size"
Body parameter
{
"_shop": "653a22273761fad12e498947",
"collectedAt": "2023-11-17",
"page": 1,
"size": 100
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | historicalRateReq | true | none |
Example responses
200 Response
{
"error": false,
"flightrates": [
{
"price": 11792,
"travellers": {
"adults": 1,
"infants": 0,
"children": 1
},
"_id": "63a59bf4533a40315c201e77",
"outbound": {
"price": 171,
"baseFare": 0,
"feesAndOthers": 0,
"description": "",
"numOfStops": 2,
"metaProviderName": "",
"layover": "13:58",
"flightStatusCode": 22,
"departureDate": "2022-08-17T00:00:00.000Z",
"departureTime": "17:55",
"arrivalDate": "2022-08-18T00:00:00.000Z",
"arrivalTime": "14:36",
"totalDuration": "19:41",
"flightTime": "05:43",
"actualPrice": 0,
"actualBaseFare": 0,
"actualFeeAndOthers": 0,
"_priceClass": "6540b8df2e9e9a091aa17df7",
"priceClassName": "Standard",
"bookingClass": "Z",
"legs": [
{
"_id": "64802d78164ff91223679439",
"origin": "CUN",
"destination": "MCO",
"description": "",
"distance": 0,
"fbc": "",
"seatCount": 1,
"departureDate": "2022-08-17T00:00:00.000Z",
"departureTime": "17:55",
"arrivalDate": "2022-08-17T00:00:00.000Z",
"arrivalTime": "21:02",
"airlineShortCode": "NK",
"flightNumber": "NK-544",
"flightTime": "02:07",
"waitTime": "10:53",
"operatedBy": "",
"_airline": "6540b8df2e9e9a091aa17df7",
"airlineName": "Air Arabia",
"airlineCode": 1
}
],
"baggageDetails": "",
"promoCode": "",
"discounts": "",
"taxStatus": 22,
"_id": "64802d78164ff9122367943c",
"allFlightNumbers": [
"NK-544, NK-195,NK-145"
],
"allStopOverAirports": [
[
"CUN,",
"FLL,",
"SDQ,",
"MCQ"
]
],
"allAirlineCodes": [
[
"1,",
"1,",
1
]
],
"id": "64802d78164ff9122367943c"
},
"flyFrom": "CUN",
"flyTo": "SDQ",
"isRoundTrip": false,
"departDate": "2022-08-17T00:00:00.000Z",
"returnDate": "2022-08-18T00:00:00.000Z",
"channelName": "Spirit",
"channelType": "brand",
"airlineCode": 35,
"totalPrice": 244,
"isRatePerPerson": false,
"isMultipleAirline": false,
"collectedAt": "2022-07-16T18:52:57.214Z",
"statusCode": 200,
"batchInsertionId": "6448ce36bc44695e8914a8c2",
"_user": "6540b8df2e9e9a091aa17df7",
"userName": "user@flightrates.com",
"flightTripHash": "",
"_flightShop": "6540b8df2e9e9a091aa17df7",
"flightShopName": "Test Jetblue_copaair",
"_source": "6540b8df2e9e9a091aa17df7",
"sourceName": "Biman Bangladesh Airlines",
"sourceId": 1,
"_pos": "6540b8df2e9e9a091aa17df7",
"posName": "My Code",
"_cabinClass": {
"_id": "6013a6abf553c71d4dfbe92b",
"name": "Economy",
"id": "6013a6abf553c71d4dfbe92b"
},
"_currency": "5fa104806304832acf9c67e9",
"currencyName": "AED",
"updatedAt": "2022-12-28T05:48:30.669Z",
"_flyFrom": "5fa104806304832acf9c67e9",
"_flyTo": "5fa104806304832acf9c67e9",
"rowHash": "YyX",
"id": "63a59bf4533a40315c201e5f"
}
],
"totalData": 1,
"totalPages": 1,
"page": 1,
"size": 10
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | historicalRateRes |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
Schedules
Create Schedule
Code samples
# You can also use wget
curl -X POST /api/v1/schedule \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
POST /api/v1/schedule HTTP/1.1
Content-Type: application/json
Accept: application/json
const inputBody = '{
"scheduleName": "Flightschedule name",
"_shops": [
"66fbd773cfa2fa105752dc26"
],
"_timezone": "64ae7e58d06e77f95bff0565",
"dayOfMonth": "*",
"month": "*",
"dayOfWeek": "*",
"hour": "*",
"minute": "0",
"isActiveStatus": true,
"startDate": "2019-08-24",
"endDate": "2019-08-24"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/schedule',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.post '/api/v1/schedule',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.post('/api/v1/schedule', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v1/schedule', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/schedule");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "/api/v1/schedule", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /schedule
Create new Schedule
A schedule is a method to program in time the extractions of shops. For example a shop can be scheduled to extract at 8am every day, or another shop can be extracted on Tuesdays only. By making a POST request to this endpoint, users can provide the necessary parameters and details in the request body to define a new schedule. This includes information such as the schedule name, date, time, and any other relevant parameters or configurations.
Mandatory Fields
- _timezone: The ID of the timezone.
- dayOfMonth: The day(s) of the month when the schedule is active. Can be a number (1-31), or
*
to indicate all days. Multiple days should be separated by |. - month: The month(s) when the schedule is active. Can be a number (1-12), or
*
to indicate all months. Multiple months should be separated by |. - dayOfWeek: The day(s) of the week when the schedule is active. Can be a number (0-6), where 0 is Sunday, or
*
to indicate all days. Multiple days should be separated by |. - hour: The hour(s) when the schedule is active. Can be a number (0-23), or
*
to indicate all hours. Multiple hours should be separated by |. - minute: The minute(s) when the schedule is active. Can be a number (0-59). Multiple minutes are not accepted.
- isActiveStatus: Boolean value indicating whether the schedule is active (true or false).
- startDate: The start date of the schedule (format: YYYY-MM-DD).
- endDate: The end date of the schedule (format: YYYY-MM-DD).
- scheduleName: The name of the schedule.
- _shops: The ID(s) of the shop(s) associated with the schedule, separated by | if multiple.
The provided data should align with the following structures retrieved from the database: - Timezones: Active and non-deleted timezones fetched from the Timezone model. - Shops: Active, non-deleted shops associated with the authenticated user, excluding those marked as real-time.
This format ensures all necessary parameters are covered with detailed explanations to facilitate a new shop creation via the API.
Body parameter
{
"scheduleName": "Flightschedule name",
"_shops": [
"66fbd773cfa2fa105752dc26"
],
"_timezone": "64ae7e58d06e77f95bff0565",
"dayOfMonth": "*",
"month": "*",
"dayOfWeek": "*",
"hour": "*",
"minute": "0",
"isActiveStatus": true,
"startDate": "2019-08-24",
"endDate": "2019-08-24"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | schedulePostReq | true | none |
Example responses
200 Response
{
"error": false,
"schedule": {
"scheduleName": "Flightschedule name",
"_shop": "63fdd677a631b4a452c34b24",
"_timezone": "63fdd677a631b4a452c34b22",
"dayOfMonth": "*",
"month": "*",
"dayOfWeek": "*",
"hour": "*",
"minute": "0",
"crontabExpression": "0 * * * *",
"crontabHuman": "Every minute, every hour, every day",
"timezoneName": "Africa/Addis_Ababa",
"isActiveStatus": true,
"startDate": "2019-08-24",
"endDate": "2019-08-24",
"_user": "63fda531bde67155fc46fb41",
"userName": "user@flightrates.com",
"vertical": "flightrates",
"isCustomerCreated": "true,",
"createdAt": "2023-03-01T09:42:35.372Z",
"id": "63ff1e0bb2482db1c660e306"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | schedulePostResp |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
Bulk Schedule Upload
Code samples
# You can also use wget
curl -X POST /api/v1/schedules/bulk \
-H 'Content-Type: multipart/form-data' \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
POST /api/v1/schedules/bulk HTTP/1.1
Content-Type: multipart/form-data
Accept: application/json
const inputBody = '{
"file": "string"
}';
const headers = {
'Content-Type':'multipart/form-data',
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/schedules/bulk',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.post '/api/v1/schedules/bulk',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'multipart/form-data',
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.post('/api/v1/schedules/bulk', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v1/schedules/bulk', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/schedules/bulk");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"multipart/form-data"},
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "/api/v1/schedules/bulk", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /schedules/bulk
Bulk Schedule upload
The bulk schedules endpoint enables users to create multiple schedules at once. The sample data and template for the bulk upload can be downloaded from the “GET /schedules/bulk/sample” endpoint.
The CSV should contain the following headers:
- _timezone: The ID of the timezone.
- dayOfMonth: The day(s) of the month when the schedule is active. Can be a number (1-31), or
*
to indicate all days. Multiple days should be separated by |. - month: The month(s) when the schedule is active. Can be a number (1-12), or
*
to indicate all months. Multiple months should be separated by |. - dayOfWeek: The day(s) of the week when the schedule is active. Can be a number (0-6), where 0 is Sunday, or
*
to indicate all days. Multiple days should be separated by |. - hour: The hour(s) when the schedule is active. Can be a number (0-23), or
*
to indicate all hours. Multiple hours should be separated by |. - minute: The minute(s) when the schedule is active. Can be a number (0-59). Multiple minutes are not accepted.
- isActiveStatus: Boolean value indicating whether the schedule is active (true or false).
- startDate: The start date of the schedule (format: YYYY-MM-DD).
- endDate: The end date of the schedule (format: YYYY-MM-DD).
- scheduleName: The name of the schedule.
- _shops: The ID(s) of the shop(s) associated with the schedule, separated by | if multiple.
The provided data should align with the following structures retrieved from the database: - Timezones: Active and non-deleted timezones fetched from the Timezone model. - Shops: Active, non-deleted shops associated with the authenticated user, excluding those marked as real-time.
The file should be uploaded in CSV format. The service will validate the CSV content and return a list of successfully created schedules or an error log if any issues are found.
Body parameter
file: string
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» file | body | string(binary) | true | The CSV file to upload. |
Example responses
200 Response
{
"error": false,
"message": "Successfully Uploaded!",
"scheduleName": [
"Flightschedule_name_1",
"Flightschedule_name_2",
"Flightschedule_name_3"
],
"errorLog": []
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | Inline |
400 | Bad Request | Bad Request | Inline |
401 | Unauthorized | Unauthorized | Inline |
404 | Not Found | Not found. | Inline |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» error | boolean | false | none | none |
» message | string | false | none | none |
» scheduleName | [string] | false | none | none |
» errorLog | [string] | false | none | none |
Status Code 400
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» error | boolean | false | none | none |
» statusCode | integer | false | none | none |
» msg | string | false | none | none |
» errorLog | [string] | false | none | none |
Status Code 401
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» error | string | false | none | none |
» message | string | false | none | none |
Status Code 404
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» error | boolean | false | none | none |
» message | string | false | none | none |
» scheduleName | [string] | false | none | none |
» errorLog | [string] | false | none | none |
Status Code 500
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» error | string | false | none | none |
» message | string | false | none | none |
On Demand Trigger Schedule
Code samples
# You can also use wget
curl -X POST /api/v1/schedule/now \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
POST /api/v1/schedule/now HTTP/1.1
Content-Type: application/json
Accept: application/json
const inputBody = '{
"shopId": "6507eb74b53967089ac9736b"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/schedule/now',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.post '/api/v1/schedule/now',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.post('/api/v1/schedule/now', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v1/schedule/now', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/schedule/now");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "/api/v1/schedule/now", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /schedule/now
Trigger Schedule
On Demand trigger schedule is a method to extract fare information from sources straight after posting the method. This API endpoint enables users to trigger a real-time schedule for a specific shop by providing the shop ID in request.
Mandatory Fields - "shopId"
Body parameter
{
"shopId": "6507eb74b53967089ac9736b"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | scheduleTriggerReq | true | none |
Example responses
201 Response
{
"error": false,
"message": "Request accepted ✅!!"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Success | scheduleTriggerRes |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
Get Schedules
Code samples
# You can also use wget
curl -X GET /api/v1/schedules \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
GET /api/v1/schedules HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/schedules',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.get '/api/v1/schedules',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.get('/api/v1/schedules', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/schedules', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/schedules");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/schedules", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /schedules
List of all Schedules
A schedule is a method to program in time the extractions of shops. For example a shop can be scheduled to extract at 8am every day, or another shop can be extracted on Tuesdays only. This API provides a list and details of all user schedules. Users can access this endpoint to obtain details about each schedule, including the schedule name, year, month, and other relevant information.
Upon a successful request, the system will respond with a JSON object containing all information of all schedules.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
page | query | integer | false | The page number to retrieve. |
size | query | integer | false | The number of items to be displayed per page. |
Example responses
200 Response
{
"error": false,
"schedules": [
{
"_id": "63ff1e0bb2482db1c660e306",
"scheduleName": "flightrates Schedules",
"_shop": "63fdd677a631b4a452c34b24",
"_timezone": "63fdd677a631b4a452c34b22",
"timezoneName": "asia/kol",
"dayOfMonth": "*",
"month": "*",
"dayOfWeek": "*",
"hour": "*",
"minute": "0",
"crontabExpression": "0 * * * *",
"crontabHuman": "Every minute, every hour, every day",
"isActiveStatus": true,
"startDate": "2019-08-24",
"endDate": "2019-08-24",
"_user": "63fda531bde67155fc46fb41",
"userName": "user@flightrates.com",
"vertical": "flightrates",
"isCustomerCreated": "true,",
"createdAt": "2023-03-01T09:42:35.372Z",
"updatedAt": "2023-03-03T06:22:55.108Z",
"id": "63ff1e0bb2482db1c660e306"
}
],
"totalData": 1,
"totalPages": 1,
"page": 1,
"size": 10
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | schedulesFindResp |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
Sample Schedule
Code samples
# You can also use wget
curl -X GET /api/v1/schedules/bulk/sample \
-H 'Accept: text/csv' \
-H 'Authorization: API_KEY'
GET /api/v1/schedules/bulk/sample HTTP/1.1
Accept: text/csv
const headers = {
'Accept':'text/csv',
'Authorization':'API_KEY'
};
fetch('/api/v1/schedules/bulk/sample',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'text/csv',
'Authorization' => 'API_KEY'
}
result = RestClient.get '/api/v1/schedules/bulk/sample',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'text/csv',
'Authorization': 'API_KEY'
}
r = requests.get('/api/v1/schedules/bulk/sample', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'text/csv',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/schedules/bulk/sample', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/schedules/bulk/sample");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"text/csv"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/schedules/bulk/sample", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /schedules/bulk/sample
Sample for Bulk Schedule Download
This endpoint provides a sample CSV file for bulk schedule uploads, containing predefined schedule details.
Example responses
Successful CSV file download
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful CSV file download | string |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal server error | None |
Bulk Schedule Download
Code samples
# You can also use wget
curl -X GET /api/v1/schedules/download \
-H 'Accept: text/csv' \
-H 'Authorization: API_KEY'
GET /api/v1/schedules/download HTTP/1.1
Accept: text/csv
const headers = {
'Accept':'text/csv',
'Authorization':'API_KEY'
};
fetch('/api/v1/schedules/download',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'text/csv',
'Authorization' => 'API_KEY'
}
result = RestClient.get '/api/v1/schedules/download',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'text/csv',
'Authorization': 'API_KEY'
}
r = requests.get('/api/v1/schedules/download', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'text/csv',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/schedules/download', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/schedules/download");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"text/csv"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/schedules/download", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /schedules/download
Bulk Schedule Download
This endpoint allows users to download a CSV file containing all schedules.
Note: Use comma as a separator option, do not use tab as a separator option.
Example responses
A CSV file containing all schedules.
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | A CSV file containing all schedules. | string |
400 | Bad Request | Request data failed validation(s) | None |
404 | Not Found | No schedule was found. | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | An error occurred while fetching schedules. | None |
Response Headers
Status | Header | Type | Format | Description |
---|---|---|---|---|
200 | Content-Disposition | string | Indicates the file name of the CSV download. | |
200 | Content-Type | string | The MIME type of the returned file. |
Get Schedule
Code samples
# You can also use wget
curl -X GET /api/v1/schedule/{scheduleId} \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
GET /api/v1/schedule/{scheduleId} HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/schedule/{scheduleId}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.get '/api/v1/schedule/{scheduleId}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.get('/api/v1/schedule/{scheduleId}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/schedule/{scheduleId}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/schedule/{scheduleId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/schedule/{scheduleId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /schedule/{scheduleId}
Get a single Schedule
This API provides details of a specific user schedule. By providing the schedule ID in the request, users can obtain details about the schedule, including the schedule name, year, month, and other relevant information.
Mandatory Fields - "scheduleId"
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
scheduleId | path | string(string) | true | Schedule Id |
Example responses
200 Response
{
"error": false,
"schedule": {
"_id": "63ff1e0bb2482db1c660e306",
"scheduleName": "Flightschedule name",
"_shop": "63fdd677a631b4a452c34b24",
"_timezone": "63fdd677a631b4a452c34b22",
"timezoneName": "asia/kol",
"dayOfMonth": "*",
"month": "*",
"dayOfWeek": "*",
"hour": "*",
"minute": "0",
"crontabExpression": "0 * * * *",
"crontabHuman": "Every minute, every hour, every day",
"isActiveStatus": true,
"startDate": "2019-08-24",
"endDate": "2019-08-24",
"_user": "63fda531bde67155fc46fb41",
"userName": "user@flightrates.com",
"vertical": "flightrates",
"isCustomerCreated": "true,",
"createdAt": "2023-03-01T09:42:35.372Z",
"updatedAt": "2023-03-03T06:22:55.108Z",
"id": "63ff1e0bb2482db1c660e306"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | schedulesGetResp |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
Update Schedule
Code samples
# You can also use wget
curl -X PUT /api/v1/schedule/{scheduleId} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
PUT /api/v1/schedule/{scheduleId} HTTP/1.1
Content-Type: application/json
Accept: application/json
const inputBody = '{
"scheduleName": "Flightschedule name",
"_timezone": "64ae7e58d06e77f95bff059c",
"_shop": "66fbd773cfa2fa105752dc26",
"dayOfMonth": "*",
"month": "*",
"dayOfWeek": "*",
"hour": "*",
"minute": "0",
"isActiveStatus": true,
"startDate": "2019-08-24",
"endDate": "2019-08-24"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/schedule/{scheduleId}',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.put '/api/v1/schedule/{scheduleId}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.put('/api/v1/schedule/{scheduleId}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PUT','/api/v1/schedule/{scheduleId}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/schedule/{scheduleId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "/api/v1/schedule/{scheduleId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /schedule/{scheduleId}
Update the existing Schedule
This PUT /schedule/{scheduleId} method is useful when users need to make changes or updates to an existing Schedule.
By providing a Schedule ID in the request, you can edit the results to meet your requirements.
Mandatory Fields - "scheduleId"
Body parameter
{
"scheduleName": "Flightschedule name",
"_timezone": "64ae7e58d06e77f95bff059c",
"_shop": "66fbd773cfa2fa105752dc26",
"dayOfMonth": "*",
"month": "*",
"dayOfWeek": "*",
"hour": "*",
"minute": "0",
"isActiveStatus": true,
"startDate": "2019-08-24",
"endDate": "2019-08-24"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
scheduleId | path | string(string) | true | none |
body | body | schedulePutReq | true | none |
Example responses
200 Response
{
"error": false,
"schedule": {
"scheduleName": "Flightschedule name",
"_timezone": "64ae7e58d06e77f95bff0565",
"_shop": "66fbd773cfa2fa105752dc26",
"dayOfMonth": "*",
"month": "*",
"dayOfWeek": "*",
"hour": "*",
"minute": "0",
"isActiveStatus": true,
"startDate": "2019-08-24",
"endDate": "2019-08-24",
"_user": "6411b27b79d2c995fc689c4b",
"userName": "user@flightrates.com",
"vertical": "flightrates",
"isCustomerCreated": true,
"createdAt": "2023-03-10T06:30:25.288Z",
"updatedAt": "2023-03-10T06:30:25.288Z",
"id": "640ace815353bdb6454e191b"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | schedulePutResp |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
404 | Not Found | Not found. | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
Delete Schedule
Code samples
# You can also use wget
curl -X DELETE /api/v1/schedule/{scheduleId} \
-H 'Authorization: API_KEY'
DELETE /api/v1/schedule/{scheduleId} HTTP/1.1
const headers = {
'Authorization':'API_KEY'
};
fetch('/api/v1/schedule/{scheduleId}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Authorization' => 'API_KEY'
}
result = RestClient.delete '/api/v1/schedule/{scheduleId}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Authorization': 'API_KEY'
}
r = requests.delete('/api/v1/schedule/{scheduleId}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','/api/v1/schedule/{scheduleId}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/schedule/{scheduleId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "/api/v1/schedule/{scheduleId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /schedule/{scheduleId}
Delete a single Schedule
By using this endpoint the user can delete a single schedule. Mandatory Fields - "scheduleId"
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
scheduleId | path | string(string) | true | Schedule Id |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | Ok, data deleted | None |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
404 | Not Found | Not found. | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
Bulk Schedule Update
Code samples
# You can also use wget
curl -X PUT /api/v1/schedules/bulkupdate \
-H 'Content-Type: multipart/form-data' \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
PUT /api/v1/schedules/bulkupdate HTTP/1.1
Content-Type: multipart/form-data
Accept: application/json
const inputBody = '{
"file": "string"
}';
const headers = {
'Content-Type':'multipart/form-data',
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/schedules/bulkupdate',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.put '/api/v1/schedules/bulkupdate',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'multipart/form-data',
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.put('/api/v1/schedules/bulkupdate', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PUT','/api/v1/schedules/bulkupdate', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/schedules/bulkupdate");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"multipart/form-data"},
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "/api/v1/schedules/bulkupdate", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /schedules/bulkupdate
Bulk Update Schedules
This endpoint allows users to bulk update schedule data using a CSV file. The CSV file should contain the following headers, and each row in the file represents a schedule entry:
- _id: The unique identifier for the schedule. This field is required for each schedule to be updated.
- _timezone: The ID of the timezone associated with the schedule. This field is required.
- dayOfMonth: The day(s) of the month when the schedule is active. Can be a number (1-31), or
*
to indicate all days. Multiple days should be separated by |. - month: The month(s) when the schedule is active. Can be a number (1-12), or
*
to indicate all months. Multiple months should be separated by |. - dayOfWeek: The day(s) of the week when the schedule is active. Can be a number (0-6), where 0 is Sunday, or
*
to indicate all days. Multiple days should be separated by |. - hour: The hour(s) when the schedule is active. Can be a number (0-23), or
*
to indicate all hours. Multiple hours should be separated by |. - minute: The minute(s) when the schedule is active. Can be a number (0-59). Multiple minutes are not accepted.
- isActiveStatus: Boolean value indicating whether the schedule is active (true or false).
- startDate: The start date of the schedule's activity (format: YYYY-MM-DD). The date cannot be in the past.
- endDate: The end date of the schedule's activity (format: YYYY-MM-DD).
- scheduleName: A unique name for the schedule. This field is required.
- _shop: The ID of the shop associated with the schedule. This field is required.
Body parameter
file: string
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» file | body | string(binary) | false | The CSV file containing the schedule data. |
Example responses
200 Response
{
"error": false,
"statusCode": 200,
"msg": "Schedules updated successfully.",
"scheduleName": [
"670df5a392984ee41f158228",
"670df5a392984ee41f158226"
],
"errorLog": []
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Schedules updated successfully. | Inline |
400 | Bad Request | Bad Request. Column names do not match or required fields are missing. | Inline |
401 | Unauthorized | Unauthorized - authentication failed | None |
404 | Not Found | No schedule found to be updated. | Inline |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | An error occurred while updating schedules. | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» error | boolean | false | none | none |
» statusCode | integer | false | none | none |
» msg | string | false | none | none |
» scheduleName | [string] | false | none | none |
» errorLog | [string] | false | none | none |
Status Code 400
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» error | boolean | false | none | none |
» statusCode | integer | false | none | none |
» msg | string | false | none | none |
» errorLog | string | false | none | none |
Status Code 404
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» error | boolean | false | none | none |
» statusCode | integer | false | none | none |
» msg | string | false | none | none |
» errorLog | [string] | false | none | none |
Status Code 500
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» error | string | false | none | none |
» message | string | false | none | none |
Delete Multiple Schedules
Code samples
# You can also use wget
curl -X DELETE /api/v1/schedule/bulkdelete \
-H 'Content-Type: application/json' \
-H 'Authorization: API_KEY'
DELETE /api/v1/schedule/bulkdelete HTTP/1.1
Content-Type: application/json
const inputBody = '{
"scheduleIds": [
"scheduleId1",
"scheduleId2",
"scheduleId3"
]
}';
const headers = {
'Content-Type':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/schedule/bulkdelete',
{
method: 'DELETE',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.delete '/api/v1/schedule/bulkdelete',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.delete('/api/v1/schedule/bulkdelete', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','/api/v1/schedule/bulkdelete', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/schedule/bulkdelete");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "/api/v1/schedule/bulkdelete", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /schedule/bulkdelete
Delete multiple schedules
Delete multiple schedules identified by their IDs. Mandatory Fields - "scheduleIds"
Body parameter
{
"scheduleIds": [
"scheduleId1",
"scheduleId2",
"scheduleId3"
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» scheduleIds | body | [string] | false | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | Successfully deleted schedules | None |
400 | Bad Request | Invalid request payload | None |
401 | Unauthorized | Unauthorized - authentication failed | None |
404 | Not Found | Not found. | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal server error | None |
Entity Informations
Search Sources
Code samples
# You can also use wget
curl -X POST /api/v1/entity/sources/search \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
POST /api/v1/entity/sources/search HTTP/1.1
Content-Type: application/json
Accept: application/json
const inputBody = '{
"searchTerm": "Airline",
"channel": "Direct"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/entity/sources/search',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.post '/api/v1/entity/sources/search',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.post('/api/v1/entity/sources/search', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v1/entity/sources/search', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/entity/sources/search");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "/api/v1/entity/sources/search", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /entity/sources/search
Entity Informations
Our database uses various sources to extract the price from. Each source has a name (like Expedia). Also each source is categorized by its specific character of channel:- Direct (brand.com), META, Mobile, OTA, GDS.
The API method allows you to retrieve data details about sources and available airlines from the database based on the search criteria. By providing a search term and channel (category of sources) in the request, you can filter the results
Mandatory Fields: "searchTerm"
Body parameter
{
"searchTerm": "Airline",
"channel": "Direct"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | entityReq | true | none |
Example responses
200 Response
{
"error": false,
"searchTerm": "Airline",
"matchingSources": [
{
"_id": "64ae65cfd06e77f95bfefe55",
"source": "Aegean Airlines",
"code": 226,
"status": 1,
"channel": "Direct",
"vertical": "flightrates",
"isActiveStatus": true,
"userAirlineCode": 112,
"id": "640aca5b56f99935b4c9deb2"
}
],
"channel": "Direct"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | entityResp |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
Flightrates Informations
Get Flightrates
Code samples
# You can also use wget
curl -X GET /api/v1/flightrates/{shopId} \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
GET /api/v1/flightrates/{shopId} HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1/flightrates/{shopId}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'API_KEY'
}
result = RestClient.get '/api/v1/flightrates/{shopId}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'API_KEY'
}
r = requests.get('/api/v1/flightrates/{shopId}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v1/flightrates/{shopId}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v1/flightrates/{shopId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v1/flightrates/{shopId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /flightrates/{shopId}
List of all the Flightrates available
The FlightRates endpoint provides data sourced from various channels, including information on flight fares, operating and marketing airline details, flight schedules, flight numbers, connecting airports, fare families, tax details, fare breakdowns, ancillary services, and other relevant information.
The API method GET /flightrates/{shopId} allows users to retrieve the above data. To obtain the flight rates, send a GET request to the specified endpoint, replacing {shopId} in the URL with the actual ID of the shop.
Mandatory Fields - "shopId"
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
shopId | path | string(string) | true | Id of the Flight Shop |
fromId | query | string | false | The from id used for cursor based pagination. |
size | query | integer | false | The number of items to be displayed per page. |
Example responses
200 Response
{
"error": false,
"isRealtime": true,
"status": "COMPLETED",
"flightrates": [
{
"travellers": {
"adults": 1,
"infants": 0,
"children": 1
},
"_id": "63a59bf4533a40315c201e77",
"outbound": {
"price": 171,
"baseFare": 0,
"feesAndOthers": 0,
"description": "",
"numOfStops": 2,
"metaProviderName": "",
"layover": "13:58",
"flightStatusCode": 22,
"departureDate": "2022-08-17T00:00:00.000Z",
"departureTime": "17:55",
"arrivalDate": "2022-08-18T00:00:00.000Z",
"arrivalTime": "14:36",
"totalDuration": "19:41",
"flightTime": "05:43",
"actualPrice": 0,
"actualBaseFare": 0,
"actualFeeAndOthers": 0,
"_priceClass": "6540b8df2e9e9a091aa17df7",
"priceClassName": "Standard",
"bookingClass": "Z",
"legs": [
{
"_id": "64802d78164ff91223679439",
"origin": "CUN",
"destination": "MCO",
"description": "",
"distance": 0,
"fbc": "",
"seatCount": 1,
"departureDate": "2022-08-17T00:00:00.000Z",
"departureTime": "17:55",
"arrivalDate": "2022-08-17T00:00:00.000Z",
"arrivalTime": "21:02",
"airlineShortCode": "NK",
"flightNumber": "NK-544",
"flightTime": "02:07",
"waitTime": "10:53",
"operatedBy": "",
"_airline": "6540b8df2e9e9a091aa17df7",
"airlineName": "Air Arabia",
"airlineCode": 1
}
],
"baggageDetails": "",
"promoCode": "",
"discounts": "",
"taxStatus": 22,
"_id": "64802d78164ff9122367943c",
"allFlightNumbers": [
"NK-544, NK-195,NK-145"
],
"allStopOverAirports": [
[
"CUN,",
"FLL,",
"SDQ,",
"MCQ"
]
],
"allAirlineCodes": [
[
"1,",
"1,",
1
]
],
"id": "64802d78164ff9122367943c"
},
"flyFrom": "CUN",
"flyTo": "SDQ",
"isRoundTrip": false,
"departDate": "2022-08-17T00:00:00.000Z",
"returnDate": "2022-08-18T00:00:00.000Z",
"channelName": "Spirit",
"channelType": "brand",
"airlineCode": 35,
"totalPrice": 244,
"isRatePerPerson": false,
"previousPrice": null,
"isMultipleAirline": false,
"collectedAt": "2022-07-16T18:52:57.214Z",
"statusCode": 200,
"batchInsertionId": "6448ce36bc44695e8914a8c2",
"_user": "6540b8df2e9e9a091aa17df7",
"userName": "user@flightrates.com",
"flightTripHash": "",
"_flightShop": "6540b8df2e9e9a091aa17df7",
"flightShopName": "Test Jetblue_copaair",
"_source": "6540b8df2e9e9a091aa17df7",
"sourceName": "Biman Bangladesh Airlines",
"sourceId": 1,
"_pos": "6540b8df2e9e9a091aa17df7",
"posName": "My Code",
"_cabinClass": {
"_id": "6013a6abf553c71d4dfbe92b",
"name": "Economy",
"id": "6013a6abf553c71d4dfbe92b"
},
"_currency": "5fa104806304832acf9c67e9",
"currencyName": "AED",
"updatedAt": "2022-12-28T05:48:30.669Z",
"_flyFrom": "5fa104806304832acf9c67e9",
"_flyTo": "5fa104806304832acf9c67e9",
"rowHash": "YyX",
"id": "63a59bf4533a40315c201e5f"
}
],
"prevPageUrl": "http://192.168.1.14:3000//flightrates/65a11460eb2070b608d4f396?size=1000",
"nextPageUrl": "http://192.168.1.14:3000//flightrates/65a11460eb2070b608d4f397?size=1000",
"pageSize": 1000
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Success | flightratesResp |
400 | Bad Request | Request data failed validation(s) | None |
401 | Unauthorized | Authentication Failed! | None |
429 | Too Many Requests | Too Many Requests. | None |
500 | Internal Server Error | Internal Server Error | None |
Schemas
userReq
{
"handle": "myuser",
"password": "supersecret"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
handle | string | true | none | Request an user by. |
password | string | true | none | Secret |
userResp
{
"error": false,
"handle": "myuser",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY2Y2MxZWYyYjhjYTk5MTE3MTdkYmQ2YyIsIl9pZCI6IjY2Y2MxZWYyYjhjYTk5MTE3MTdkYmQ2YyIsImZ1bGxOYW1lIjoiZGV2IHRlYW0iLCJlbWFpbCI6ImRldnRlYW1AZ2dyZWdhdGVpbnRlbGxpZ2VuY2UuaW4iLCJwaG9uZSI6IjkzNDU5MDI0ODkiLCJ1c2VyTmFtZSI6ImRldnRlYW0iLCJ2YWxpZFRpbGwiOiIyMDI5LTAzLTIwVDAwOjAwOjAwLjAwMFoiLCJpYXQiOjE3Mjc5MzU5NDcsImV4cCI6MTcyODAyMjM0N30.73J6U7UR6uLXlux_DbEp2jkkkmenOLahr7i7c0xCzyg"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
handle | string | false | none | Represents a handle. |
token | string | false | none | Represents an access token. |
Enumerated Values
Property | Value |
---|---|
error | false |
userDetailsResp
{
"error": false,
"user": {
"name": {
"first": "Flight",
"last": "Rates",
"full": "Flight Rates"
},
"_id": "6507eacf83f9b7f200e541ab",
"_primaryAirline": "601bb896f764ad17a4b71e74",
"targetSite": "http://localhost:3000/targetsite",
"isTableau": true,
"userName": "user@flightrates.com",
"email": "user@flightrates.com",
"isActiveStatus": true,
"customerType": "demo",
"validTill": "2025-03-20T00:00:00.000Z",
"id": "6507eacf83f9b7f200e541ab"
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
user | object | false | none | none |
» name | object | false | none | none |
»» first | string | false | none | none |
»» last | string | false | none | none |
»» full | string | false | none | none |
» _id | string | false | none | none |
» _primaryAirline | string | false | none | none |
» targetSite | string | false | none | none |
» isTableau | boolean | false | none | none |
» userName | string | false | none | none |
string | false | none | none | |
» isActiveStatus | boolean | false | none | none |
» customerType | string | false | none | none |
» validTill | string(date-time) | false | none | none |
» id | string | false | none | none |
Enumerated Values
Property | Value |
---|---|
error | false |
airlinesResp
{
"error": false,
"airlines": [
{
"_id": "64af967793f9120fb0de17e2",
"sourceName": "TAR Aerolíneas Airline",
"displayName": "TAR Aerolíneas Airline",
"code": 623,
"isActiveStatus": true,
"id": "63ff432ce2276fc08e64f794"
}
],
"totalData": 10282,
"totalPages": 10282,
"page": 1,
"size": 1
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
airlines | [object] | false | none | List of all the Airlines. |
» _id | string | false | none | The airline's distinctive identifier. |
» sourceName | string | false | none | The source name of the airline intended for travel. |
» displayName | string | false | none | The display name of the airline selected for travel. |
» code | number | false | none | The code of the airline selected for travel. |
» isActiveStatus | boolean | false | none | The active status of the airline chosen for travel. |
» id | string | false | none | The airline's distinctive and unique identifier. |
totalData | number | false | none | Total data of the airlines selected for travel. |
totalPages | number | false | none | Total number of pages. |
page | number | false | none | The current page number to retrieve. |
size | number | false | none | The number of items to be displayed per page. |
Enumerated Values
Property | Value |
---|---|
error | false |
airportsResp
{
"error": false,
"airports": [
{
"_id": "64ae8d14d06e77f95bff13bc",
"airportName": "Netaji Subhas Chandra Bose International Airport",
"city": "Kolkata",
"airportCode": "CCU",
"isActiveStatus": true,
"id": "63ff432ce2276fc08e64f794"
}
],
"totalData": 10282,
"totalPages": 10282,
"page": 1,
"size": 1
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
airports | [object] | false | none | The list of all the airports |
» _id | string | false | none | The airport's distinctive identifier. |
» airportName | string | false | none | The name of the airport. |
» city | string | false | none | The city where the airport is located. |
» airportCode | string | false | none | The code representing the country, where the airport is located. |
» isActiveStatus | boolean | false | none | The active status of the airport. |
» id | string | false | none | The unique identifier of the airport. |
totalData | number | false | none | The total number of the data entries available in the response. |
totalPages | number | false | none | The total number of pages available in the response. |
page | number | false | none | The current page number of the response. |
size | number | false | none | The number of items to be displayed per page. |
Enumerated Values
Property | Value |
---|---|
error | false |
cabinclassResp
{
"error": false,
"cabinclasses": [
{
"_id": "6013a6abf553c71d4dfbe92d",
"code": 3,
"name": "First Class",
"isActiveStatus": true,
"id": "63ff432ce2276fc08e64f794"
}
],
"totalData": 10282,
"totalPages": 10282,
"page": 1,
"size": 1
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
cabinclasses | [object] | false | none | List of the cabinclasses |
» _id | string | false | none | The cabin class's distinctive identifier. |
» code | number | false | none | The code of the cabin class. |
» name | number | false | none | The name of the cabin class. |
» isActiveStatus | boolean | false | none | The active status of the cabin class. |
» id | string | false | none | The unique identifier of the cabin class. |
totalData | number | false | none | The total number of the data entries available in the response. |
totalPages | number | false | none | The total number of pages available in the response. |
page | number | false | none | The current page number of the response. |
size | number | false | none | The number of items to be displayed per page. |
Enumerated Values
Property | Value |
---|---|
error | false |
posResp
{
"error": false,
"posses": [
{
"_id": "64007076257289970c6db570",
"posCode": 0,
"code": "POS/0",
"region": "Asia",
"countryCode": "IN",
"countryName": "India",
"isActiveStatus": true,
"id": "63ff432ce2276fc08e64f794"
}
],
"totalData": 10282,
"totalPages": 10282,
"page": 1,
"size": 1
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
posses | [object] | false | none | List of POS(s) |
» _id | string | false | none | The unique identifier of the point of sale. |
» posCode | number | false | none | The code representing the point of sale. |
» code | string | false | none | A code for the point of sale. |
» region | string | false | none | The region associated with the point of sale. |
» countryCode | string | false | none | The code representing the country associated with the point of sale. |
» countryName | string | false | none | The name of the country associated with the point of sale. |
» isActiveStatus | boolean | false | none | The active status of the POS. |
» id | string | false | none | The unique identifier of the point of sale. |
totalData | number | false | none | The total number of data entries available in the response. |
totalPages | number | false | none | The total number of pages available in the response. |
page | number | false | none | The current page number of the response. |
size | number | false | none | The number of items to be displayed per page. |
Enumerated Values
Property | Value |
---|---|
error | false |
currencyResp
{
"error": false,
"currencies": [
{
"_id": "64ae7d3ed06e77f95bff04e7",
"iso": "DZD",
"symbol": "DZD",
"isActiveStatus": true,
"id": "63ff432ce2276fc08e64f794"
}
],
"totalData": 10282,
"totalPages": 10282,
"page": 1,
"size": 1
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
currencies | [object] | false | none | List of currencies. |
» _id | string | false | none | This is a unique identifier for the currency. |
» iso | string | false | none | This field represents the ISO code of the currency. |
» symbol | string | false | none | This field represents the symbol used to represent the currency. |
» isActiveStatus | boolean | false | none | This field that indicates, whether the currency is currently active. |
» id | string | false | none | The unique identifier of the currency. |
totalData | number | false | none | The total number of data entries available in the response. |
totalPages | number | false | none | The total number of pages available in the response. |
page | number | false | none | The current page number to retrieve. |
size | number | false | none | The number of items to be displayed per page. |
Enumerated Values
Property | Value |
---|---|
error | false |
timezonesResp
{
"error": false,
"timezones": [
{
"_id": "64ae7e58d06e77f95bff061e",
"timezone": "Asia/Kolkata",
"countryCode": "IST",
"countryName": "India",
"gmtOffSet": "5:30",
"abbr": "IST",
"isActiveStatus": true,
"id": "63ff432ce2276fc08e64f794"
}
],
"totalData": 10282,
"totalPages": 10282,
"page": 1,
"size": 1
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
timezones | [object] | false | none | List of timezones |
» _id | string | false | none | A unique identifier for the timezone. |
» timezone | string | false | none | The name of the timezone. |
» countryCode | string | false | none | The country code for the timezone. |
» countryName | string | false | none | The country name for the timezone. |
» gmtOffSet | string | false | none | The GMT offset for the timezone. |
» abbr | string | false | none | The abbreviation for the timezone. |
» isActiveStatus | boolean | false | none | The active status of the timezone. |
» id | string | false | none | A unique identifier for the timezone. |
totalData | number | false | none | Total data of the timezones. |
totalPages | number | false | none | The total number of pages available in the response. |
page | number | false | none | The current page number to retrieve. |
size | number | false | none | The number of items to be displayed per page. |
Enumerated Values
Property | Value |
---|---|
error | false |
sourceResp
{
"error": false,
"sourceResp": [
{
"_id": "64ae65cfd06e77f95bfefdec",
"source": "Gulf Air",
"code": "117",
"status": 1,
"channel": "Direct",
"vertical": "flightrates",
"isDeleted": false,
"isActiveStatus": true,
"userAirlineCode": 13
}
],
"totalData": 10282,
"totalPages": 10282,
"page": 1,
"size": 1
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
sourceResp | [object] | false | none | List of sources |
» _id | string | false | none | The unique identifier of the source. |
» source | string | false | none | The name of the source (e.g., airline). |
» code | string | false | none | The code associated with the source. |
» status | number | false | none | The status of the source. |
» channel | string | false | none | The channel through which the source operates. |
» vertical | string | false | none | The vertical category of the source. |
» isDeleted | boolean | false | none | Indicates whether the source is deleted. |
» isActiveStatus | boolean | false | none | Indicates whether the source is active. |
» userAirlineCode | number | false | none | The user-defined code for the airline. |
totalData | number | false | none | The total data of the source. |
totalPages | number | false | none | The total number of pages available in the response. |
page | number | false | none | The current page number to retrieve. |
size | number | false | none | The number of items to be displayed per page. |
Enumerated Values
Property | Value |
---|---|
error | false |
entityReq
{
"searchTerm": "Airline",
"channel": "Direct"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
searchTerm | string | true | none | Search entity information. |
channel | string | false | none | Search by channel mode. |
Enumerated Values
Property | Value |
---|---|
channel | Booking Engine |
channel | CHM |
channel | Direct |
channel | META |
channel | Mobile |
channel | OTA |
entityResp
{
"error": false,
"searchTerm": "Airline",
"matchingSources": [
{
"_id": "64ae65cfd06e77f95bfefe55",
"source": "Aegean Airlines",
"code": 226,
"status": 1,
"channel": "Direct",
"vertical": "flightrates",
"isActiveStatus": true,
"userAirlineCode": 112,
"id": "640aca5b56f99935b4c9deb2"
}
],
"channel": "Direct"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
searchTerm | string | false | none | The Search type of airlines. |
matchingSources | [object] | false | none | Matching details of the searched term. |
» _id | string | false | none | The unique identifier for the source entry. |
» source | string | false | none | The name of the data source. |
» code | string | false | none | The code of the source. |
» status | integer | false | none | The status of the source (e.g., active or inactive). |
» channel | string | false | none | The type of channel (Direct, META, OTA, GDS). |
» vertical | string | false | none | The vertical category of the source. |
» isActiveStatus | boolean | false | none | Indicates if the source is currently active. |
» userAirlineCode | integer | false | none | The user-defined airline code associated with the source. |
» id | string | false | none | The unique identifier of the entity. |
channel | string | false | none | channel type |
Enumerated Values
Property | Value |
---|---|
error | false |
channel | Booking Engine |
channel | CHM |
channel | Direct |
channel | META |
channel | Mobile |
channel | OTA |
flightratesResp
{
"error": false,
"isRealtime": true,
"status": "COMPLETED",
"flightrates": [
{
"travellers": {
"adults": 1,
"infants": 0,
"children": 1
},
"_id": "63a59bf4533a40315c201e77",
"outbound": {
"price": 171,
"baseFare": 0,
"feesAndOthers": 0,
"description": "",
"numOfStops": 2,
"metaProviderName": "",
"layover": "13:58",
"flightStatusCode": 22,
"departureDate": "2022-08-17T00:00:00.000Z",
"departureTime": "17:55",
"arrivalDate": "2022-08-18T00:00:00.000Z",
"arrivalTime": "14:36",
"totalDuration": "19:41",
"flightTime": "05:43",
"actualPrice": 0,
"actualBaseFare": 0,
"actualFeeAndOthers": 0,
"_priceClass": "6540b8df2e9e9a091aa17df7",
"priceClassName": "Standard",
"bookingClass": "Z",
"legs": [
{
"_id": "64802d78164ff91223679439",
"origin": "CUN",
"destination": "MCO",
"description": "",
"distance": 0,
"fbc": "",
"seatCount": 1,
"departureDate": "2022-08-17T00:00:00.000Z",
"departureTime": "17:55",
"arrivalDate": "2022-08-17T00:00:00.000Z",
"arrivalTime": "21:02",
"airlineShortCode": "NK",
"flightNumber": "NK-544",
"flightTime": "02:07",
"waitTime": "10:53",
"operatedBy": "",
"_airline": "6540b8df2e9e9a091aa17df7",
"airlineName": "Air Arabia",
"airlineCode": 1
}
],
"baggageDetails": "",
"promoCode": "",
"discounts": "",
"taxStatus": 22,
"_id": "64802d78164ff9122367943c",
"allFlightNumbers": [
"NK-544, NK-195,NK-145"
],
"allStopOverAirports": [
[
"CUN,",
"FLL,",
"SDQ,",
"MCQ"
]
],
"allAirlineCodes": [
[
"1,",
"1,",
1
]
],
"id": "64802d78164ff9122367943c"
},
"flyFrom": "CUN",
"flyTo": "SDQ",
"isRoundTrip": false,
"departDate": "2022-08-17T00:00:00.000Z",
"returnDate": "2022-08-18T00:00:00.000Z",
"channelName": "Spirit",
"channelType": "brand",
"airlineCode": 35,
"totalPrice": 244,
"isRatePerPerson": false,
"previousPrice": null,
"isMultipleAirline": false,
"collectedAt": "2022-07-16T18:52:57.214Z",
"statusCode": 200,
"batchInsertionId": "6448ce36bc44695e8914a8c2",
"_user": "6540b8df2e9e9a091aa17df7",
"userName": "user@flightrates.com",
"flightTripHash": "",
"_flightShop": "6540b8df2e9e9a091aa17df7",
"flightShopName": "Test Jetblue_copaair",
"_source": "6540b8df2e9e9a091aa17df7",
"sourceName": "Biman Bangladesh Airlines",
"sourceId": 1,
"_pos": "6540b8df2e9e9a091aa17df7",
"posName": "My Code",
"_cabinClass": {
"_id": "6013a6abf553c71d4dfbe92b",
"name": "Economy",
"id": "6013a6abf553c71d4dfbe92b"
},
"_currency": "5fa104806304832acf9c67e9",
"currencyName": "AED",
"updatedAt": "2022-12-28T05:48:30.669Z",
"_flyFrom": "5fa104806304832acf9c67e9",
"_flyTo": "5fa104806304832acf9c67e9",
"rowHash": "YyX",
"id": "63a59bf4533a40315c201e5f"
}
],
"prevPageUrl": "http://192.168.1.14:3000//flightrates/65a11460eb2070b608d4f396?size=1000",
"nextPageUrl": "http://192.168.1.14:3000//flightrates/65a11460eb2070b608d4f397?size=1000",
"pageSize": 1000
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
isRealtime | boolean | false | none | Only for realtime |
status | string | false | none | Only for realtime |
flightrates | [object] | false | none | All informations of flightrates. |
» travellers | object | false | none | This represents the number of adults and infants travelling. |
»» adults | number | false | none | The number of adults. |
»» infants | number | false | none | The number of infants. |
»» children | number | false | none | The number of children. |
» _id | string | false | none | The ID of the flight. |
» outbound | object | false | none | It represents the outbound portion of the trip, including the price, fees, number of stops, departure and arrival times, duration, with airline details. |
»» price | number | false | none | The price of the flight. |
»» baseFare | number | false | none | The base fare of the flight. |
»» feesAndOthers | number | false | none | Any other fees and other charges associated with the flight. |
»» description | string | false | none | A description of the flight. |
»» numOfStops | number | false | none | The number of stops of the flight, during the travel to the destination. |
»» metaProviderName | string | false | none | The name of the provider of the flight metadata. |
»» layover | string | false | none | The amount of time for a layover on the flight. |
»» flightStatusCode | number | false | none | The status code of the flight. |
»» departureDate | string | false | none | The departure date of the flight. |
»» departureTime | string | false | none | The departure time of the flight. |
»» arrivalDate | string | false | none | The arrival date of the flight. |
»» arrivalTime | string | false | none | The arrival time of the flight. |
»» totalDuration | string | false | none | The total duration of the flight. |
»» flightTime | string | false | none | The time of the flight. |
»» actualPrice | number | false | none | The actual base fare / price for travel in the flight. |
»» actualBaseFare | number | false | none | The actual base fare of the flight. |
»» actualFeeAndOthers | number | false | none | The actual fees and the other charges associated with the flight. |
»» _priceClass | string | false | none | Information about the price class. |
»» priceClassName | string | false | none | The name of the price class. |
»» bookingClass | string | false | none | The name of the booking class. |
»» legs | [object] | false | none | All Informations for the legs of the flight. |
»»» _id | string | false | none | The unique identifier of the legs. |
»»» origin | string | false | none | It represents the origin of a journey or trip. |
»»» destination | string | false | none | It represents the destination of a journey or trip. |
»»» description | string | false | none | It represents additional details about the journey or trip. |
»»» distance | number | false | none | It represents the distance between the origin and the destination of the journey or trip. |
»»» fbc | string | false | none | The Fare Basis Code of the leg. |
»»» seatCount | string | false | none | The number of seats on the leg. |
»»» departureDate | string | false | none | The departure date of the leg. |
»»» departureTime | string | false | none | The departure time of the leg. |
»»» arrivalDate | string | false | none | The arrival date of the leg. |
»»» arrivalTime | string | false | none | The arrival time of the leg. |
»»» airlineShortCode | string | false | none | The airline short code of the leg. |
»»» flightNumber | string | false | none | The flight number of the leg. |
»»» flightTime | string | false | none | The time of the flight. |
»»» waitTime | string | false | none | The wait time of the leg. |
»»» operatedBy | string | false | none | The operator of the leg. |
»»» _airline | string | false | none | Information about the airline of the leg. |
»»» airlineName | string | false | none | The name of the airline of the leg. |
»»» airlineCode | string | false | none | The code of the airline of the leg. |
»» baggageDetails | string | false | none | Details about the baggage on the flight. |
»» promoCode | string | false | none | The promo code of the flight. |
»» discounts | string | false | none | The discounts associated with the flight travel. |
»» taxStatus | number | false | none | The tax status of the flight. |
»» _id | string | false | none | none |
»» allFlightNumbers | [string] | false | none | All the flight numbers for the whole trip. |
»» allStopOverAirports | [string] | false | none | All the stopover airports for the whole trip. |
»» allAirlineCodes | [string] | false | none | All the airline codes for the whole trip. |
»» id | string | false | none | Id |
» flyFrom | string | false | none | The airport code for the departure location. |
» flyTo | string | false | none | The airport code for the arrival location. |
» isRoundTrip | boolean | false | none | Whether the flight is a round trip or not. |
» departDate | string | false | none | The departure date of the flight. |
» returnDate | string | false | none | The return date of the flight. |
» channelName | string | false | none | The name of the channel. |
» channelType | string | false | none | The type of the channel. |
» airlineCode | number | false | none | The Airline code. |
» totalPrice | number | false | none | The total price of the flight. |
» isRatePerPerson | boolean | false | none | Indicates whether the price given is per person or for the entire booking. |
» previousPrice | string | false | none | Represents the previous price of the booking. |
» isMultipleAirline | boolean | false | none | Indicates whether the booking involves multiple airlines. |
» collectedAt | string | false | none | Time at which the data related to this booking was collected. |
» statusCode | number | false | none | Status code |
» batchInsertionId | string | false | none | Represents the unique identifier for the batch of bookings to which this booking belongs. |
» _user | string | false | none | The User who made this booking. |
» userName | string | false | none | The username associated with the flight shop account. |
» flightTripHash | string | false | none | The unique identifier for the flight trip. |
» _flightShop | string | false | none | The details related to the flight shop. |
» flightShopName | string | false | none | The name of the flight shop where this flight data is sourced from. |
» _source | string | false | none | The source of the flight data and the channel it was sourced from. |
» sourceName | string | false | none | The name of the source from where the flight data was fetched. |
» sourceId | number | false | none | The identifier for the source of the flight data. |
» _pos | string | false | none | The point of sale information for the flight data. |
» posName | string | false | none | It is a redundant field of _POS. |
» _cabinClass | object | false | none | The cabin class information for the flight data. |
»» _id | string | false | none | The unique identifier of the cabin class. |
»» name | string | false | none | Name |
»» id | string | false | none | The unique identifier of the cabin class. |
» _currency | string | false | none | The identifier for the currency used for the flight data. |
» currencyName | string | false | none | The name of the currency used for the flight data. |
» updatedAt | string | false | none | The time when the flight data was last updated. |
» _flyFrom | string | false | none | The departure airport information for the flight data. |
» _flyTo | string | false | none | The arrival airport information for the flight data. |
» rowHash | string | false | none | A hash value is generated for the row of data to ensure the data integrity. |
» id | string | false | none | Id |
prevPageUrl | string | false | none | Previous page url for fetch previous data. |
nextPageUrl | string | false | none | Next page url for fetch next data. |
pageSize | number | false | none | The current page number to retrieve. |
Enumerated Values
Property | Value |
---|---|
error | false |
isRealtime | true |
historicalRateReq
{
"_shop": "653a22273761fad12e498947",
"collectedAt": "2023-11-17",
"page": 1,
"size": 100
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
_shop | string | false | none | Flight shop id |
collectedAt | string | false | none | Collected date |
page | number | false | none | No of page |
size | number | false | none | No of size |
historicalRateRes
{
"error": false,
"flightrates": [
{
"price": 11792,
"travellers": {
"adults": 1,
"infants": 0,
"children": 1
},
"_id": "63a59bf4533a40315c201e77",
"outbound": {
"price": 171,
"baseFare": 0,
"feesAndOthers": 0,
"description": "",
"numOfStops": 2,
"metaProviderName": "",
"layover": "13:58",
"flightStatusCode": 22,
"departureDate": "2022-08-17T00:00:00.000Z",
"departureTime": "17:55",
"arrivalDate": "2022-08-18T00:00:00.000Z",
"arrivalTime": "14:36",
"totalDuration": "19:41",
"flightTime": "05:43",
"actualPrice": 0,
"actualBaseFare": 0,
"actualFeeAndOthers": 0,
"_priceClass": "6540b8df2e9e9a091aa17df7",
"priceClassName": "Standard",
"bookingClass": "Z",
"legs": [
{
"_id": "64802d78164ff91223679439",
"origin": "CUN",
"destination": "MCO",
"description": "",
"distance": 0,
"fbc": "",
"seatCount": 1,
"departureDate": "2022-08-17T00:00:00.000Z",
"departureTime": "17:55",
"arrivalDate": "2022-08-17T00:00:00.000Z",
"arrivalTime": "21:02",
"airlineShortCode": "NK",
"flightNumber": "NK-544",
"flightTime": "02:07",
"waitTime": "10:53",
"operatedBy": "",
"_airline": "6540b8df2e9e9a091aa17df7",
"airlineName": "Air Arabia",
"airlineCode": 1
}
],
"baggageDetails": "",
"promoCode": "",
"discounts": "",
"taxStatus": 22,
"_id": "64802d78164ff9122367943c",
"allFlightNumbers": [
"NK-544, NK-195,NK-145"
],
"allStopOverAirports": [
[
"CUN,",
"FLL,",
"SDQ,",
"MCQ"
]
],
"allAirlineCodes": [
[
"1,",
"1,",
1
]
],
"id": "64802d78164ff9122367943c"
},
"flyFrom": "CUN",
"flyTo": "SDQ",
"isRoundTrip": false,
"departDate": "2022-08-17T00:00:00.000Z",
"returnDate": "2022-08-18T00:00:00.000Z",
"channelName": "Spirit",
"channelType": "brand",
"airlineCode": 35,
"totalPrice": 244,
"isRatePerPerson": false,
"isMultipleAirline": false,
"collectedAt": "2022-07-16T18:52:57.214Z",
"statusCode": 200,
"batchInsertionId": "6448ce36bc44695e8914a8c2",
"_user": "6540b8df2e9e9a091aa17df7",
"userName": "user@flightrates.com",
"flightTripHash": "",
"_flightShop": "6540b8df2e9e9a091aa17df7",
"flightShopName": "Test Jetblue_copaair",
"_source": "6540b8df2e9e9a091aa17df7",
"sourceName": "Biman Bangladesh Airlines",
"sourceId": 1,
"_pos": "6540b8df2e9e9a091aa17df7",
"posName": "My Code",
"_cabinClass": {
"_id": "6013a6abf553c71d4dfbe92b",
"name": "Economy",
"id": "6013a6abf553c71d4dfbe92b"
},
"_currency": "5fa104806304832acf9c67e9",
"currencyName": "AED",
"updatedAt": "2022-12-28T05:48:30.669Z",
"_flyFrom": "5fa104806304832acf9c67e9",
"_flyTo": "5fa104806304832acf9c67e9",
"rowHash": "YyX",
"id": "63a59bf4533a40315c201e5f"
}
],
"totalData": 1,
"totalPages": 1,
"page": 1,
"size": 10
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
flightrates | [object] | false | none | All informations of flightrates. |
» price | number | false | none | Collected date price |
» travellers | object | false | none | This represents the number of adults and infants travelling. |
»» adults | number | false | none | The number of adults. |
»» infants | number | false | none | The number of infants. |
»» children | number | false | none | The number of children. |
» _id | string | false | none | The ID of the flight. |
» outbound | object | false | none | It represents the outbound portion of the trip, including the price, fees, number of stops, departure and arrival times, duration, with airline details. |
»» price | number | false | none | The price of the flight. |
»» baseFare | number | false | none | The base fare of the flight. |
»» feesAndOthers | number | false | none | Any other fees and other charges associated with the flight. |
»» description | string | false | none | A description of the flight. |
»» numOfStops | number | false | none | The number of stops of the flight, during the travel to the destination. |
»» metaProviderName | string | false | none | The name of the provider of the flight metadata. |
»» layover | string | false | none | The amount of time for a layover on the flight. |
»» flightStatusCode | number | false | none | The status code of the flight. |
»» departureDate | string | false | none | The departure date of the flight. |
»» departureTime | string | false | none | The departure time of the flight. |
»» arrivalDate | string | false | none | The arrival date of the flight. |
»» arrivalTime | string | false | none | The arrival time of the flight. |
»» totalDuration | string | false | none | The total duration of the flight. |
»» flightTime | string | false | none | The time of the flight. |
»» actualPrice | number | false | none | The actual base fare / price for travel in the flight. |
»» actualBaseFare | number | false | none | The actual base fare of the flight. |
»» actualFeeAndOthers | number | false | none | The actual fees and the other charges associated with the flight. |
»» _priceClass | string | false | none | Information about the price class. |
»» priceClassName | string | false | none | The name of the price class. |
»» bookingClass | string | false | none | The name of the booking class. |
»» legs | [object] | false | none | All Informations for the legs of the flight. |
»»» _id | string | false | none | The unique identifier of the legs. |
»»» origin | string | false | none | It represents the origin of a journey or trip. |
»»» destination | string | false | none | It represents the destination of a journey or trip. |
»»» description | string | false | none | It represents additional details about the journey or trip. |
»»» distance | number | false | none | It represents the distance between the origin and the destination of the journey or trip. |
»»» fbc | string | false | none | The Fare Basis Code of the leg. |
»»» seatCount | string | false | none | The number of seats on the leg. |
»»» departureDate | string | false | none | The departure date of the leg. |
»»» departureTime | string | false | none | The departure time of the leg. |
»»» arrivalDate | string | false | none | The arrival date of the leg. |
»»» arrivalTime | string | false | none | The arrival time of the leg. |
»»» airlineShortCode | string | false | none | The airline short code of the leg. |
»»» flightNumber | string | false | none | The flight number of the leg. |
»»» flightTime | string | false | none | The time of the flight. |
»»» waitTime | string | false | none | The wait time of the leg. |
»»» operatedBy | string | false | none | The operator of the leg. |
»»» _airline | string | false | none | Information about the airline of the leg. |
»»» airlineName | string | false | none | The name of the airline of the leg. |
»»» airlineCode | string | false | none | The code of the airline of the leg. |
»» baggageDetails | string | false | none | Details about the baggage on the flight. |
»» promoCode | string | false | none | The promo code of the flight. |
»» discounts | string | false | none | The discounts associated with the flight travel. |
»» taxStatus | number | false | none | The tax status of the flight. |
»» _id | string | false | none | none |
»» allFlightNumbers | [string] | false | none | All the flight numbers for the whole trip. |
»» allStopOverAirports | [string] | false | none | All the stopover airports for the whole trip. |
»» allAirlineCodes | [string] | false | none | All the airline codes for the whole trip. |
»» id | string | false | none | Id |
» flyFrom | string | false | none | The airport code for the departure location. |
» flyTo | string | false | none | The airport code for the arrival location. |
» isRoundTrip | boolean | false | none | Whether the flight is a round trip or not. |
» departDate | string | false | none | The departure date of the flight. |
» returnDate | string | false | none | The return date of the flight. |
» channelName | string | false | none | The name of the channel. |
» channelType | string | false | none | The type of the channel. |
» airlineCode | number | false | none | The Airline code. |
» totalPrice | number | false | none | The total price of the flight. |
» isRatePerPerson | boolean | false | none | Indicates whether the price given is per person or for the entire booking. |
» isMultipleAirline | boolean | false | none | Indicates whether the booking involves multiple airlines. |
» collectedAt | string | false | none | Time at which the data related to this booking was collected. |
» statusCode | number | false | none | Status code |
» batchInsertionId | string | false | none | Represents the unique identifier for the batch of bookings to which this booking belongs. |
» _user | string | false | none | The User who made this booking. |
» userName | string | false | none | The username associated with the flight shop account. |
» flightTripHash | string | false | none | The unique identifier for the flight trip. |
» _flightShop | string | false | none | The details related to the flight shop. |
» flightShopName | string | false | none | The name of the flight shop where this flight data is sourced from. |
» _source | string | false | none | The source of the flight data and the channel it was sourced from. |
» sourceName | string | false | none | The name of the source from where the flight data was fetched. |
» sourceId | number | false | none | The identifier for the source of the flight data. |
» _pos | string | false | none | The point of sale information for the flight data. |
» posName | string | false | none | It is a redundant field of _POS. |
» _cabinClass | object | false | none | The cabin class information for the flight data. |
»» _id | string | false | none | The unique identifier of the cabin class. |
»» name | string | false | none | Name |
»» id | string | false | none | The unique identifier of the cabin class. |
» _currency | string | false | none | The identifier for the currency used for the flight data. |
» currencyName | string | false | none | The name of the currency used for the flight data. |
» updatedAt | string | false | none | The time when the flight data was last updated. |
» _flyFrom | string | false | none | The departure airport information for the flight data. |
» _flyTo | string | false | none | The arrival airport information for the flight data. |
» rowHash | string | false | none | A hash value is generated for the row of data to ensure the data integrity. |
» id | string | false | none | Id |
totalData | number | false | none | The total data of the flightrates. |
totalPages | number | false | none | The total number of pages available in the response. |
page | number | false | none | The current page number to retrieve. |
size | number | false | none | The number of items to be displayed per page. |
Enumerated Values
Property | Value |
---|---|
error | false |
hooksFindResp
{
"error": false,
"hooks": [
{
"_id": "63ff246fb2482db1c660e310",
"_user": "63fda531bde67155fc46fb41",
"userName": "user@flightrates.com",
"endPoint": "//latest",
"authType": "Personal",
"userId": "RM123",
"pwdTxt": "uuxx",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6I",
"hookType": "dbs",
"isActiveStatus": true,
"_shop": "63fdc414cccc3592d31b3ac8",
"vertical": "flightrates",
"isCustomerCreated": true,
"id": "63ff246fb2482db1c660e310"
}
],
"totalData": 1,
"totalPages": 1,
"page": 1,
"size": 1
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
hooks | [object] | false | none | none |
» _id | string | false | none | The unique identifier of the hook. |
» _user | string | false | none | The ID of the user associated with the hook. |
» userName | string | false | none | The name of the user associated with the hook. |
» endPoint | string | false | none | The endpoint URL for the hook. |
» authType | string | false | none | The type of authentication used for the hook. |
» userId | string | false | none | The ID of the user associated with the hook. |
» pwdTxt | string | false | none | The password for the hook. |
» token | string | false | none | The authentication token for the hook. |
» hookType | string | false | none | The type of hook |
» isActiveStatus | boolean | false | none | The status of the hook (active or inactive). |
» _shop | string | false | none | The ID of the shop associated with the hook. |
» vertical | string | false | none | The vertical associated with the hook. |
» isCustomerCreated | boolean | false | none | Whether the hook was created by a customer (e.g. "true"). |
» id | string | false | none | The ID of the hook. |
totalData | number | false | none | The total data |
totalPages | number | false | none | The total number of pages available in the response. |
page | number | false | none | The current page number to retrieve. |
size | number | false | none | The number of items to be displayed per page. |
Enumerated Values
Property | Value |
---|---|
error | false |
hooksGetResp
{
"error": false,
"hook": {
"_id": "63ff246fb2482db1c660e310",
"_user": "63fda531bde67155fc46fb41",
"userName": "user@flightrates.com",
"endPoint": "//my-hook",
"authType": "jwt",
"userId": "63fda531bde67155fc46fb4",
"pwdTxt": "demo1",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6I",
"hookType": "dbs",
"isActiveStatus": true,
"_shop": "63fdc414cccc3592d31b3ac8",
"vertical": "flightrates",
"isCustomerCreated": true,
"id": "63ff246fb2482db1c660e310"
}
}
The Details of the hooks.
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
hook | object | false | none | none |
» _id | string | false | none | A unique identifier for the hook response. |
» _user | string | false | none | The user who created the hook. |
» userName | string | false | none | The username of the user who created the hook. |
» endPoint | string | false | none | The API endpoint for the hook. |
» authType | string | false | none | The type of authentication used for the hook. |
» userId | string | false | none | The user ID associated with the hook. |
» pwdTxt | string | false | none | The password text for the hook. |
» token | string | false | none | The token generated for the hook. |
» hookType | string | false | none | The type of hook. |
» isActiveStatus | boolean | false | none | Indicates whether the hook is currently active or not. |
» _shop | string | false | none | The ID of the shop associated with the hook. |
» vertical | string | false | none | The vertical that the hook is associated with. |
» isCustomerCreated | boolean | false | none | It Indicates whether the customer associated with the hook has been created or not. |
» id | string | false | none | The ID of the hook response. |
Enumerated Values
Property | Value |
---|---|
error | false |
hooksPostReq
{
"endPoint": "//my-hook",
"authType": "jwt",
"userId": "63fda531bde67155fc46fb4",
"pwdTxt": "uuxx",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6I",
"hookType": "dbs",
"isActiveStatus": true,
"_shop": "63fdc414cccc3592d31b3ac8"
}
Create hook
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
endPoint | string | true | none | The endpoint of the hook. |
authType | string | false | none | The type of authentication used for the hook. |
userId | string | false | none | The ID of the user associated with the hook. |
pwdTxt | string | false | none | The password text associated with the hook. |
token | string | false | none | The authentication token associated with the hook. |
hookType | string | true | none | The type of hook. |
isActiveStatus | boolean | true | none | Indicating whether the hook is active or not. |
_shop | string | true | none | The ID of the shop associated with the hook. |
hooksPostResp
{
"error": false,
"hook": {
"_user": "63fda531bde67155fc46fb41",
"userName": "user@flightrates.com",
"endPoint": "//my-hook",
"authType": "jwt",
"userId": "63fda531bde67155fc46fb4",
"pwdTxt": "demo1",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6I",
"hookType": "dbs",
"isActiveStatus": true,
"_shop": "63fdc414cccc3592d31b3ac8",
"vertical": "flightrates",
"isCustomerCreated": true,
"id": "63ff246fb2482db1c660e310"
}
}
Information of the hooks
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
hook | object | false | none | none |
» _user | string | false | none | The id of the user, who created the hook. |
» userName | string | false | none | The username of the user, who created the hook. |
» endPoint | string | false | none | Representing the endpoint of the hook. |
» authType | string | false | none | Represents the authentication type used for the hook. |
» userId | string | false | none | ID associated with the hook. |
» pwdTxt | string | false | none | The password used for authentication with the hook. |
» token | string | false | none | The token used for the authentication with the hook. |
» hookType | string | false | none | The type of hooks. |
» isActiveStatus | boolean | false | none | The status of the hook. |
» _shop | string | false | none | ID of the shop associated with the hook. |
» vertical | string | false | none | The vertical for which the hook is created. |
» isCustomerCreated | boolean | false | none | It Representins whether the customer has been created for the hook. |
» id | string | false | none | The id of the hook. |
Enumerated Values
Property | Value |
---|---|
error | false |
schedulesFindResp
{
"error": false,
"schedules": [
{
"_id": "63ff1e0bb2482db1c660e306",
"scheduleName": "flightrates Schedules",
"_shop": "63fdd677a631b4a452c34b24",
"_timezone": "63fdd677a631b4a452c34b22",
"timezoneName": "asia/kol",
"dayOfMonth": "*",
"month": "*",
"dayOfWeek": "*",
"hour": "*",
"minute": "0",
"crontabExpression": "0 * * * *",
"crontabHuman": "Every minute, every hour, every day",
"isActiveStatus": true,
"startDate": "2019-08-24",
"endDate": "2019-08-24",
"_user": "63fda531bde67155fc46fb41",
"userName": "user@flightrates.com",
"vertical": "flightrates",
"isCustomerCreated": "true,",
"createdAt": "2023-03-01T09:42:35.372Z",
"updatedAt": "2023-03-03T06:22:55.108Z",
"id": "63ff1e0bb2482db1c660e306"
}
],
"totalData": 1,
"totalPages": 1,
"page": 1,
"size": 10
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
schedules | [object] | false | none | none |
» _id | string | false | none | A unique identifier for the schedule. |
» scheduleName | string | false | none | The name of the schedule. |
» _shop | string | false | none | A reference to the shop that the schedule belongs to. |
» _timezone | string | false | none | A reference to the timezone that the schedule uses. |
» timezoneName | string | false | none | The name of the timezone. |
» dayOfMonth | string | false | none | Specifies the day(s) of the month for the schedule. |
» month | string | false | none | Specifies the month(s) for the schedule. |
» dayOfWeek | number | false | none | Specifies the day(s) of the week for the schedule. |
» hour | string | false | none | Specifies the hour(s) for the schedule. |
» minute | string | false | none | Specifies the minute(s) for the schedule. |
» crontabExpression | string | false | none | Cron tab expression for scheduling. |
» crontabHuman | string | false | none | Readable description of the cron tab expression. |
» isActiveStatus | boolean | false | none | Indicates whether the schedule is active or not. |
» startDate | string(date) | false | none | The start date of the schedule. |
» endDate | string(date) | false | none | The end date of the schedule. |
» _user | string | false | none | A reference to the user, who created the schedule. |
» userName | string | false | none | The name of the user, who created the schedule. |
» vertical | string | false | none | The vertical to which the schedule belongs to. |
» isCustomerCreated | boolean | false | none | Indicates whether the schedule was created by a customer or not. |
» createdAt | string | false | none | The date and time, when the schedule was created. |
» updatedAt | string | false | none | The date and time, when the schedule was last updated. |
» id | string | false | none | A unique identifier for the schedule. |
totalData | number | false | none | The total data. |
totalPages | number | false | none | The total number of pages available in the response. |
page | number | false | none | The current page number to retrieve. |
size | number | false | none | The number of items to be displayed per page. |
Enumerated Values
Property | Value |
---|---|
error | false |
schedulesGetResp
{
"error": false,
"schedule": {
"_id": "63ff1e0bb2482db1c660e306",
"scheduleName": "Flightschedule name",
"_shop": "63fdd677a631b4a452c34b24",
"_timezone": "63fdd677a631b4a452c34b22",
"timezoneName": "asia/kol",
"dayOfMonth": "*",
"month": "*",
"dayOfWeek": "*",
"hour": "*",
"minute": "0",
"crontabExpression": "0 * * * *",
"crontabHuman": "Every minute, every hour, every day",
"isActiveStatus": true,
"startDate": "2019-08-24",
"endDate": "2019-08-24",
"_user": "63fda531bde67155fc46fb41",
"userName": "user@flightrates.com",
"vertical": "flightrates",
"isCustomerCreated": "true,",
"createdAt": "2023-03-01T09:42:35.372Z",
"updatedAt": "2023-03-03T06:22:55.108Z",
"id": "63ff1e0bb2482db1c660e306"
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
schedule | object | false | none | none |
» _id | string | false | none | A unique identifier for the schedule. |
» scheduleName | string | false | none | The name of the schedule. |
» _shop | string | false | none | It represents the shop identifier to which this schedule belongs to. |
» _timezone | string | false | none | It represents the timezone identifier for the schedule. |
» timezoneName | string | false | none | It represents the timezone name for the schedule. |
» dayOfMonth | string | false | none | Day of month expression. |
» month | string | false | none | It represents the month for which the schedule is applicable. |
» dayOfWeek | number | false | none | It represents the day of week for which the schedule is applicable. |
» hour | string | false | none | It represents the hour for which the schedule is applicable. |
» minute | string | false | none | It represents the minute for which the schedule is applicable. |
» crontabExpression | string | false | none | Cron tab expression for scheduling. |
» crontabHuman | string | false | none | Readable description of the cron tab expression. |
» isActiveStatus | boolean | false | none | It represents the status of the schedule. |
» startDate | string(date) | false | none | It represents the start date of the schedule. |
» endDate | string(date) | false | none | It represents the end date of the schedule. |
» _user | string | false | none | The user identifier, who created the schedule. |
» userName | string | false | none | The user name, who created the schedule. |
» vertical | string | false | none | It represents the vertical for which the schedule is applicable. |
» isCustomerCreated | boolean | false | none | It represents whether the schedule was created by a customer. |
» createdAt | string | false | none | The date and time when the schedule was created. |
» updatedAt | string | false | none | The date and time when the schedule was last updated. |
» id | string | false | none | A unique identifier for the schedule. |
Enumerated Values
Property | Value |
---|---|
error | false |
schedulePostReq
{
"scheduleName": "Flightschedule name",
"_shops": [
"66fbd773cfa2fa105752dc26"
],
"_timezone": "64ae7e58d06e77f95bff0565",
"dayOfMonth": "*",
"month": "*",
"dayOfWeek": "*",
"hour": "*",
"minute": "0",
"isActiveStatus": true,
"startDate": "2019-08-24",
"endDate": "2019-08-24"
}
The Informations regarding schedule creation.
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
scheduleName | string | true | none | A name given to the schedule resource. |
_shops | [string] | true | none | A list of unique identifiers for the shops associated with the schedule. |
_timezone | string | true | none | The unique identifier for the timezone associated with the schedule. |
dayOfMonth | string | true | none | The day of month expression. |
month | string | true | none | The month for which the schedule is applicable. |
dayOfWeek | string | true | none | The day of the week for which the schedule is applicable. |
hour | string | true | none | The hour of the day for which the schedule is applicable. |
minute | string | true | none | The minute of the hour for which the schedule is applicable. |
isActiveStatus | boolean | true | none | The status of the schedule, whether it is currently active or not. |
startDate | string(date) | true | none | The date on which the schedule becomes applicable. |
endDate | string(date) | true | none | The date on which the schedule expires. |
schedulePostResp
{
"error": false,
"schedule": {
"scheduleName": "Flightschedule name",
"_shop": "63fdd677a631b4a452c34b24",
"_timezone": "63fdd677a631b4a452c34b22",
"dayOfMonth": "*",
"month": "*",
"dayOfWeek": "*",
"hour": "*",
"minute": "0",
"crontabExpression": "0 * * * *",
"crontabHuman": "Every minute, every hour, every day",
"timezoneName": "Africa/Addis_Ababa",
"isActiveStatus": true,
"startDate": "2019-08-24",
"endDate": "2019-08-24",
"_user": "63fda531bde67155fc46fb41",
"userName": "user@flightrates.com",
"vertical": "flightrates",
"isCustomerCreated": "true,",
"createdAt": "2023-03-01T09:42:35.372Z",
"id": "63ff1e0bb2482db1c660e306"
}
}
Schedule information
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
schedule | object | false | none | none |
» scheduleName | string | false | none | The name of the schedule to be created. |
» _shop | string | false | none | The unique identifier of the shop that the schedule belongs to. |
» _timezone | string | false | none | The unique identifier of the timezone that the schedule belongs to. |
» dayOfMonth | string | false | none | The day of month expression. |
» month | string | false | none | The month for which the schedule is applicable. |
» dayOfWeek | string | false | none | The day of the week for which the schedule is applicable. |
» hour | string | false | none | The hour of the day for which the schedule is applicable. |
» minute | string | false | none | The minute of the hour for which the schedule is applicable. |
» crontabExpression | string | false | none | Cron tab expression for scheduling. |
» crontabHuman | string | false | none | Readable description of the cron tab expression. |
» timezoneName | string | false | none | Timezone name redandant fields. |
» isActiveStatus | boolean | false | none | It indicates whether the schedule is active or not. |
» startDate | string(date) | false | none | The start date of the schedule. |
» endDate | string(date) | false | none | The end date of the schedule. |
» _user | string | false | none | The unique identifier of the user who created the schedule. |
» userName | string | false | none | The name of the user who created the schedule. |
» vertical | string | false | none | The vertical category of the schedule. |
» isCustomerCreated | boolean | false | none | It indicates whether the schedule is created by a customer or not. |
» createdAt | string | false | none | The creation date and time of the schedule. |
» id | string | false | none | The unique identifier of the schedule. |
Enumerated Values
Property | Value |
---|---|
error | false |
schedulePutReq
{
"scheduleName": "Flightschedule name",
"_timezone": "64ae7e58d06e77f95bff059c",
"_shop": "66fbd773cfa2fa105752dc26",
"dayOfMonth": "*",
"month": "*",
"dayOfWeek": "*",
"hour": "*",
"minute": "0",
"isActiveStatus": true,
"startDate": "2019-08-24",
"endDate": "2019-08-24"
}
Schedule information
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
scheduleName | string | false | none | It represents the name of the Schedule being updated. |
_timezone | string | false | none | A reference to the timezone that the schedule uses. |
_shop | string | false | none | The ID of the shop associated with the schedule uses. |
dayOfMonth | string | false | none | Specifies the day(s) of the month for the schedule. |
month | string | false | none | Specifies the month(s) for the schedule. |
dayOfWeek | number | false | none | Specifies the day(s) of the week for the schedule. |
hour | string | false | none | Specifies the hour(s) for the schedule. |
minute | string | false | none | Specifies the minute(s) for the schedule. |
isActiveStatus | boolean | false | none | It indicates whether the Schedule is active or not. |
startDate | string(date) | false | none | It represents the start date for the Schedule. |
endDate | string(date) | false | none | The end date of the schedule. |
scheduleTriggerReq
{
"shopId": "6507eb74b53967089ac9736b"
}
Shop information
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
shopId | string | false | none | Provide valid shop id |
scheduleTriggerRes
{
"error": false,
"message": "Request accepted ✅!!"
}
Response of realtime request
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | If error occured the value will be true otherwise false |
message | string | false | none | Response from service |
schedulePutResp
{
"error": false,
"schedule": {
"scheduleName": "Flightschedule name",
"_timezone": "64ae7e58d06e77f95bff0565",
"_shop": "66fbd773cfa2fa105752dc26",
"dayOfMonth": "*",
"month": "*",
"dayOfWeek": "*",
"hour": "*",
"minute": "0",
"isActiveStatus": true,
"startDate": "2019-08-24",
"endDate": "2019-08-24",
"_user": "6411b27b79d2c995fc689c4b",
"userName": "user@flightrates.com",
"vertical": "flightrates",
"isCustomerCreated": true,
"createdAt": "2023-03-10T06:30:25.288Z",
"updatedAt": "2023-03-10T06:30:25.288Z",
"id": "640ace815353bdb6454e191b"
}
}
Schedule informations.
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
schedule | object | false | none | none |
» scheduleName | string | false | none | It represents the name of the Schedule being updated. |
» _timezone | string | false | none | A reference to the timezone that the schedule uses. |
» _shop | string | false | none | The ID of the shop associated with the schedule uses. |
» dayOfMonth | string | false | none | Specifies the day(s) of the month for the schedule. |
» month | string | false | none | Specifies the month(s) for the schedule. |
» dayOfWeek | number | false | none | Specifies the day(s) of the week for the schedule. |
» hour | string | false | none | Specifies the hour(s) for the schedule. |
» minute | string | false | none | Specifies the minute(s) for the schedule. |
» isActiveStatus | boolean | false | none | It indicates whether the Schedule is active or not. |
» startDate | string(date) | false | none | It represents the start date for the Schedule. |
» endDate | string(date) | false | none | The end date of the schedule. |
» _user | string | false | none | The customer Id. |
» userName | string | false | none | Username redunant fields |
» vertical | string | false | none | Vertical type / category of product mentioned |
» isCustomerCreated | boolean | false | none | It represents whether the Schedule was created by a customer or not. |
» createdAt | string | false | none | The date and time the Schedule was created. |
» updatedAt | string | false | none | The date and time the Schedule was last updated. |
» id | string | false | none | The ID of the Schedule. |
Enumerated Values
Property | Value |
---|---|
error | false |
shopsPostReq
{
"_OD": [
{
"_flyFrom": "62b943e4dd59913b61a6b15b",
"_flyTo": "62b943e4dd59913b61a6b15c"
}
],
"_sources": [
"6239aec26c3c588d8f64ecfc"
],
"_alternateSources": [
"61515e50b77f75890e8acbaf"
],
"_cabinClasses": [
"6013a6abf553c71d4dfbe92d"
],
"_carriers": [
"6013a6abf553c71d4dfbe92d"
],
"isRoundTrip": false,
"los": 1,
"horizons": [
"0",
"3-10",
"02/05/2025",
"10/06/2025-10/08/2025"
],
"pax": {
"adults": 1,
"infants": 0,
"children": 0
},
"noOfStops": "1",
"duration": {
"hour": 40,
"minute": 30
},
"fareType": "Doctors",
"startDate": "2019-08-24",
"_pos": "62a2e3ca581567e3cd67ce1a",
"_currency": "5fa104806304832acf9c67f5",
"shopName": "Flightshop name",
"deliveryMode": [
"db"
],
"isActiveStatus": true
}
Shops informations.
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
_OD | [object] | true | none | All Informations about the origin and destination of the whole trip. |
» _flyFrom | string | true | none | The ID of the origin location of the trip. |
» _flyTo | string | true | none | The ID of the destination location of the trip. |
_sources | [string] | true | none | The IDs of the sources used for the search. |
_alternateSources | [string] | true | none | The IDs of the alternate sources used for the search. |
_cabinClasses | [string] | true | none | The IDs of the cabin classes used for the search. |
_carriers | [string] | false | none | It represents the list of airlines. |
isRoundTrip | boolean | true | none | The value indicating whether the trip is round-trip or not. |
los | number | true | none | This represents the length of stay in the destination location. |
horizons | any | true | none | It represents the horizons of the shop's flights date format must be DD/MM/YYYY. |
pax | object | true | none | Information about the passengers. |
» adults | number | false | none | This represents the number of the adult passengers. |
» infants | number | false | none | This represents the number of the infant passengers. |
» children | number | false | none | This represents the number of child passengers. |
noOfStops | string | true | none | This represents the number of stops in the trip. |
duration | object | true | none | The duration of the trip. |
» hour | number | false | none | The total duration in hours. |
» minute | number | false | none | The duration in minute. |
fareType | string | true | none | This represents the type of fare used for the search. |
startDate | string(date) | true | none | This represents the start date of the search. |
_pos | string | true | none | The ID of the point of sale. |
_currency | string | true | none | The ID of the currency used for the search. |
shopName | string | true | none | The name of the shop. |
deliveryMode | [string] | true | none | It represents the list of delivery mode(s) used for the search. |
isActiveStatus | boolean | true | none | It indicates the search is active or not. |
Enumerated Values
Property | Value |
---|---|
fareType | Regular |
fareType | Defence |
fareType | Doctors |
fareType | Senior Citizen |
fareType | Students |
shopsPostResp
{
"error": false,
"shop": {
"_OD": [
{
"OD": "MAKZIA",
"_flyFrom": "62b943e4dd59913b61a6b15b",
"_flyTo": "62b943e4dd59913b61a6b15c"
}
],
"_sources": [
"6239aec26c3c588d8f64ecfc"
],
"_alternateSources": [
"61515e50b77f75890e8acbaf"
],
"_cabinClasses": [
"6013a6abf553c71d4dfbe92d"
],
"_carriers": [
"6013a6abf553c71d4dfbe92d"
],
"isRoundTrip": true,
"horizons": [
"0",
"3-10",
"02/05/2025",
"10/06/2025-10/08/2025"
],
"pax": {
"adults": 1,
"children": 0,
"infants": 0
},
"duration": {
"hour": 30,
"minute": 35
},
"fareType": "Doctors",
"noOfStops": "1",
"startDate": "2019-08-24",
"_pos": "62a2e3ca581567e3cd67ce1a",
"_currency": "5fa104806304832acf9c67f5",
"shopName": "Flightshop name",
"_user": "6411b27b79d2c995fc689c4b",
"userName": "user@flightrates.com",
"vertical": "flightrates",
"posName": "POS/123",
"los": 1,
"deliveryMode": [
"db"
],
"isActiveStatus": true,
"_id": "64b7c6c54c5f10de6f433ca6",
"isCustomerCreated": true,
"createdAt": "2023-03-10T06:30:25.288Z",
"id": "640ace815353bdb6454e191b"
}
}
Shop informations.
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
shop | object | false | none | none |
» _OD | [object] | false | none | It represents the list of origin-destination pairs for the shop's flights. |
»» OD | string | false | none | none |
»» _flyFrom | string | false | none | The departure airport. |
»» _flyTo | string | false | none | Thr arrival airport. |
» _sources | [string] | false | none | This represents the list of sources of the shop's flights. |
» _alternateSources | [string] | false | none | This represents the list of alternate sources of the shop's flights. |
» _cabinClasses | [string] | false | none | It represents the list of cabin classes of the shop's flights. |
» _carriers | [string] | false | none | It represents the list of airlines. |
» isRoundTrip | boolean | false | none | This indicates whether the shop's flights are for a round-trip. |
» horizons | array | false | none | It represents the horizons of the shop's flights date format must be DD/MM/YYYY. |
» pax | object | false | none | The number of adults, children, and infants for the shop's flights. |
»» adults | number | false | none | The informations of the adult passengers. |
»» children | number | false | none | The information of the children passengers. |
»» infants | number | false | none | The information of the Infant passengers. |
» duration | object | false | none | The duration of the shop's flights in hours and minutes. |
»» hour | number | false | none | Time in hours. |
»» minute | number | false | none | Time in minutes. |
» fareType | string | false | none | It represents the type of fare for the shop's flights. |
» noOfStops | string | false | none | The number of stops for the shop's flights. |
» startDate | string(date) | false | none | The start date of the shop's flights. |
» _pos | string | false | none | The point of sale of the shop. |
» _currency | string | false | none | The currency of the shop. |
» shopName | string | false | none | The name of the shop. |
» _user | string | false | none | The customer ID associated with the shop. |
» userName | string | false | none | The username redunant fields |
» vertical | string | false | none | The vertical type/category of product as mentioned |
» posName | string | false | none | Pos name is point of sale code |
» los | number | false | none | It represents the length of stay for the shop. |
» deliveryMode | [string] | false | none | It represents the list of delivery mode for the shop. |
» isActiveStatus | boolean | false | none | It represents the active status of the shop. |
» _id | string | false | none | The id of the shop. |
» isCustomerCreated | boolean | false | none | It indicates whether the shop was created by a customer. |
» createdAt | string | false | none | The date and time of the shop's creation. |
» id | string | false | none | The id of the shop. |
Enumerated Values
Property | Value |
---|---|
error | false |
fareType | Regular |
fareType | Defence |
fareType | Doctors |
fareType | Senior Citizen |
fareType | Students |
shopsFindResp
{
"error": false,
"shops": [
{
"_OD": [
{
"OD": "YXUYIB",
"_flyFrom": "62b943e4dd59913b61a6b15b",
"_flyTo": "62b943e4dd59913b61a6b15c"
}
],
"_sources": [
"6239aec26c3c588d8f64ecfc"
],
"_alternateSources": [
"61515e50b77f75890e8acbaf"
],
"_cabinClasses": [
"6013a6abf553c71d4dfbe92d"
],
"_carriers": [
"6013a6abf553c71d4dfbe92d"
],
"isRoundTrip": true,
"horizons": [
"0",
"3-10",
"02/05/2025",
"10/06/2025-10/08/2025"
],
"pax": {
"adults": 1,
"infants": 0,
"children": 0
},
"noOfStops": "1",
"los": 1,
"duration": {
"hour": 30,
"minute": 33
},
"fareType": "Regular",
"startDate": "2019-08-24",
"_pos": "62a2e3ca581567e3cd67ce1a",
"_currency": "5fa104806304832acf9c67f5",
"shopName": "Flightshop name",
"_user": "6411b27b79d2c995fc689c4b",
"userName": "user@flightrates.com",
"vertical": "flightrates",
"posName": "POS/123",
"isCustomerCreated": true,
"deliveryMode": [
"db"
],
"isActiveStatus": true,
"_id": "66fbd773cfa2fa105752dc26",
"createdAt": "2023-03-10T06:30:25.288Z",
"updatedAt": "2023-03-10T06:30:25.288Z",
"id": "640ace815353bdb6454e191b"
}
],
"totalData": 3,
"totalPages": 2,
"page": 1,
"size": 2
}
Information of hooks
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
shops | [object] | false | none | none |
» _OD | [object] | false | none | A list of Informations about the origin and destination of a flight. |
»» OD | string | false | none | none |
»» _flyFrom | string | false | none | Departure airport. |
»» _flyTo | string | false | none | Arrival airport. |
» _sources | [string] | false | none | It represents the list of sources of the flight information. |
» _alternateSources | [string] | false | none | It represents the list of alternate sources of the flight information. |
» _cabinClasses | [string] | false | none | It represents the list of cabin classes available for the flight. |
» _carriers | [string] | false | none | It represents the list of airlines. |
» isRoundTrip | boolean | false | none | Whether the flight is a round-trip or not. |
» horizons | array | false | none | It represents the list of horizons of the flight date format must be DD/MM/YYYY. |
» pax | object | false | none | The number of adults, infants, and children travelling in the trip. |
»» adults | number | false | none | The number of adults travelling. |
»» infants | number | false | none | The number of infants travelling. |
»» children | number | false | none | The number of children travelling. |
» noOfStops | string | false | none | The number of stops for the flight. |
» los | number | false | none | It represents the length of stay. |
» duration | object | false | none | The duration of the flight. |
»» hour | number | false | none | The duration in hours. |
»» minute | number | false | none | The duration in minutes. |
» fareType | string | false | none | The type of fare. |
» startDate | string(date) | false | none | The start date of the flight. |
» _pos | string | false | none | The point of sale. |
» _currency | string | false | none | The currency used for the transaction. |
» shopName | string | false | none | The name of the shop. |
» _user | string | false | none | The customer Id. |
» userName | string | false | none | Username redunant fields |
» vertical | string | false | none | The vertical type/category of product as mentioned |
» posName | string | false | none | Pos name is point of sale code |
» isCustomerCreated | boolean | false | none | Customer created or not boolean value |
» deliveryMode | [string] | false | none | It represents a list of the delivery mode. |
» isActiveStatus | boolean | false | none | This indicates whether the status is active or not. |
» _id | string | false | none | The unique ID of the entry. |
» createdAt | string | false | none | It represents the date and time the entry was created. |
» updatedAt | string | false | none | It represents the date and time the entry was last updated. |
» id | string | false | none | The ID of the entry. |
totalData | number | false | none | The total data of shops. |
totalPages | number | false | none | The total number of pages available in the response. |
page | number | false | none | The current page number to retrieve. |
size | number | false | none | The number of items to be displayed per page. |
Enumerated Values
Property | Value |
---|---|
error | false |
fareType | Regular |
fareType | Defence |
fareType | Doctors |
fareType | Senior Citizen |
fareType | Students |
realtimePostReq
{
"_OD": [
{
"_flyFrom": "62b943e4dd59913b61a6b15b",
"_flyTo": "62b943e4dd59913b61a6b15c"
}
],
"_source": "64ae65cfd06e77f95bfefd8c",
"_cabinClasses": [
"6013a6abf553c71d4dfbe92d"
],
"_carriers": [
"64ae65cfd06e77f95bfefe36"
],
"isRoundTrip": false,
"los": 1,
"horizons": [
"0",
"3-10",
"02/05/2025",
"10/06/2025-10/08/2025"
],
"pax": {
"adults": 1,
"infants": 0,
"children": 0
},
"noOfStops": "1",
"duration": {
"hour": 40,
"minute": 30
},
"fareType": "Doctors",
"_pos": "62a2e3ca581567e3cd67ce1a",
"_currency": "5fa104806304832acf9c67f5",
"deliveryMode": [
"db"
]
}
Real Time Shop Attributes
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
_OD | [object] | true | none | All Informations about the origin and destination of the whole trip. |
» _flyFrom | string | true | none | The ID of the origin location of the trip. |
» _flyTo | string | true | none | The ID of the destination location of the trip. |
_source | string | true | none | The Id of the source used for the search. |
_cabinClasses | [string] | true | none | The IDs of the cabin classes used for the search. |
_carriers | [string] | false | none | It represents the list of airlines. |
isRoundTrip | boolean | true | none | The value indicating whether the trip is round-trip or not. |
los | number | true | none | This represents the length of stay in the destination location. |
horizons | array | true | none | It represents the horizons of the shop's flights date format must be DD/MM/YYYY. |
pax | object | true | none | Information about the passengers. |
» adults | number | false | none | This represents the number of the adult passengers. |
» infants | number | false | none | This represents the number of the infant passengers. |
» children | number | false | none | This represents the number of child passengers. |
noOfStops | string | true | none | This represents the number of stops in the trip. |
duration | object | true | none | The duration of the trip. |
» hour | number | false | none | The total duration in hours. |
» minute | number | false | none | The duration in minute. |
fareType | string | true | none | This represents the type of fare used for the search. |
_pos | string | true | none | The ID of the point of sale. |
_currency | string | true | none | The ID of the currency used for the search. |
deliveryMode | [string] | true | none | It represents the list of delivery mode(s) used for the search. |
Enumerated Values
Property | Value |
---|---|
fareType | Regular |
fareType | Defence |
fareType | Doctors |
fareType | Senior Citizen |
fareType | Students |
realtimePostRes
{
"error": false,
"shopId": "651e6ee1f2b198a44b2cbbf8",
"timestamp": 1696493285635
}
Real Time Shop Attributes
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
shopId | string | false | none | none |
timestamp | number | false | none | none |
Enumerated Values
Property | Value |
---|---|
error | false |
shopsGetResp
{
"error": false,
"shop": {
"_OD": [
{
"OD": "YXZAMI",
"_flyFrom": "62b943e4dd59913b61a6b15b",
"_flyTo": "62b943e4dd59913b61a6b15c"
}
],
"_sources": [
"6239aec26c3c588d8f64ecfc"
],
"_alternateSources": [
"61515e50b77f75890e8acbaf"
],
"_cabinClasses": [
"6013a6abf553c71d4dfbe92d"
],
"horizons": [
"0",
"3-10",
"02/05/2025",
"10/06/2025-10/08/2025"
],
"_carriers": [
"6013a6abf553c71d4dfbe92d"
],
"isRoundTrip": true,
"los": 1,
"pax": {
"adults": 1,
"infants": 0,
"children": 0
},
"duration": {
"hour": 30,
"minute": 20
},
"fareType": "Regular",
"startDate": "2019-08-24",
"_pos": "62a2e3ca581567e3cd67ce1a",
"_currency": "5fa104806304832acf9c67f5",
"shopName": "Flightshop name",
"_user": "6411b27b79d2c995fc689c4b",
"userName": "user@flightrates.com",
"vertical": "flightrates",
"posName": "POS/123",
"deliveryMode": [
"db"
],
"isActiveStatus": true,
"_id": "640ace815353bdb6454e191b",
"isCustomerCreated": true,
"createdAt": "2023-03-10T06:30:25.288Z",
"updatedAt": "2023-03-10T06:30:25.288Z",
"id": "640ace815353bdb6454e191b"
}
}
Shops informations.
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
shop | object | false | none | none |
» _OD | [object] | false | none | It represents the list of origin and destination airports for the flight. |
»» OD | string | false | none | none |
»» _flyFrom | string | false | none | It represents the origin airport code. |
»» _flyTo | string | false | none | It represents the destination airport code. |
» _sources | [string] | false | none | It represents a list of sources that are used to search for the flights. |
» _alternateSources | [string] | false | none | It represents a list of alternate sources that are used to search for the flights. |
» _cabinClasses | [string] | false | none | It represents a list of available cabin classes for the flight. |
» horizons | array | false | none | It represents the list of horizons of the flight date format must be DD/MM/YYYY. |
» _carriers | [string] | false | none | It represents the list of airlines. |
» isRoundTrip | boolean | false | none | It indicates whether the flight is round-trip or not. |
» los | number | false | none | It represents the length of stay. |
» pax | object | false | none | It represents the number of passengers for the flight. |
»» adults | number | false | none | The number of adult passengers. |
»» infants | number | false | none | The number of infant passengers. |
»» children | number | false | none | The number of children passengers. |
» duration | object | false | none | It represents the duration of the flight. |
»» hour | string | false | none | The number of hours of the flight. |
»» minute | string | false | none | The number of minutes of the flight. |
» fareType | string | false | none | It represents the type of fare for the flight. |
» startDate | string(date) | false | none | The start date of the flight. |
» _pos | string | false | none | The point of sale. |
» _currency | string | false | none | The currency used for the flight travel. |
» shopName | string | false | none | The name of the shop. |
» _user | string | false | none | The customer Id. |
» userName | string | false | none | Username redunant fields |
» vertical | string | false | none | Vertical type/Category of the product mentioned |
» posName | string | false | none | Pos name is the point of sale code |
» deliveryMode | [string] | false | none | A list of delivery mode for the shop. |
» isActiveStatus | boolean | false | none | It indicates whether the shop is active or not. |
» _id | string | false | none | The ID of the shop. |
» isCustomerCreated | boolean | false | none | It represents whether the shop was created by a customer or not. |
» createdAt | string | false | none | The date and time the shop was created. |
» updatedAt | string | false | none | The date and time the shop was last updated. |
» id | string | false | none | The ID of the shop. |
Enumerated Values
Property | Value |
---|---|
error | false |
fareType | Regular |
fareType | Defence |
fareType | Doctors |
fareType | Senior Citizen |
fareType | Students |
shopStatusRes
{
"error": false,
"status": "IN_PROGRESS"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
status | string | false | none | none |
shopPutReq
{
"_OD": [
{
"OD": "YXZMAI",
"_flyFrom": "62b943e4dd59913b61a6b15b",
"_flyTo": "62b943e4dd59913b61a6b15c"
}
],
"_sources": [
"6239aec26c3c588d8f64ecfc"
],
"_alternateSources": [
"61515e50b77f75890e8acbaf"
],
"_cabinClasses": [
"6013a6abf553c71d4dfbe92d"
],
"_carriers": [
"6013a6abf553c71d4dfbe92d"
],
"isRoundTrip": false,
"los": 1,
"horizons": [
"0",
"3-10",
"02/05/2025",
"10/06/2025-10/08/2025"
],
"pax": {
"adults": 1,
"infants": 0,
"children": 0
},
"noOfStops": "1",
"duration": {
"hour": 40,
"minute": 30
},
"fareType": "Doctors",
"_pos": "62a2e3ca581567e3cd67ce1a",
"_currency": "5fa104806304832acf9c67f5",
"shopName": "Flightshop name",
"deliveryMode": [
"db"
],
"isActiveStatus": true
}
Shops information
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
_OD | [object] | false | none | It represents the list of origin and destination airports for the flight. |
» OD | string | false | none | none |
» _flyFrom | string | false | none | It represents the origin airport code. |
» _flyTo | string | false | none | It represents the destination airport code. |
_sources | [string] | false | none | The IDs of the sources used for the search. |
_alternateSources | [string] | false | none | The IDs of the alternate sources used for the search. |
_cabinClasses | [string] | false | none | The IDs of the cabin classes used for the search. |
_carriers | [string] | false | none | It represents the list of airlines. |
isRoundTrip | boolean | false | none | The value indicating whether the trip is round-trip or not. |
los | number | false | none | This represents the length of stay in the destination location. |
horizons | array | false | none | It represents the horizons of the shop's flights date format must be DD/MM/YYYY. |
pax | object | false | none | Information about the passengers. |
» adults | number | false | none | This represents the number of the adult passengers. |
» infants | number | false | none | This represents the number of the infant passengers. |
» children | number | false | none | This represents the number of child passengers. |
noOfStops | string | false | none | This represents the number of stops in the trip. |
duration | object | false | none | The duration of the trip. |
» hour | number | false | none | The total duration in hours. |
» minute | number | false | none | The duration in minute. |
fareType | string | false | none | This represents the type of fare used for the search. |
_pos | string | false | none | The ID of the point of sale. |
_currency | string | false | none | The ID of the currency used for the search. |
shopName | string | false | none | It represents the name of the shop being updated. |
deliveryMode | [string] | false | none | It represents the list of delivery mode(s) used for the search. |
isActiveStatus | boolean | false | none | It indicates whether the shop is active or not. |
Enumerated Values
Property | Value |
---|---|
fareType | Regular |
fareType | Defence |
fareType | Doctors |
fareType | Senior Citizen |
fareType | Students |
shopPutResp
{
"error": false,
"shop": {
"_OD": [
{
"OD": "MXAIZS",
"_flyFrom": "62b943e4dd59913b61a6b15b",
"_flyTo": "62b943e4dd59913b61a6b15c"
}
],
"_sources": [
"6239aec26c3c588d8f64ecfc"
],
"_alternateSources": [
"61515e50b77f75890e8acbaf"
],
"_cabinClasses": [
"6013a6abf553c71d4dfbe92d"
],
"_carriers": [
"6013a6abf553c71d4dfbe92d"
],
"horizons": [
"0",
"3-10",
"02/05/2025",
"10/06/2025-10/08/2025"
],
"isRoundTrip": true,
"los": 1,
"pax": {
"adults": 1,
"infants": 0,
"children": 0
},
"duration": {
"hour": 32,
"minute": 40
},
"fareType": "Regular",
"startDate": "2019-08-24",
"_pos": "62a2e3ca581567e3cd67ce1a",
"_currency": "5fa104806304832acf9c67f5",
"shopName": "Flightshop name",
"_user": "6411b27b79d2c995fc689c4b",
"userName": "user@flightrates.com",
"vertical": "flightrates",
"posName": "POS/123",
"deliveryMode": [
"db"
],
"isActiveStatus": true,
"_id": "640ace815353bdb6454e191b",
"isCustomerCreated": true,
"createdAt": "2023-03-10T06:30:25.288Z",
"updatedAt": "2023-03-10T06:30:25.288Z",
"id": "640ace815353bdb6454e191b"
}
}
Shop informations.
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
error | boolean | false | none | none |
shop | object | false | none | none |
» _OD | [object] | false | none | It represents a list of the Origin-Destination pairs for the shop. |
»» OD | string | false | none | none |
»» _flyFrom | string | false | none | Airport origin. |
»» _flyTo | string | false | none | Airport destination. |
» _sources | [string] | false | none | It represents a list of the sources for the shop. |
» _alternateSources | [string] | false | none | It represents a list of the alternate sources for the shop. |
» _cabinClasses | [string] | false | none | It represents a list of the cabin classes for the shop. |
» _carriers | [string] | false | none | It represents the list of airlines. |
» horizons | array | false | none | It represents the list of horizons of the flight date format must be DD/MM/YYYY. |
» isRoundTrip | boolean | false | none | It indicates whether the shop is for a round-trip or one-way flights. |
» los | number | false | none | It represents the length of stay for the shop. |
» pax | object | false | none | It represents the number of passengers for the shop. |
»» adults | number | false | none | The Number of adults. |
»» infants | number | false | none | The Number of infants. |
»» children | number | false | none | The Number of children. |
» duration | object | false | none | It represents the duration of the shop. |
»» hour | number | false | none | The number of hours. |
»» minute | number | false | none | The number of minutes. |
» fareType | string | false | none | It represents the type of fare for the shop. |
» startDate | string(date) | false | none | It represents the start date for the shop. |
» _pos | string | false | none | It represents the point of sale for the shop. |
» _currency | string | false | none | It represents the currency for the shop. |
» shopName | string | false | none | It represents the name of the shop being updated. |
» _user | string | false | none | The customer Id. |
» userName | string | false | none | Username redunant fields |
» vertical | string | false | none | Vertical type / category of product mentioned |
» posName | string | false | none | Pos name is point of sale code |
» deliveryMode | [string] | false | none | It represents the list of delivery modes for the shop. |
» isActiveStatus | boolean | false | none | It indicates whether the shop is active or not. |
» _id | string | false | none | The ID of the shop. |
» isCustomerCreated | boolean | false | none | It represents whether the shop was created by a customer or not. |
» createdAt | string | false | none | The date and time the shop was created. |
» updatedAt | string | false | none | The date and time the shop was last updated. |
» id | string | false | none | The ID of the shop. |
Enumerated Values
Property | Value |
---|---|
error | false |
fareType | Regular |
fareType | Defence |
fareType | Doctors |
fareType | Senior Citizen |
fareType | Students |