API Reference

Request to check if the dropoffs are valid acccording to selected pickup

This endpoint verifies if the provided dropoffs locations are valid based on the selected pickup location.

This API should be called before invoking the "Calculate Price" and "Create Order" APIs. It ensures the validity of the pickup_id and vehicle_id provided in the request, which is essential for accurate pricing calculations.


HTTP Request

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

Sample Request

<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL            => "https://api.pass.qa/business/v1/orders/getPickupValidation",
  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,
    "dropoffs": [
        {
            "drop":1,
            "lat": "25.277007",
            "long": "51.530034"
        },
        {
            "drop":2,
            "lat": "25.277005",
            "long": "51.530039"
        }
    ]
  ]
  ),
  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/getPickupValidation',
  headers: 
   { Accept: 'application/json',
     Authorization: 'Bearer '+token,
     'Content-Type': 'application/json' },
  body: 
   {
    "pickup_id": 9,
    "dropoffs": [
        {
            "drop":1,
            "lat": "25.277007",
            "long": "51.530034"
        },
        {
            "drop":2,
            "lat": "25.277005",
            "long": "51.530039"
        }
    ]
},
  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,
    "dropoffs": [
        {
            "drop":1,
            "lat": "25.277007",
            "long": "51.530034"
        },
        {
            "drop":2,
            "lat": "25.277005",
            "long": "51.530039"
        }
    ]
}
response = requests.post(baseUrl+'/v1/orders/getPickupValidation',json=data, headers=headers)
print(response.json())

Request Parameters

ParameterDefaultRequiredDescription
pickup_idnulltruenumeric (can get pickup_id using getPickups api)
dropoffs[0][drop]not nulltrueThis is the sequence of number of dropoff
dropoffs[0][lat]nulltruenumeric,between:-90,90
dropoffs[0][long]nulltruenumeric,between:-180,180.
dropoffs[1][drop]not nulltrueThis is the sequence of number of dropoff
dropoffs[1][lat]nulltruenumeric,between:-90,90
dropoffs[1][long]nulltruenumeric,between:-180,180.

Response Descriptions

AttributeDescription
statusIndicates whether the calculation progress has been successful or not.
dataThis contains the zones validation data
zonesThis contains the dropoffs validation for each dropoff. If the status in each dropoff is true then only it is valid otherwise invalid dropoff to deliver.
{
    "status": "success",
    "http-code": 200,
    "message": "Data fetching success!",
    "data": {
        "zones": [
            {
                "drop": 1,
                "zone_id": 13,
                "status": true
            },
            {
                "drop": 2,
                "zone_id": 13,
                "status": true
            }
        ]
    },
    "option": {}
}