Docs

Bus Seat Layout API

Returns the seat layout of a bus with fares and availability.
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. Send it with every API request and keep it private.
busId string RAW_BODY Required Bus ID. Get it from the Bus List API.


Response
These fields are returned in the response:

Parameter Type Description
isAvailable string true or false.
fare string Seat fare.
name string Seat name.
colums string Column number.
busId string Required to book a seat.
row string Row number
width string Seat width: 1 or 2.
zIndex string Deck: 0 = lower, 1 = upper.
length string Seat length: 1 or 2.
commission string Commission you earn when the ticket is booked.
Seat Layout Example Bus seat layout example

{
  "status": "SUCCESS",
  "resText": "",
  "busId": "198493",
  "seatLayout": [
    {
      "isAvailable": "false",
      "fare": "1469",
      "name": "L1",
      "colums": "0",
      "row": "3",
      "width": "1",
      "zIndex": "0",
      "length": "2",
      "ladiesSeat": "true",
      "maleSeat": "",
      "commission": "69"
    },......
            

              curl 'https://sandbox.clubapi.in/bus/seatLayout.php' \
                --max-time 10 \

              -H 'accept: application/json' \
              -H 'content-type: application/json' \
              --data-raw '{"token":"xxxxx","sourceId":"1","destinationId":"10","journyDate":"2021-08-19"}' \
            
          

            <?php

            $url = "https://api.clubapi.in/bus/seatLayout.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":"xxxxx","sourceId":"1","destinationId":"10","journyDate":"2021-08-19"}';
            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/bus/seatLayout.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\":\"xxxxx\",\"sourceId\":\"1\",\"destinationId\":\"10\",\"journyDate\":\"2021-08-19\"}";

            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/bus/seatLayout.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\":\"xxxxx\",\"sourceId\":\"1\",\"destinationId\":\"10\",\"journyDate\":\"2021-08-19\"}";

            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);