API Reference

Request to check if the pickup is valid or not based on pickup latitude and longitude

This endpoint verifies if the provided pickup locations are valid based on the latitude and longitude.

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


HTTP Request

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

Sample Request

<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://api.pass.qa/business/v1/orders/getPickupPrice', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS =>'{ "vehicle_id":2, "pickup": { "lat": 25.2862157, "long": 51.4204044 } }', CURLOPT_HTTPHEADER => array( "Authorization: Bearer ". $token,//$token is your token created in dashboard. "Content-Type: application/json; charset=utf-8", "Accept: application/json" ), )); $response = curl_exec($curl); curl_close($curl); 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/getPickupPrice', headers: { Accept: 'application/json', Authorization: 'Bearer '+token, 'Content-Type': 'application/json' }, body: { "vehicle_id":2, "pickup": { "lat": 25.2862157, "long": 51.4204044 } }, 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 = { "vehicle_id":2, "pickup": { "lat": 25.2862157, "long": 51.4204044 } } response = requests.post(baseUrl+'/v1/orders/getPickupPrice',json=data, headers=headers) print(response.json())

Request Parameters

ParameterDefaultRequiredDescription
vehicle_idnulltruenumeric
pickup[lat]not nulltruenumeric,between:-90,90
pickup[long]not nulltruenumeric, between: -180, 180

Response Descriptions

AttributeDescription
statusIndicates whether the pickup is in zone or not and if in zone then get pickup price.
dataThis contains the pickup zones validation and if pickup is in zone then get pickup price (use discount_price).
resultThis contains the pickup location price with vehicle details.
{ "status": "success", "httpCode": 200, "message": "successful", "data": { "result": { "vehicle": "Car", "vehicle_info": { "weight": "25", "length": "200", "width": "201", "height": "200" }, "vehicle_description": "", "distance": 0, "vehicle_id": 2, "price": 10, "discount": 0, "discount_price": 10, "has_discount": false, "pickupPricingArr": [ { "pickup": 0, "price": 10, "distance": 0 } ] } } }