Third party companies, who have been approved by the management, can create and assign orders to their couriers.
The goal of this document is to give a overview of that process
A token should be created before an employee can create an order, this token will be sent with every request made by a company to create and store an order.
The following required parameters are used to create and store and orders for a company
| Param | Required? | Description |
|---|---|---|
| token | Yes | A toekn created by an employee of the company |
| customer_name | Yes | The name of the person or place the items will be delivered to. |
| customer_phone | Yes | The phone number of the person or place the items will be delivered to. |
| customer_address | Yes | The address of the person or place the items will be delivered to. |
| customer_city | Yes | The name of the city the items will be delivered to. |
| customer_state | Yes | The name of the state the items will be delivered to. |
| customer_coutry | Yes | The name of the coutry the items will be delivered to. |
| order_reference | Yes |
A unique string that will be used to reference the order. if it is not provided, the system will may generate one. |
| outlet_name | Yes | The name of the person or place the items will be purchased or picked up from. |
| outlet_phone | Yes | The phone number of the person or place the items will be purchased or picked up from. |
| outlet_address | Yes | The address of the person or place the items will be purchased or picked up from. |
| outlet_city | Yes | The name of the coutry the items will be delivered to. |
| outlet_state | Yes | The name of the state the items will be delivered to. |
| outlet_country | Yes | The name of the country the items will be delivered to. |
| order_payment_method | Yes | An object that holds the details of the method of payment used such as id, icon, name |
The following optional parameters are used to create and store and orders for a company
| Param | Required | Description |
|---|---|---|
| order_reference | No | A unique string to reference the order. if none is provided the system will generate one. |
| customer_id | No | A unique string to identify the customer. |
| customer_email | No | The email address of the customer |
| customer_picture | No | A picture of the customer |
| customer_location_latitude | No | The latitude of the customer given address |
| customer_location_longitude | No | The longitude of the customer given address |
| customer_zip | No | The zip code of the customer's given address |
| customer_comment | No | a message from the customer |
| order_amount | No | The total cost of the order in naira |
| order_discount | No | Discount received for purchase of order |
| order_service_fee | No | Charge accrued for completion of order |
| order_delivery_fee | No | The amount paid for carrying out the delivery |
| order_insurance_fee | No | The amount paid for insuring the parcel |
| order_handling_fee | No | The additional amount charged for handling the parcel |
| order_tax_fee | No | The value added tax |
| order_currency | No | The currency of the order |
| outlet_id | No | The identification number of the outlet. If the outlet has already been saved prior to current transaction |
| outlet_email | No | The email address of the outlet |
| outlet_picture | No | A picture of the outlet |
| outlet_location_latitude | No | The latitude of the outlet's given address |
| outlet_location_longitude | No | The longitude of the outlet's given address |
| outlet_zip | No | The zipcode of the outlet's given address |
| order_items | No | An array of objects, each object holds the data of each item ordered such as: name, quantity, price, options |
| order_description | No | A brief description of the order |
| order_picture | No | A picture to represent the order |
| order_paid | No | Boolean, indicates if the order has been paid for. |
| order_payment_confirmed | No | Boolean, indicates if the paymeent has been confirmed |
See sample request
const createOrder = async () => {
const res = await axios({
method: post,
url: url,
data: {
token: "eyJpeiI6IlVCMThNbDRuOEkrYmFhQklXVttnmFmIn0=",
customer_id: "6o88798i99",
customer_name: "mikasa ackerman",
customer_email: "mikasa@gmail.com",
customer_phone: "080997767665",
customer_address: "no 4 wall rose district",
customer_city: "lekki",
customer_state: "lagos",
customer_country: "Nigeria",
customer_comment: "Dont squeeze the scarf",
order_reference: "32kp3j55jr904",
order_amount: 12400,
order_delivery_fee: 400,
order_insurance_fee: 400,
order_handling_fee: 10,
order_tax_fee: 0,
order_currency: "NGN",
outlet_name: "Diamond",
outlet_phone: "0812344556677",
outlet_location_latitude: "16.972741",
outlet_location_longitude: "19.972741",
outlet_address: "30 isianu street",
outlet_city: "independence layout",
outlet_state: "Enugu",
outlet_country: "Nigeria",
order_payment_method : {
name: "paystack",
icon: "https://paystack.com/blog/public/assets/images/logo/paystack-logo.svg",
},
order_paid: true,
order_payment_confirmed: true,
order_items: [
{
name: "pizza",
price: 4000,
quantity: 1,
options: [
{
name: "beef topings",
price: 500
}
]
},
{
name: "rice and stew"
price: 3000,
quantity: 2,
options: [
{
name: "fried plantain",
price: 300
},
{
name: "beef",
price: 200,
quantity: 3
}
]
}
]
}
});
}
After an order has been created, you can assign it to an active rider. A list of active riders will be available for you to pick from.