Fez Business API
  • Introduction
  • API ENDPOINTS
    • Auth
      • Authenticate
      • Logout
      • Change Password
    • Orders
      • Create
      • Get
      • Update
      • Delete
      • Search
      • Search via Waybill Number
      • Status With Date Range
      • Fetch Delivery Cost
      • Track
      • Delivery Time Estimate
    • International Orders
      • Create Import Order
      • Import Items Categories
      • Import Locations
      • Import Delivery Cost
      • Export Locations
      • Create Export Order
      • Export Delivery Cost
    • Users
      • Create
      • Get All
      • Delete
    • Locker
      • Get All
      • Check Availability
    • Webhook
      • Register Order Webhook
      • Order Webhook Request
Powered by GitBook
On this page
  1. API ENDPOINTS
  2. Orders

Search

This endpoint allows you spool your orders.

Search Order

Endpoint => /orders/search

POST /orders/search

Headers

Name
Type
Description

Authorization *

String

Your Bearer Token

secret-key*

String

Your Secret Key

Request Body

Name
Type
Description

startDate*

String

Start of the search date range

orderNo

String

Order number

recipientName

String

Recipient Name

recipientPhone

String

Recipient Phone or Mobile number

orderStatus

String

Enum value: Pending Pick-Up,Picked-Up,Dispatched,Delivered,Returned

OrgRep

String

This is the user_id of the user who created the order

endDate*

String

End of the search date range

page*

Integer

The endpoint returns a maximum of 50 records. If the search result is more that 50, a link object is created that specifies the page Number of the next page. Please pass this number in your subsequent request to fetch the remaining records.

{
  "status": "Success",
  "description": "Order Fetched Successfully",
  "orders": {
    "current_page": 1,
    "data": [
      {
        "orderNo": "O41027012333",
        "recipientName": "Femi",
        "recipientEmail": "",
        "recipientAddress": "Idumota",
        "recipientPhone": "08000000000000",
        "orderStatus": "Pending Pick-Up",
        "statusDescription": null,
        "cost": "900",
        "createdBy": "C-39006-611",
        "OrgRep": "G-ylNt-c7xD",
        "orderDate": "2023-01-27 02:46:33",
        "pickUpDate": "0000-00-00 00:00:00",
        "dispatchDate": null,
        "deliveryDate": null,
        "returnReason": null,
        "returnDate": null
      },
      {
        "orderNo": "JN7327012333",
        "recipientName": "Femi2",
        "recipientEmail": "",
        "recipientAddress": "Idumota3",
        "recipientPhone": "08000000000000",
        "orderStatus": "Pending Pick-Up",
        "statusDescription": null,
        "cost": "900",
        "createdBy": "C-39006-611",
        "OrgRep": "G-ylNt-c7xD",
        "orderDate": "2023-01-27 02:46:33",
        "pickUpDate": "0000-00-00 00:00:00",
        "dispatchDate": null,
        "deliveryDate": null,
        "returnReason": null,
        "returnDate": null
      },
      {
        "orderNo": "9KDT27012348",
        "recipientName": "Femi",
        "recipientEmail": "",
        "recipientAddress": "Idumota",
        "recipientPhone": "08000000000000",
        "orderStatus": "Pending Pick-Up",
        "statusDescription": null,
        "cost": "900",
        "createdBy": "C-39006-611",
        "OrgRep": "G-ylNt-c7xD",
        "orderDate": "2023-01-27 02:46:48",
        "pickUpDate": "0000-00-00 00:00:00",
        "dispatchDate": null,
        "deliveryDate": null,
        "returnReason": null,
        "returnDate": null
      },
      {
        "orderNo": "M7W727012349",
        "recipientName": "Femi2",
        "recipientEmail": "",
        "recipientAddress": "Idumota3",
        "recipientPhone": "08000000000000",
        "orderStatus": "Pending Pick-Up",
        "statusDescription": null,
        "cost": "900",
        "createdBy": "C-39006-611",
        "OrgRep": "G-ylNt-c7xD",
        "orderDate": "2023-01-27 02:46:49",
        "pickUpDate": "0000-00-00 00:00:00",
        "dispatchDate": null,
        "deliveryDate": null,
        "returnReason": null,
        "returnDate": null
      },
      {
        "orderNo": "JHAZ27012319",
        "recipientName": "Femi2",
        "recipientEmail": "",
        "recipientAddress": "Idumota3",
        "recipientPhone": "08000000000000",
        "orderStatus": "Pending Pick-Up",
        "statusDescription": null,
        "cost": "900",
        "createdBy": "C-39006-611",
        "OrgRep": "G-ylNt-c7xD",
        "orderDate": "2023-01-27 02:47:19",
        "pickUpDate": "0000-00-00 00:00:00",
        "dispatchDate": null,
        "deliveryDate": null,
        "returnReason": null,
        "returnDate": null
      },
      {
        "orderNo": "333R27012331",
        "recipientName": "Femi",
        "recipientEmail": "",
        "recipientAddress": "Idumota",
        "recipientPhone": "08000000000000",
        "orderStatus": "Pending Pick-Up",
        "statusDescription": null,
        "cost": "900",
        "createdBy": "C-39006-611",
        "OrgRep": "G-ylNt-c7xD",
        "orderDate": "2023-01-27 02:53:31",
        "pickUpDate": "0000-00-00 00:00:00",
        "dispatchDate": null,
        "deliveryDate": null,
        "returnReason": null,
        "returnDate": null
      }
    ],
    "first_page_url": "https://apisandbox.fezdelivery.co/v1/orders/search?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://apisandbox.fezdelivery.co/v1/orders/search?page=1",
    "next_page_url": null,
    "path": "https://apisandbox.fezdelivery.co/v1/orders/search",
    "per_page": 50,
    "prev_page_url": null,
    "to": 6,
    "total": 6
  }
}
{
    "status": "Error",
    "description": "Organization Secret Key is Required"
}
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://apisandbox.fezdelivery.co/v1/orders/search',
  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 =>'{
    "startDate":"2019-08-26",
    "endDate":"2023-10-10"
}',
  CURLOPT_HTTPHEADER => array(
    'secret-key: {{Your Secret key}}'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

The startDate and endDate is based on order Date.

PreviousDeleteNextSearch via Waybill Number

Last updated 1 year ago