GET
/v1/api/corporate/rides/downloadInvoice?crn=<crn_number>
Use this Api to download invoice of a ride.
Name | Data Type | Description | Type | Remark |
---|---|---|---|---|
crn | string | CRN of a corporate ride | query | Mandatory |
GET
https://devapi.olacabs.com/v1/api/corporate/rides/downloadInvoice?crn=<crn_number>
Headers: {
X-CORPORATE-TOKEN: fd5d4d3726121212f12ff12f12f1f12f1f12fa
}
200 - invoice.pdf
Unknown error
500 - Unknown error
<?php
$curl = curl_init(); $headers = array("X-CORPORATE-TOKEN: <CLIENT-SPECIFIC-TOKEN>");
$options = array(
CURLOPT_URL => '<HOST>/v1/api/corporate/rides/downloadInvoice?crn=123456789', CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_HTTPHEADER => $headers, CURLOPT_RETURNTRANSFER => true
);
curl_setopt_array($curl, $options);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
$destination = "./files/test.pdf";
$destination = "./files/test.pdf";
$file = fopen($destination, "w+");
fputs($file, $data);
fclose($file);
}
?>