You can cancel any order before courier arrival (before the pickup status)


HTTP Request

https://api.pass.qa/business/v1/orders/{ORDER_ID}/cancel

Sample Request

<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL            => "https://api.pass.qa/business/v1/orders/{ORDER_ID}/cancel",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING       => "",
  CURLOPT_MAXREDIRS      => 10,
  CURLOPT_TIMEOUT        => 30,
  CURLOPT_HTTP_VERSION   => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST  => "GET",
  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: 'GET',
  url: baseURL+'/v1/orders/{ORDER_ID}/cancel',
  headers: 
   { Accept: 'application/json',
     Authorization: 'Bearer '+token,
     'Content-Type': 'application/json' },
  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'}
response = requests.get(baseUrl+'/v1/orders/{ORDER_ID}/cancel', headers=headers)
print(response.json())

Response Descriptions

AttributeDescription
statusIndicates whether the calculation progress has been successful or not.
messageThe message of the progress.
{
    "status": "success",
    "message": "Order has been cancelled",
    "data": {}
}