Overview

To start integrating with CLOZAR API, you need a CLOZAR enterprise account. See how to setup here:Setting up on CLOZAR.

Clozar API helps you create any type of delivery flow from local, intercity and international.

Setting up an Account on Clozar

Setting up a enterprise account is as easy as possible, simply sign up Signup Here .Upon successful registration, our support team will contact you via email or phone call.

API Credentials

API credentials will be created for your account to facilitate the integration phase. you can find your API credentials on your enterprise dashbaord when you sign in.

Signin to Account

Live Credentials

To go live simply contact our support team. Contact Support

Adding Clozar Delivery to your website

The Clozar API allows you to add our REST API your website in order to start processing delivery globally. It offers a secure and convenient flow for customers.

Request Delivery

This shows you how to request delivery from the pickup location to the dropoff location.

Request delivery quickly and securely using the standard method by calling the delivery/api/

Step 1: Calculate the delivery fee.

Collect the following data and send as a json payload to the delivery/api/get-rate.php.

Parameter Required Data Type Description
merchant_id true string Your merchant ID provided when you create an account.
public_key true string Your public key can be found in your developer key on your dashboard.
delivery_address true string This is the parcel delivery address. Note : Use google map address as input .
delivery_country true string This is the parcel delivery country. Note : Use ISO 3166-1 alpha-2 code .
pickup_address true string This is the parcel pickup address. Note : Use google map address as input .
pickup_country true string This is the parcel pickup country. Note : Use ISO 3166-1 alpha-2 code .
Insurance true string Insurance value is either YES or NO
weight true string Weight of the package you are delivering.
value true string Value of the package you are delivering.

Step 2: Initialize the fetch qoute request.

After collecting parcel details initialise the fetch qoute request by calling our API with the parcel details, see an example below.

         

Method: POST
Endpoint: https://www.clozarbusiness.com/delivery/api/get-rate.php

//Request Headers
Content-Type: application/json
Cache-Control: no-cache

//Request Body
{
  "merchant_id":"Your merchant ID",
  "public_key":"Your Public Key",
  "pickup_country":"NG",
  "pickup_address" : "Murtala Muhammed International Airport",
  "delivery_address":"HCHX+9P9, Ho, Ghana",
  "delivery_country":"GH",

  "weight":"10",
  "value" : "10000"

}
 
     
                            
