Fetch Delivery Cost

This is the endpoint for fetching the cost of delivery .It takes a non mandatory parameter - state. If state is not passed, the cost of delivery to all the states and FCT is returned.

By default, the cost returned when state field is not passed is based on the weight of the parcel being between 0-5kg.

To get the cost of the delivery based on the weight of the parcel, please add the weight field.

Please note that the delivery cost API assumes pick up location (state) is the state configured in your organization's profile and the cost returned is between a pick up location in that state to any state you pass in the request. For example, if your business is configured to be operating out of Rivers State, the cost returned from this endpoint will be from Rivers State to any state passed in the request as the destination state or from Rivers to all the 36 States and FCT,if the state field is empty.

Delivery Cost

Endpoint => /order/cost

POST /order/cost

Headers

Request Body

{
  "status": "Success",
  "description": "Cost Fetched Successfully",
  "Cost": [
    {
      "state": "Kano",
      "cost": "900"
    }
  ]
}
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://apisandbox.fezdelivery.co/v1/order/cost',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'PUT',
  CURLOPT_POSTFIELDS =>'{
    "state":"Kano"
}',
  CURLOPT_HTTPHEADER => array(
    'secret-key: {{Your Secret Key}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Last updated