API Reference

Create Favorite Location

Request to create favorite location

This endpoint create the favorite location.


HTTP Request

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

Sample Request

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.pass.qa/business/v1/orders/addFavorite',
  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 =>'{
    "name": "Al khor",
    "type": "Home",    
    "national_address": {
        "building_no": "85",
        "zone_no": "61",
        "street_no": "850"
    },
    "address": "MFJW+5P9, Al Khor, Qatar",
    "description": "testing",
    "request_type":"vendor"
}',
  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/addFavorite',
  headers: 
   { Accept: 'application/json',
     Authorization: 'Bearer '+token,
     'Content-Type': 'application/json' },
  body: 
   {
    "name": "Al khor",
    "type": "Home",    
    "national_address": {
        "building_no": "85",
        "zone_no": "61",
        "street_no": "850"
    },
    "address": "MFJW+5P9, Al Khor, Qatar",
    "description": "testing",
    "request_type":"vendor"
},
  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 = {
    "name": "Al khor",
    "type": "Home",    
    "national_address": {
        "building_no": "85",
        "zone_no": "61",
        "street_no": "850"
    },
    "address": "MFJW+5P9, Al Khor, Qatar",
    "description": "testing",
    "request_type":"vendor"
}
response = requests.post(baseUrl+'/v1/orders/addFavorite',json=data, headers=headers)
print(response.json())

Request Parameters

ParameterDefaultRequiredDescription
namenot nulltruestring
typeHometrueYou can pass default 'Home'
national_address[building_no]not nulltruenumeric
national_address[zone_no]not nulltruenumeric
national_address[street_no]not nulltruenumeric
addressnot nulltruestring
descriptionnullfalsestring

Response Descriptions

AttributeDescription
statusIndicates whether the location is created or not.
dataThis contains the data which you have stored.
{
    "status": "success",
    "http-code": 200,
    "message": "Location added to your favorites.",
    "data": {
        "id": 910,
        "name": "Al khor",
        "type": "Home",
        "coordinate": "25.325903876,51.530492986",
        "address": "MFJW+5P9, Al Khor, Qatar",
        "street": null,
        "flat": null,
        "house": null
    },
    "option": {}
}