$receive_momo =  array(
  "merchant_id"=>"Your merchant ID",
  "public_key"=>"Your Public Key",
   "pickup_address"=>"Murtala Muhammed International Airport",
  "pickup_country"=>"NG",
  "delivery_address"=>"HCHX+9P9, Ho, Ghana",
  "delivery_country"=>"GH",
 
  "weight"=>"10",
  "value" => "10000");

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://www.clozarbusiness.com/delivery/api/get-rate.php",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => $request_url,
  CURLOPT_HTTPHEADER => array(
 "Cache-Control: no-cache",
    "Content-Type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

  

Sample Response


{"status":"success","delivery_fare":110500,"delivery_currency":"NGN","sender_country":"Nigeria","receiver_country":"Ghana","sender_address":"Murtala Muhammed International Airport (LOS), Muritala Airport Rd, Ikeja 234001, Lagos, Nigeria","receiver_address":"HCHX+9P9, Ho, Ghana","EATA":3,"EATB":5}

Request Delivery

This section describes how to request delivery using the Clozar API.

One of the core functionalities of Clozar API is to make delivery request as easy as it gets, regardless of the country

Request Parameters

Parameter Required Type Description
merchant_id true string Your merchant ID provided when you create an account.
public_key true string Your public key can be found in your developer key on your dashboard.
delivery_address true string This is the parcel delivery address. Note : Use google map address as input .
delivery_country true string This is the parcel delivery country. Note : Use ISO 3166-1 alpha-2 code .
pickup_address true string This is the parcel pickup address. Note : Use google map address as input .
pickup_country true string This is the parcel pickup country. Note : Use ISO 3166-1 alpha-2 code .
weight true string Weight of the package you are delivering in KG
value true string Value of the package you are delivering in GHS, NGN or USD depending on the sender's country currency.
Insurance true string Insurance value is either YES or NO
customer_name true string Name of the receiver
customer_phone true string Mobile number of the receiver
customer_email true string email address of the receiver
sender_name true string Name of the sender
sender_phone true string Mobile number of the sender
sender_email true string Email address of the sender
date_of_delivery true string Date of delivery the parcel
order_id true string Your unique orderid
description true string This is the detailed description of the parcel. Eg : 25pcs of clothes, 10 pairs of shoes .

Initiate Delivery Request

         

Method: POST
Endpoint: delivery/api/request-quote.php
//Request Headers
Content-Type: application/json
Cache-Control: no-cache

//Request Body
{
  "merchant_id":"Your merchant ID",
  "public_key":"Your Public Key",
  "pickup_address":"Murtala Muhammed International Airport, Ikeja, Lagos, Nigeria",
  "pickup_country":"NG",
  "delivery_address":"HCHX+9P9, Ho, Ghana",
  "delivery_country":"GH",
  "weight":"10",
  "value" : "10000",
  "insurance" : "YES",
  
 "customer_name" : "John Doe",
 "customer_phone" : "+233552500806",
 "customer_email" : "customer@gmail.com",
 
  "sender_name" : "John Doe",
 "sender_phone" : "+2347084976665",
 "sener_email" : "sender@gmail.com",
 "description" : "10pcs of cloth",
 "date_of_delivery" : "2025-01-29",
 "order_id" : "YOUR UNIQUE ORDER ID"
 
 
}
 
     
    



$receive_momo =  array(
'pickup_country' => 'NG',
'pickup_address' => 'Murtala Muhammed International Airport, Ikeja, Lagos, Nigeria',
'delivery_country' => 'GH',
'delivery_address' => 'HCHX+9P9, Ho, Ghana',
 'weight' => '10',
 'value'=> '10000',
 'insurance'=> 'YES',
 'customer_name'=> 'John Doe',
 'customer_phone'=> '+233552500806',
 'customer_email'=> 'customer@email.com',
 'sender_name'=> 'John Doe',
 'sender_phone'=> '+2347084976665',
 'sender_email'=> 'sender@gmail.com',
 'date_of_delivery' => '2025-01-29',
 'description' => '10pcs of cloth',
 'order_id'=> 'YOUR UNIQUE ORDER ID ',
 'public_key'  => 'YOUR PUBLIC KEY',
 'merchant_id'  => 'YOUR MERCHANT ID');
 
$request_url = 'https://clozarbusiness.com/delivery/api/request-quote.php';
$receive_momo_request = json_encode($receive_momo);
$ch =  curl_init($request_url);  
        curl_setopt( $ch, CURLOPT_POST, true);  
        curl_setopt( $ch, CURLOPT_POSTFIELDS, $receive_momo_request);  
        curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );  
        curl_setopt( $ch, CURLOPT_HTTPHEADER, array(
           'Cache-Control: no-cache',
           'Content-Type: application/json',
           //'Authorization: Bearer '.$secretkey.'',

          ));

$result = curl_exec($ch); 
$err = curl_error($ch);
curl_close($ch);

	if ($err){
    
	echo $result;
	
    }else{


echo $result;

	}
	


 

  

Get Delivery Request Status

fetch delivery status.

fetch transaction details by calling the endpoint delivery/api/delivery-status.php

Step 1: Set request parameters.

Collect the following data and send as a json payload to the /delivery/api/delivery-status.php.

Parameter Required Data Type Description
merchant_id true string Your merchant ID provided when you create an account.
public_key true string Your public key can be found in your system configuration on your dashboard.
tracking_id true string This is the unique ID of the transaction you are fetching

Step 2: Initialise the process

After setting up the request parameters initialise by calling our API.See an example below.

         

Method: POST
Endpoint: https://www.clozarbusiness.com/delivery/api/delivery-status.php

//Request Headers
Content-Type: application/json
Cache-Control: no-cache

//Request Body
{
  "merchant_id":"Your merchant ID",
  "public_key":"Your Public Key",
  "tracking_id":"Your tracking ID"
  
}
 
     
                            
$request_body =  array(
'merchant_id' => 'YOUR MERCHANT ID',
'public_key' => 'YOUR PUBLIC KEY',
'tracking_id' => 'YOUR TRACKING ID');

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://www.clozarbusiness.com/delivery/api/delivery-request",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => $request_url,
  CURLOPT_HTTPHEADER => array(
 "Cache-Control: no-cache",
    "Content-Type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

  

Sample Response


{"status":"success","delivery_status":"pending","date":"2025-01-29","sender_location":"Murtala Muhammed International Airport (LOS), Muritala Airport Rd, Ikeja 234001, Lagos, Nigeria","receiver_location":"HCHX+9P9, Ho, Ghana","tracking_id":"5976002008"}