Get started

The Delicon.co API is a web service which allows you to use our Machine Learning platform from your website, software or mobile application. This API provides access to all of the supported functions of our service. The Web Service uses "REST-Like" RPC-style operations over HTTP POST requests with parameters URL encoded into the request and its response is encoded in JSON. It is designed to be easy to use and you can implement it in any computer language model that allows you to generate web requests.

In order to use the Delicon.co API, you must sign-up for an account, login and get your API Key from your member area. Additionally, while developing your code, it is advised to check out our API Sandbox and generate some test requests, as well.

Using the Delicon.co API or its website indicates that you have read and accept the Terms & Conditions and the Privacy Policy. If you do not accept these terms, you are not authorized to use this service.

To use this API, you need an API key. Please create an Account to get your own API key.


Get Areas

To get areas, you need to make a GET call at the following URL :

Sandbox : https://sandbox.delicon.co/api/v3/get-city-list

Production : https://delicon.co/api/v3/get-city-list


DESCRIPTION

The Get City Lists function will get the info about city and its data i.e. city id, city name, state id, city name in Arabic, city latitude and city longitude.

QUERY PARAMETERS

There is no parameter required for this call.

REQUEST

PHP Sample Request

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sandbox.delicon.co/api/v3/get-city-list',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
                

RESPONSE

{
 "response": {
  "status": 200,
  "data": {
        "city_id": "1",
        "city_name": "Bayan",
        "city_name_arabic": "بيان",
        "city_lat": "29.298107580815447",
        "city_long": "48.050959637603775"
        "state_id":"2"
        },
        {
          ....
        }
    }
}
                

Get My Areas

To get my areas, you need to make a Get call at the following URL :

Sandbox : https://sandbox.delicon.co/api/v3/get-my-city-list

Production : https://delicon.co/api/v3/get-my-city-list


DESCRIPTION

The Get My City Lists function will get the info about city and its data i.e. city id, city name, state id, city name in Arabic, city latitude and city longitude.

QUERY PARAMETERS

Parameter Name Required Type Description
auth_key Yes string Provided by Delicon Team
email Yes string Provided by Delicon Team

REQUEST

PHP Sample Request

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sandbox.delicon.co/api/v3/get-my-city-list',
  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 => 'email=&auth_key=',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/x-www-form-urlencoded'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
                

RESPONSE


{
 "response": {
  "status": 200,
  "data": {
        "city_id": "1",
        "city_name": "Bayan",
        "city_name_arabic": "بيان",
        "city_lat": "29.298107580815447",
        "city_long": "48.050959637603775"
        },
        {
          ....
        }
    }
}
                

Create order

To create a delivery order, you need to make a POST call at the following URL :

Sandbox : https://sandbox.delicon.co/api/v3/create-order

Production : https://delicon.co/api/v3/create-order


DESCRIPTION

Create Order Function will create an order and return the list of available Fleet Companies if the given params are correct.

QUERY PARAMETERS

Parameter Name Required Type Description
auth_key Yes string Provided by Delicon Team
email Yes string Provided by Delicon Team
delivery_date Yes date Date when delivery to be expected (Y-m-d i.e 2021-10-13)
delivery_time Yes time Time when delivery to be expected ( H:i:s i.e 12:20 PM )
dropoff_phone_no Yes integer Drop Off Phone No #
dropOff_street Yes string Drop Off Street #
dropOff_block_no Yes string Drop Off Block No #
extra_direction No string Extra Direction #
dropoff_city_id Yes integer Drop Off City Id #
is_exchange_order No string Exchange Order
cash_amount No string If you want driver should collect cash from customer.
dropoff_HouseNo Yes string Drop Off House No #
order_instruction No string Any instructions you want to be followed by delicon while processing order
apartment No string Apartment #
jaddah No string Enter Jaddah Address #
pickUp_city_id No string Pickup City ( get the city ID from get city api )
pickUp_block_no No string Pickup Block #
pickUp_street No string Pickup Street #
pickup_Jadda No string Pickup Jaddah
pickup_HouseNo No string Pickup House #
pickUp_phone_no No string Your pick up address phone number
pickup_Apartment No string Your Pickup Apartment
pickup_ExtraDirection No string Your Pickup Extra Direction
pickUp_address_name No string This address name is required if you are adding different pickup information

REQUEST

PHP Sample Request

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sandbox.delicon.co/api/v3/create-order',
  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 => 'email=&auth_key=&delivery_time=&delivery_date=&dropoff_phone_no=
                        &dropOff_street=&dropOff_block_no=&extra_direction=&dropoff_city_id=
                        &is_exchange_order=&cash_amount=&dropoff_HouseNo=&order_instruction=
                        &apartment=&jaddah=&pickUp_city_id=&pickUp_block_no&pickUp_street=
                        &pickup_Jadda=&pickup_HouseNo=&pickUp_phone_no=&pickup_Apartment=
                        &pickup_ExtraDirection=&pickUp_address_name=',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/x-www-form-urlencoded'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
                

RESPONSE

{
    "response": {
        "status": 200,
        "message": "Fleet companies found",
        "data": {
            "fleet_companies": [
                {
                    "price": 2,
                    "image": "https://sandbox.delicon.co/web/admin/images/
                        userprofile/1606400530828218.png",
                    "name": "PD Co",
                    "fleetCompanyId": 431,
                    "distance": 2.564
                },
                {
                    "price": 2,
                    "image": "https://sandbox.delicon.co/web/admin/
                        images/userprofile/",
                    "name": "KBco",
                    "fleetCompanyId": 967,
                    "distance": 2.564
                }
            ],
            "order_data": {
                "order_id": 35853
                "delivery_date": "2021-10-13",
                "delivery_time": "21:00:00",
                "dropOff_arear": "City :  Bayan , Block # : 1, Street # : 1 ,
                        House # : 1",
                "pickUp_arear": "City :  Bayan , Block # : test1, 
                        Street # : 29 Khalid Ibn Al Waleed St, Al Kuwayt, Kuwait
                        , Jaddah : test1 , House # : test1",
            }
        }
    }
}
                

