API Reference

Place an order with the PassAPI

Once you calculated the price of your order, you can use this endpoint in order to create a new order.


HTTP Request

https://api.pass.qa/business/v1/orders

Sample Request

<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL            => "https://api.pass.qa/business/v1/orders",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING       => "",
  CURLOPT_MAXREDIRS      => 10,
  CURLOPT_TIMEOUT        => 30,
  CURLOPT_HTTP_VERSION   => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST  => "POST",
  CURLOPT_POSTFIELDS     => json_encode(
    [
        "pickup_id": 9,
        "addresses"=> [
            "pickup" =>[
                "lat"=> "25.275047",
                "long"=> "51.535141",
                "name"=> "majva",
                "phone"=> "+97466661234",
                "address"=> "this street",
                "description"=> "it is a sample description"
            ],
            "dropoffs" => [
                [
                    "lat"=> "25.277007",
                    "long"=> "51.530034",
                    "name"=> "majva",
                    "phone"=> "+97466661234",
                    "address"=> "that street",
                    "description"=> "it is a sample description"
                ],
                [
                    "lat"=> "25.277007",
                    "long"=> "51.530034",
                    "name"=> "majva",
                    "phone"=> "+97466661234",
                    "address"=> "other street",
                    "description"=> "it is a sample description"
                ],
                [
                    "lat"=> "25.277007",
                    "long"=> "51.530034",
                    "name"=> "majva",
                    "phone"=> "+97466661234",
                    "address"=> "another street",
                    "description"=> "it is a sample description"
                ]
            ]
        ]
    ]
  ),
  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: 'POST',
  url: baseURL+'/v1/orders',
  headers: 
   { Accept: 'application/json',
     Authorization: 'Bearer '+token,
     'Content-Type': 'application/json' },
  body: 
   { 
    "pickup_id": 9,
    "vehicle_id": 1,
    "addresses": {
        "pickup" :{
            "lat": "25.275047",
            "long": "51.535141",
            "name": "majva",
            "phone": "+97466661234",
            "address": "this street",
            "description": "it is a sample description"
        },
        "dropoffs" : [
            {
                "lat": "25.277007",
                "long": "51.530034",
                "name": "majva",
                "phone": "+97466661234",
                "address": "that street",
                "description": "it is a sample description"
            },
            {
                "lat": "25.277007",
                "long": "51.530034",
                "name": "majva",
                "phone": "+97466661234",
                "address": "other street",
                "description": "it is a sample description"
            },
            {
                "lat": "25.277007",
                "long": "51.530034",
                "name": "majva",
                "phone": "+97466661234",
                "address": "an other street",
                "description": "it is a sample description"
            }
        ]
    }
},
  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'}
data = {    
    "pickup_id": 9,
    "vehicle_id": 1,
    "addresses": {
        "pickup" :{
            "lat": "25.275047",
            "long": "51.535141",
            "name": "majva",
            "phone": "+97466661234",
            "address": "this street",
            "description": "it is a sample description"
        },
        "dropoffs" : [
            {
                "lat": "25.277007",
                "long": "51.530034",
                "name": "majva",
                "phone": "+97466661234",
                "address": "that street",
                "description": "it is a sample description"
            },
            {
                "lat": "25.277007",
                "long": "51.530034",
                "name": "majva",
                "phone": "+97466661234",
                "address": "other street",
                "description": "it is a sample description"
            },
            {
                "lat": "25.277007",
                "long": "51.530034",
                "name": "majva",
                "phone": "+97466661234",
                "address": "an other street",
                "description": "it is a sample description"
            }
        ]
    }
   
}
response = requests.post(baseUrl+'/v1/orders',json=data, headers=headers)
print(response.json())

Request Parameters

ParameterDefaultRequiredDescription
pickup_idnullfalsenumeric (can get pickup_id using getPickups api)
addresses[pickup][lat]nulltruenumeric,between:-90,90
addresses[pickup][long]nulltruenumeric,between:-180,180.
addresses[pickup][name]nulltruestring,max:100
addresses[pickup][phone]nulltrueInternational phone format
addresses[pickup][address]nulltruestring,max:150
addresses[pickup][description]nullfalsestring,max:150
addresses[dropoffs][0][lat]nulltruenumeric,between:-90,90
addresses[dropoffs][0][long]nulltruenumeric,between:-180,180.
addresses[dropoffs][0][name]nulltruestring,max:100
addresses[dropoffs][0][phone]nulltrueInternational phone format
addresses[dropoffs][0][address]nulltruestring,max:150
addresses[dropoffs][0][description]nullfalsestring,max:150
addresses[dropoffs][1][lat]nullfalsenumeric,between:-90,90
addresses[dropoffs][1][long]nullfalsenumeric,between:-180,180.
addresses[dropoffs][1][name]nullfalsestring,max:100
addresses[dropoffs][1][phone]nullfalseInternational phone format
addresses[dropoffs][1][address]nullfalsestring,max:150
addresses[dropoffs][1][description]nullfalsestring,max:150
addresses[dropoffs][2][lat]nullfalsenumeric,between:-90,90
addresses[dropoffs][2][long]nullfalsenumeric,between:-180,180.
addresses[dropoffs][2][name]nullfalsestring,max:100
addresses[dropoffs][2][phone]nullfalseInternational phone format
addresses[dropoffs][2][address]nullfalsestring,max:150
addresses[dropoffs][2][description]nullfalsestring,max:150
payment_typewalletfalsein: wallet, cash

Response Descriptions

AttributeDescription
statusIndicates whether the submission progress has been successful or not.
messageThe message of the response
order_idThe id of the created order. You can track your order by this id.
{
  "status": "success",
  "http-code": 200,
  "message": "Order placed successfully",
  "data": {
    "id": 36095,
    "pickup": {
      "lat": "25.275047",
      "long": "51.535141",
      "name": "majva",
      "phone": "+97466661234",
      "address": "this street",
      "description": "it is a sample 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": 25.97,
    "date": "06/11/2024 13:42:30",
    "payment_type": null,
    "order_status": "Unassigned"
  },
  "option": {
    
  }
}