API
the Wakilni offers an API to help create and manage orders from third-party applications.
Developers can use this API to integrate Wakilni into their custom applications.
Below are steps required, along with detailed documentation on the API.
URL
-> https://api-dev.wakilni.comYou need to register as a new client in
https://dev.wakilni.com/sign-up
and complete the integration as followed in the documentation.If everything went right, please find the
Production
data (use data below instead of the data in the Testing Environment section)URL
-> https://api.wakilni.com- 1.Each client will be able to generate an access token that is attached to your account to be used in the API.
- 1.Login to customer back office
- 2.Go to Settings
- 3.Open tab “Api Tokens”
- 4.Click “Link to your custom app”
- 5.Enter your shop name/label.
- 6.Click create
- 7.A key/secret combination will be created for this client.
- 8.Copy these credentials and pass them to the request of the auth api.
- 9.A token will be generated, which you can pas as a bearer token in the other apis.
- Bulk process is divided into 2 flows: pickup bulk and delivery bulk
- Pickup bulk: driver pickups the product from the vendor
- Delivery bulk: driver delivers the product to the recipient
- Shipping price: Wakilni has default delivery prices based on pickup/delivery locations. Also, each customer can have his own customized prices.
- Api process:
- Start bulk: creates pickup bulk order (multiple bulks can be created)
- Add delivery: creates delivery order related to pickup bulk (multiple deliveries can be created)
- End bulk: orders become active and are sent to portal for shipping
- Show order status: shows order status based on the flow update Status/ Status Code:
- PENDING = 1
- CONFIRMED = 2
- DECLINED = 6
- CANCELED = 7
- PROCESSING = 3
- SUCCESS = 4
- FAILED = 5
- CLOSED_FAILED = 8
Method: GET
Body:
{
"key": string,
"secret": string
}
key
: App keysecret
: App secret
Response
{
"message": "Auth token retrieved successfully",
"token": "*****"
}
Method: POST
Header: Authorization: Bearer {token}
Body:
{
"location_id": number,
"longitude": number,
"latitude": number,
"floor": number,
"area": string,
}
location_id
: customer’s location id reference from your applongitude
: customer’s location’s longitudelatitude
: customer’s location’s latitudefloor
: customer’s location’s floorarea
: it is preferable to send us the area name from the list provided from get area’s list
Response
{
"message": "Bulk order opened",
"bulk_id"
}
Method: POST
Header: Authorization: Bearer {token}
Body:
{
"get_order_details": boolean,
"get_barcode": boolean,
"waybill": number,
"receiver_id": number,
"receiver_first_name": string,
"receiver_last_name": string,
"receiver_phone_number": string,
"receiver_gender": string,
"receiver_email": string,
"receiver_secondary_phone_number": string,
"receiver_location_id *": number,
"receiver_longitude": number,
"receiver_latitude": number,
"receiver_building": string,
"receiver_floor": number,
"receiver_directions": string,
"receiver_area": string,
"currency": number,
"cash_collection_type_id": number,
"collection_amount": double,
"note: string,
"car_needed": bool,
}
get_order_details
: Set to true if you want to display order details after creating orderget_barcode
: Set to true if you want the barcode label returnedwaybill
: To reference or identify your orderreceiver_id
: Customer’s recipient’s id reference from your appreceiver_first_name
: Recipient’s first namereceiver_last_name
: Recipient’s last namereceiver_phone_number
: Recipient’s phone numberreceiver_gender
: Recipient’s gender (1 -> male, 2 -> female)receiver_email
: Recipient’s emailreceiver_secondary_phone_number
: Recipient’s secondary phone numberreceiver_location_id *
: Recipient’s location id reference from your appreceiver_longitude
: Customer’s location’s longitudereceiver_latitude
: Customer’s location’s latitudereceiver_building
: Customer’s location’s buildingreceiver_floor
: Customer’s location’s floorreceiver_directions
: Customer’s location’s directionsreceiver_area
: It is preferable to send us the area name from the list provided from get area’s listcurrency
: 1 -> USD, 2 -> LBPcash_collection_type_id
: (paid: 54, on delivery: 52)
Response:
{
"message": "Delivery order added",
"delivery_id",
"tracking_url",
"tracking_id",
"barcode_label",
"order_details"
}
Note: for use of barcode label to display barcode image, add the blob value to the image src as follows:
<img src="data:image/png;base64,{{barcode_label)}}" alt="barcode"/>
Method: POST
Header: Authorization: Bearer {token}
Response:
{
"message": "Closed Bulk order",
"bulk_id"
}
Method: POST
Header: Authorization: Bearer {token}
Response:
{
"status"
"status_code"
"completed_on"
}
Method: POST
Header: Authorization: Bearer {token}
Response:
{
"status"
"status_code"
"completed_on"
}
Method: PUT
Header: Authorization: Bearer {token}
Body:
{
"reason": string,
}
reason
: Reason for canceling the order
Response:
{
"message": string,
"delivery_id": number
}
Note: You are able to cancel an order only if the status is pending
Method: GET
Header: Authorization: Bearer {token}
Last modified 2mo ago