The below sample code of PHP is only for reference,Please don't use this code in your implementation. As of now we have only 3 methods in PHP. First method for getStations: Second Method For blockSeat Request: For block the tickets replace with your parameters $prebook=array(             'sourceCity'=>$_POST['source'],              'destinationCity'=>$_POST['dest'], 'doj'=>$_POST['doj'],             'routeScheduleId'=>$_POST['routeid'],              'boardingPoint'=>array(                  'id'=>$id,                  'location'=>$location,                  'time'=>$time              ),                   'customerName'=>$_POST['fname'],              'customerLastName'=>$_POST['lname'],              'customerEmail'=>$_POST['email'],              'customerPhone'=>$_POST['mobileno'],              'emergencyPhNumber'=>$_POST['emc-number'],              'customerAddress'=>$_POST['address'],              'blockSeatPaxDetails'=>array(array(                  'age'=>$_POST['age'][$key],                  'name'=>$value,                  'seatNbr'=>$_POST['seat-no'][$key],                  'Sex'=>$_POST['gender'.$no],                  'fare'=>$_POST['base-fare'][$key],                  'totalFareWithTaxes'=>$_POST['amount'][$key],                  'ladiesSeat'=>$ladies,                  'lastName'=>$_POST['plname'][$key],                  'mobile'=>$_POST['mobileno'],                  'title'=>'Mrs',                  'email'=>$_POST['email'],                  'idType'=>$_POST['idtype'],                  'idNumber'=>$_POST['id-number'],                  'nameOnId'=>$value,                  'primary'=>true,                  'ac'=>$ac,                  'sleeper'=>$sleeper                )),                'inventoryType'=>$_POST['invtype']                        );           $json=json_encode($prebook); Response: $ch = curl_init();         $url=$this->url."etsAPI/api/blockTicket"; $username='XXXX'; $password='xxxx'; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_USERPWD, "$username:$password"); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");   curl_setopt($ch, CURLOPT_POST, 1);                                                                            curl_setopt($ch, CURLOPT_POSTFIELDS, $json);                                                                           curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                                   'Content-Type: application/json',                                                                                          'Content-Length: ' . strlen($json))                                                                               );                                                                                                                            curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);             curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                                                                                                                    $result = curl_exec($ch); curl_close($ch);         $result=json_decode($result, true);         return $result; Last Method for Seat Booking Request:         $ch = curl_init(); $url=$this->url."etsAPI/api/seatBooking?blockTicketKey=".$ticket; $username='XXXX'; $password='bnbn678'; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERPWD, "$username:$password"); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST); $output = curl_exec($ch); curl_close($ch); Response: $someArray = json_decode($output, true);         return $someArray;