Log In

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(
    [
        "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: 
   { 
    "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 = {    
    "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
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",
    "message": "Order placed successfully",
    "data": {
        "order_id": 13194
    }  
}