Confirm Order

To confirm order, you need to make a POST call at the following URL :

Sandbox : https://sandbox.delicon.co/api/v3/confirm-order

Production : https://delicon.co/api/v3/confirm-order


DESCRIPTION

When you hit this function amount will be deducted from your wallet and order Function will fetch the order details if you have given the required params, correctly. Required params for 'GET ORDER CONFIRMATION DETAILS' function include “email”, “auth_key”, “fleet_company_id”, and “order_id”.

QUERY PARAMETERS

Parameter Name Required Type Description
auth_key Yes string Provided by Delicon Team
email Yes string Provided by Delicon Team
fleet_company_id Yes string Provided by Delicon Team
order_id Yes string Required i.e.: (1737)

REQUEST

PHP Sample Request

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sandbox.delicon.co/api/v3/confirm-order',
  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 => 'email=$auth_key=&fleet_company_id=&order_id=',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/x-www-form-urlencoded'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
                

RESPONSE

{
    "response": {
        "status": 200,
        "message": "Order created successfully.",
        "data": {
            "order_id": 30022,
            "price": 0,
            "payment_id": "62348afed0e7362348afed0e7b",
            "payment_method": "wallet",
            "fleetCompany": "test",
            "tracking_code": "62348B00F3605"
        }
    }
}                

Delivery Order Details

To get delivery order details, you need to make a POST call at the following URL :
https://sandbox.delicon.co/api/v3/order-details
Sandbox : https://sandbox.delicon.co/api/v3/order-details

Production : https://delicon.co/api/v3/order-details


DESCRIPTION

Get Order Function will fetch the order details if you have given the required params, correctly. Required params for 'Get DELIVERY ORDER DETAILS' function include “email”, “auth_key”, and “order_id”.

QUERY PARAMETERS

Parameter Name Required Type Description
auth_key Yes string Provided by Delicon Team
email Yes string Provided by Delicon Team
order_id Yes integar Required i.e.: (1737)

REQUEST

PHP Sample Request

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sandbox.delicon.co/api/v3/order-details',
  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 => 'email=&auth_key=&order_id=',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/x-www-form-urlencoded'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
                

RESPONSE

{
    "response": {
        "status": "200",
        "data": {
            "order_id": "1737",
            "price": "2",
            "usernmae": "",
            "payment_id": "5fff1907cd79f5fff1907cd7a2",
            "fleet_company_name": "",
            "delivery_date": "2018-05-14",
            "delivery_time": "11:00:00",
            "pickUp_arear": "29 Khalid Ibn Al Waleed St, Kuwait City, Kuwait",
            "dropoff_arear": "29 Khalid Ibn Al Waleed St, Kuwait City, Kuwait",
            "driver": "",
            "cash": "",
            "status": "Pending",
            "order_instruction": "",
        }
    }
}
                

Get All Delivery Orders

To get all orders, you need to make a POST call at the following URL :

Sandbox : https://sandbox.delicon.co/api/v3/all-orders

Production : https://delicon.co/api/v3/all-orders


DESCRIPTION

Get All Orders Function will fetch users all orders and orders details if you have given the required params, correctly. Required Params for 'Get All Orders' function include “Email" and “auth_key”.

QUERY PARAMETERS

Parameter Name Required Type Description
auth_key Yes string Provided by Delicon Team
email Yes string Provided by Delicon Team
pageno No integar i.e. 1

REQUEST

PHP Sample Request

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sandbox.delicon.co/api/v3/all-orders',
  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 => 'email=&auth_key=&pageno=',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/x-www-form-urlencoded'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
                

RESPONSE

{
"response":
    {
        "status": "200",
        "data": {
            "total_pages": 1,
            "total_rows": 8,
            "current_page": 1,
            "per_page": 20,
            "orders": [
                {
                "order_id": "1737",
                "price": "2",
                "usernmae": "",
                "payment_id": "5fff1907cd79f5fff1907cd7a2",
                "fleet_company_name": "",
                "delivery_date": "2018-05-14",
                "delivery_time": "11:00:00",
                "pickUp_arear": "29 Khalid Ibn Al Waleed St, Kuwait City, Kuwait",
                "dropoff_arear": "29 Khalid Ibn Al Waleed St, Kuwait City, Kuwait",
                "driver": "",
                "cash": "",
                "status": "Pending",
                "order_instruction": "",
                }
                { ......
                }
            ]
        }
    }
}
                

Cancel Order Request

To cancel a order, you need to make a POST call at the following URL :

Sandbox : https://sandbox.delicon.co/api/v3/cancel-order-request

Production : https://delicon.co/api/v3/cancel-order-request


DESCRIPTION

Cancel Order Request Function will send a request to admin to make the approval for order cancellation if the delivery time gap is at least one hour. Required params for 'Cancel Order Request' function include “Email”, “auth_key”, and “order_id”.

QUERY PARAMETERS

Parameter Name Required Type Description
auth_key Yes string Provided by Delicon Team
email Yes string Provided by Delicon Team
order_id Yes integar Required i.e.: (2028)

REQUEST

PHP Sample Request


$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sandbox.delicon.co/api/v3/cancel-order-request',
  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 => 'order_id=&email=&auth_key=',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/x-www-form-urlencoded'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
                

RESPONSE

        {
            "response": {
                "status": 200,
                "message": "Request has sent for Approval !",
                "data": ""
            }
        }