Call the following endpoint in order to get the order details.
The order details include:
1: Pickup and Dropoff details including description
2: Driver details including name, phone number, avatar and vehicle information
3: Order price and payment details
4: Order statuses
5: Share URL. A tool which you can use to share a link with your clients to view the live driver status.
HTTP Request
https://api.pass.qa/business/v1/orders/{ORDER_ID}
Sample Request
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pass.qa/business/v1/orders/{ORDER_ID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer ".$token,//$token is your token created in dashboard.
"Content-Type: application/json; charset=utf-8",
"Accept: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo 'cURL Error #:' . $err;
} else {
echo $response;
}
var request = require("request");
var token = 'mytokenvalue' //token value to be placed here;
var baseURL = 'https://api.pass.qa/business';
var options = { method: 'GET',
url: baseURL+'/v1/orders/{ORDER_ID}',
headers:
{ Accept: 'application/json',
Authorization: 'Bearer '+token,
'Content-Type': 'application/json' },
json: true };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
import requests
token = 'your token'
baseUrl ='https://api.pass.qa/business'
headers = {'Authorization': 'Bearer '+token,'Accept':'application/json','Content-Type':'application/json'}
response = requests.get(baseUrl+'/v1/orders/{ORDER_ID}', headers=headers)
print(response.json())
Response Descriptions
Attribute | Description |
---|---|
status | Indicates whether the progress has been successful or not. |
pickup[lat] | Sender latitude |
pickup[long] | Sender longitude |
pickup[name] | Sender name |
pickup[phone] | Sender phone |
pickup[address] | Sender address |
pickup[description] | Sender description |
dropoffs | An array of objects that contains dropoff information Please see the sample response at the end of this page. |
price | Order's price |
date | Date of the order creation |
payment_type | "wallet" or "cash on delivery" |
order_status | There are 7 steps in each order that is explained in the table below |
Order Status Responses | Description |
---|---|
Assigned | The order has been assigned |
Started | The order has been started and the agent is on the way. |
Successful | The order has been completed successfully |
Failed | The order has been completed unsuccessfully |
In Progress/Arrived | The order is being performed and the agent has reached the destination. |
Unassigned | The order has not been assigned to any agent |
Accepted/Acknowledged | The order has been accepted by the agent which is assigned to him. |
Declined | The order has been declined by the agent which is assigned to him. |
Cancelled | The task has been cancelled. |
Deleted | When the task is deleted. |
{
"status": "success",
"http-code": 200,
"message": "success",
"data": {
"id": 36092,
"pickup": {
"lat": "25.286193370207",
"long": "51.51986517981",
"name": "Prakash Menon",
"phone": "+97433445566",
"address": "8 شارع 948, الدوحة",
"description": ""
},
"dropoffs": [
{
"task_id": "538514418",
"status": "Unassigned",
"type": "pickup",
"description": "",
"lat": "25.286193370207",
"lng": "51.51986517981",
"address": "8 شارع 948, الدوحة",
"receiver_name": "Prakash Menon",
"eta": "38min46sec"
},
{
"task_id": "538514419",
"status": "Unassigned",
"type": "dropoff",
"description": "TEST",
"lat": "25.678100974818",
"lng": "51.492313528809",
"address": "28 شارع 886, ازغوى, الريان",
"receiver_name": "al khor zone TEST ORDER",
"eta": "4min46sec"
},
{
"task_id": "538514420",
"status": "Unassigned",
"type": "dropoff",
"description": "TEST",
"lat": "25.335048",
"lng": "51.3023906",
"address": "الشيحانية, الريان",
"receiver_name": "Lehisiniya TEST ORDER",
"eta": "13min16sec"
}
],
"price": 118.27,
"date": "03/10/2024 11:05:15",
"payment_type": "cash",
"order_status": "Unassigned"
},
"option": {}
}