Docs

Flight Latest Fare API

Returns the latest fare of a flight before booking.
BODY PARAMS

RAW_BODY
json

HEADERS

Request headers

Accept : application/json
Content-Type: application/json

Request Parameters
Send these parameters in the request body:

Parameter Type Position # Description
token string RAW_BODY Required Your API token from the ClubApi dashboard. Keep it private.


Response
These fields are returned in the response:

Parameter Type Description
status string Request status: SUCCESS or FAILED.
data array List of bus stops with their IDs. Pass the ID in the Bus List API.

{
  "status": "SUCCESS",
  "orderId": "24061216463992956",
  "resText": "",
  "fareDetails": {
    "netFare": "5599",
    "baseCharge": "4165",
    "surCharge": "1434",
    "fareType": "Publish"
  },
  "returnFareDetails": {
    "netFare": "",
    "baseCharge": "",
    "surCharge": "",
    "fareType": "Publish"
  },
  "payableAmount": "5599",
  "sessionId": "666982a06967e",
  "passenger": {
    "adult": "1",
    "children": "0",
    "infant": "0"
  }
}
            

              curl 'https://api.clubapi.in/flight/getFareDetails.php' \
                --max-time 10 \

              -H 'accept: application/json' \
              -H 'content-type: application/json' \
              --data-raw '{"token":"xxxxxxxxxx","sessionId":"666982a06967e"}' \
            
          

            <?php

            $url = "https://api.clubapi.in/flight/getFareDetails.php";

            $curl = curl_init($url);
            curl_setopt($curl, CURLOPT_URL, $url);
            curl_setopt($curl, CURLOPT_POST, true);
            curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10); // wait max 10 seconds to connect
            curl_setopt($curl, CURLOPT_TIMEOUT, 10); // wait max 10 seconds for response

            $headers = array(
            "accept: application/json",
            "content-type: application/json",
            );
            curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);

            $data = '{"token":"xxxxxxxxxxx","sessionId":"666982a06967e"}';

            curl_setopt($curl, CURLOPT_POSTFIELDS, $data);

            //for debug only!
            curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
            curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);

            $resp = curl_exec($curl);
            curl_close($curl);
            var_dump($resp);

            ?>
          

            URL url = new URL("https://api.clubapi.in/flight/getFareDetails.php");
            HttpURLConnection http = (HttpURLConnection)url.openConnection();
            http.setRequestMethod("POST");
            http.setDoOutput(true);
            http.setConnectTimeout(10000); // 10 seconds
            http.setReadTimeout(10000);    // 10 seconds
            http.setRequestProperty("accept", "application/json");
            http.setRequestProperty("content-type", "application/json");

            String data = "{\"token\":\"xxxxxxxxx\",\"sessionId\":\"666982a06967e\"}";

            byte[] out = data.getBytes(StandardCharsets.UTF_8);

            OutputStream stream = http.getOutputStream();
            stream.write(out);

            System.out.println(http.getResponseCode() + " " + http.getResponseMessage());
            http.disconnect();
          

            var url = "https://api.clubapi.in/flight/getFareDetails.php";

            var httpRequest = (HttpWebRequest)WebRequest.Create(url);
            httpRequest.Method = "POST";
            httpRequest.Timeout = 10000; // 10 seconds

            httpRequest.Headers["accept"] = "application/json";
            httpRequest.Headers["content-type"] = "application/json";

            var data = "{\"token\":\"xxxxxxxxx\",\"sessionId\":\"666982a06967e\"}";

            using (var streamWriter = new StreamWriter(httpRequest.GetRequestStream()))
            {
              streamWriter.Write(data);
            }

            var httpResponse = (HttpWebResponse)httpRequest.GetResponse();
            using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
            {
              var result = streamReader.ReadToEnd();
            }

            Console.WriteLine(httpResponse.StatusCode);