0% found this document useful (0 votes)
139 views

Daewoo Express COD Home Delivery - API Integration Guide - Version 1.3-1

This document provides a summary of DEPBS API methods for booking cash on delivery home deliveries. It includes GET methods to retrieve locations and calculate tariffs, as well as POST methods to book and track deliveries. Version 1.6 of the API introduced updates to the booking method to allow customers to book from multiple locations using the same credentials. The API requires an API key, user, and password provided by DEPBS to authenticate requests.

Uploaded by

Zaheer Abbas
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
139 views

Daewoo Express COD Home Delivery - API Integration Guide - Version 1.3-1

This document provides a summary of DEPBS API methods for booking cash on delivery home deliveries. It includes GET methods to retrieve locations and calculate tariffs, as well as POST methods to book and track deliveries. Version 1.6 of the API introduced updates to the booking method to allow customers to book from multiple locations using the same credentials. The API requires an API key, user, and password provided by DEPBS to authenticate requests.

Uploaded by

Zaheer Abbas
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

VERSION 1.

6
UPDATED ON 08th September, 2021
DEPBS – COD HOME DELIVERY API INTEGRATION GUIDE Version 1.6

COPYRIGHT
This is unpublished, confidential document of DEPBS (Daewoo Express Pakistan Bus Service).
No part of this document may be reproduced, stored in retrieval form, adopted or transmitted
in any form or by any means, electronic, mechanical, photographic, graphic, optic or otherwise,
translated in any language or computer language, without prior written permission from DEPBS.

This document has been prepared with all due diligence, however, DEPBS, makes no
representation or warranties with respect to the contents hereof and shall not be responsible for
any loss or damage caused to the user by the direct or indirect use of this document and the
accompanying information. Furthermore DEPBS, reserves the right to alter, modify or otherwise
change in any manner the content hereof, without the obligation to notify any person of such
revision or changes. All registered and trademarked names referred to in this document are
owned by their respective owners.

Page 2 of 16
DAEWOO EXPRESS BUS SERVICE PAKISTAN
DOCUMENT HISTORY

DATE AUTHOR STATUS

29th Sep, 2018 MUHAMMAD ARIF Initial document created.

New Order ID Parameter added in Quick


03rd Oct, 2018 MUHAMMAD ARIF
Booking and tracking for order reference.

New API Endpoints to Cancel booking and to


09th Jan, 2019 MUHAMMAD ARIF calculate tariff rates against selected
category

New Booking Endpoint to enable customers


27th June, 2019 MUHAMMAD ARIF to book from multiple locations using same
credentials.

12th Nov, 2019 MUHAMMAD ARIF New Item description parameter.

08th Sep, 2021 MUHAMMAD ARIF Booking API Updated


DEPBS – COD HOME DELIVERY API INTEGRATION GUIDE Version 1.6

TABLE OF CONTENTS

SR NO TITLE PAGE
1 INTRODUCTION 5
2 PRE-REQUISITES 6
3 API METHODS 6
3.1 GET LOCATIONS 6
3.2 QUICK BOOK 7
3.3 TRACKING 10
3.4 QUICK CANCEL 12
3.5 CALCULATE TARIFF 14

Page 4 of 16
DAEWOO EXPRESS BUS SERVICE PAKISTAN
DEPBS – COD HOME DELIVERY API INTEGRATION GUIDE Version 1.6

1. INTRODUCTION
This API Integration Guide is a technical integration document for clients to interface DEPBS cargo
system and allow them for booking Cash on Delivery (Home Delivery) consignments over the
Internet.

It shows how to use various functionalities and describes interfacing specifications to furnish a
consignment booking request.

API provides access to its functionalities through below listed web services:

SR NO WEB SERVICE DESCRIPTION


1 LOCATION DEPBS available and active cargo terminals.
2 BOOKING Get information from end user and book a consignment.
3 TRACKING Track a shipment status

Page 5 of 16
DAEWOO EXPRESS BUS SERVICE PAKISTAN
DEPBS – COD HOME DELIVERY API INTEGRATION GUIDE Version 1.6

2. PRE-REQUISITES
To use DEPBS Cargo APIs each client must have below listed pre requisites provided by
DEPBS.
1- API Key: Provided by Daewoo.
2- API User: Provided by Daewoo.
3- API Password: Provided by Daewoo.

3. WEB SERVICES
Below is the list of web services to perform various functionalities to book a COD consignment
or to track a consignment.

3.1. Get Locations


Get locations method will provide all the possible destination locations.

WEB SERVICE getLocations


DESCRIPTION Get locations allowed for booking a COD Home Delivery consignment.
API Link /api/cargo/getLocations?apiKey=[API_KEY]&apiUser=[API_USER]&apiPassword=[API_PASS]
Request Type HTTP GET Request
INPUT PARAMETERS
PARAMETERS DESCRIPTION MANDATORY/OPTIONAL DATA TYPE
apiKey Unique alphanumeric key provided by Daewoo. Mandatory String
Unique user id provided by Daewoo to access
apiUser Mandatory String
API.
apiPassword Alphanumeric password for user authorization. Mandatory String
OUT PARAMETERS
KEY DESCRIPTION DATA FORMAT DATA TYPE
Boolean value indicating if the operation is
Success JSON Boolean
successful or not.
Boolean value indicating if any error is occurred
Error JSON Boolean
during the request operation.
Response Response Message JSON String
ResponseDetail Response Detail JSON String
Array of JSON
Data Destination Data JSON
Objects

Page 6 of 16
DAEWOO EXPRESS BUS SERVICE PAKISTAN
DEPBS – COD HOME DELIVERY API INTEGRATION GUIDE Version 1.6

3.1.2. Sample Request/Response Body


Request Body:
string ReqURL = @"https://codapi.daewoo.net.pk/";

string myMethod = @"api/cargo/getLocations?apiKey=[API_KEY]&apiUser=[API_USER]&apiPassword=[API_PASS]";

try{

using (var client = new HttpClient()) {

client.BaseAddress = new Uri(ReqURL);

var result = client.GetAsync(myMethod);

object resultContent = result.Result.Content.ReadAsStringAsync();

}}

catch (Exception ex)

{MessageBox.Show(ex.Message);}

Response Body:
{

"Success":true,
"Error":false,
"Response":"",
"ResponseDetail":"",
"Data":[
{
"terminal_id":10,
"terminal_name":"FAISALABAD"
},
{
"terminal_id":14,
"terminal_name":"HYD (LATIFABAD)"
}
]
}

3.2. Quick Book


This service method will allow user to book consignment for specific destination.
WEB SERVICE quickBook (From Single Location)
DESCRIPTION Perform COD Home Delivery consignment booking.
API Link api/booking/quickBook?apiKey=[API_KEY]&apiUser=[API_USER]&apiPassword=[API_PASS]
Request Type HTTP POST Request
INPUT PARAMETERS
PARAMETERS DESCRIPTION MANDATORY/OPTIONAL DATA TYPE

Page 7 of 16
DAEWOO EXPRESS BUS SERVICE PAKISTAN
DEPBS – COD HOME DELIVERY API INTEGRATION GUIDE Version 1.6

apiKey Unique alphanumeric key provided by Daewoo. Mandatory String


Unique user id provided by Daewoo to access
apiUser Mandatory String
API.
apiPassword Alphanumeric password for user authorization. Mandatory String
JSON Model body containing consignment JSON Body
cNModel Mandatory
details Object
OUT PARAMETERS
KEY DESCRIPTION DATA FORMAT DATA TYPE
Boolean value indicating if the operation is
Success JSON Boolean
successful or not.
Boolean value indicating if any error is occurred
Error JSON Boolean
during the request operation.
Boolean value indicating if any validation error is
Validations JSON Boolean
occurred during the request operation.
Response Response Message from the API. JSON String
Unique Tracking Number assigned to the
TrackNo JSON String
consignment.
Barcode Unique barcode assigned to consignment. JSON String
CashCollection Cash collection amount from the customer. JSON String
OrderId Order ID for reference. JSON String

WEB SERVICE quickBookV3 (From multiple locations)


DESCRIPTION Perform COD Home Delivery consignment booking.
API Link api/booking/quickBookV3?apiKey=[API_KEY]&apiUser=[API_USER]&apiPassword=[API_PASS]
Request Type HTTP POST Request
INPUT PARAMETERS
PARAMETERS DESCRIPTION MANDATORY/OPTIONAL DATA TYPE
apiKey Unique alphanumeric key provided by Daewoo. Mandatory String
Unique user id provided by Daewoo to access
apiUser Mandatory String
API.
apiPassword Alphanumeric password for user authorization. Mandatory String
JSON Body
cNModel JSON Model body containing consignment details Mandatory
Object
OUT PARAMETERS
KEY DESCRIPTION DATA FORMAT DATA TYPE
Boolean value indicating if the operation is
Success JSON Boolean
successful or not.
Boolean value indicating if any error is occurred
Error JSON Boolean
during the request operation.
Boolean value indicating if any validation error is
Validations JSON Boolean
occurred during the request operation.
Response Response Message from the API. JSON String
Unique Tracking Number assigned to the
TrackNo JSON String
consignment.
Barcode Unique barcode assigned to consignment. JSON String

Page 8 of 16
DAEWOO EXPRESS BUS SERVICE PAKISTAN
DEPBS – COD HOME DELIVERY API INTEGRATION GUIDE Version 1.6

CashCollection Cash collection amount from the customer. JSON String


OrderId Order ID for reference. JSON String

3.2.1. Sample Request/Response Body


Request Body:
string ReqURL = @"https://codapi.daewoo.net.pk/";
string myJson = @"{
'order_no':'0000000',
'source_terminal_id':'0',
'destination_terminal_id':'18',
'receiver_name':'Arif',
'receiver_cnic':'3630234219423',
'receiver_mobile':'03364199945',
'receiver_address':'Multan,Pakistan',
'receiver_city':'Multan',
'receiver_email':'[email protected]',
'remarks':'',
'category_id':'0',
'qty':'1',
'weight':'1.2',
'barcode':'0',
'cod_amount': '2000',
‘source_location_point’: ‘0.0’,
"destination_location_point": "0.0",
"source_location_address": "Source address",
"destination_location_address": "destination address" ,
"item_description":"Item Description"}";
string myMethod =
@"api/booking/quickBook[version]?apiKey=[API_KEY]&apiUser=[API_USER]&apiPassword=[API_PASS]";
client.BaseAddress = new Uri(ReqURL);
var content = new StringContent(myJson, Encoding.UTF8, "application/json");
var result = client.PostAsync(myMethod, content);
object resultContent = result.Result.Content.ReadAsStringAsync();

Response Body:
{
"Success": true,
"Error": false,
"Validations": true,
"Response": "Consignment Has been saved succesfully!",
"TrackNo": "181291509",
"Barcode": "3000000003",
"CashCollection": "2000",
"OrderId": "000000"
}

Page 9 of 16
DAEWOO EXPRESS BUS SERVICE PAKISTAN
DEPBS – COD HOME DELIVERY API INTEGRATION GUIDE Version 1.6

3.3. Tracking
This service method allows you to track the consignment in real-time.
WEB SERVICE quickTrack
DESCRIPTION Real-time tracking
API Link api/booking/quickTrack?trackingNo=[Tracking_No]
Request Type HTTP GET Request
INPUT PARAMETERS
PARAMETERS DESCRIPTION MANDATORY/OPTIONAL DATA TYPE
Unique Tracking # assigned to consignment by
trackingNo Mandatory String
Quick-Track API method.
OUT PARAMETERS
KEY DESCRIPTION DATA FORMAT DATA TYPE
Boolean value indicating if the operation is
Success JSON Boolean
successful or not.
Boolean value indicating if any error is occurred
Error JSON Boolean
during the request operation.
Response API response. JSON String
CurrentTrackStatus Consignment Tracking information. JSON JSON Object
TrackingDetails Consignment Home-Delivery tracking details. JSON JSON Object

3.3.1. Sample Request/Response Body


Request Body:
string ReqURL = @"https://codapi.daewoo.net.pk/";
string myMethod = @"api/booking/quickTrack?trackingNo=[TRACK_NO]";
using (var client = new HttpClient())
{
client.BaseAddress = new Uri(ReqURL);
var result = client.GetAsync(myMethod);
object resultContent = result.Result.Content.ReadAsStringAsync();
}

Response Body:
{
"Result": {
"Success": true,
"Error": false,
"Response": "Tracking Successfull",
"CurrentTrackStatus": [
{
"track_no": 181302021,

Page 10 of 16
DAEWOO EXPRESS BUS SERVICE PAKISTAN
DEPBS – COD HOME DELIVERY API INTEGRATION GUIDE Version 1.6

"order_id": "157598",
"booking_date_time": "2018-10-03T09:39:06.08",
"customer": "ELO API COD HD CREDIT",
"payment_mode_name": "COD CREDIT - (1) Service Charges Included In Product Price",
"CODMode": "SC In Product Price",
"source_terminal": "FAISALABAD",
"source_ccp": "MAIN",
"destination_terminal": "LAHORE",
"destination_ccpi": "THOKAR",
"status_name": "Booked",
"amount_cod": 2000,
"remarks": "",
"web_track_code": 4198,
"tweight": 1.2,
"tpieces": 1,
"tqty": 1,
"sender_name": "ELO API COD HD CREDIT",
"sender_contact1": "",
"sender_address1": "",
"sender_city": "FAISALABAD",
"sender_cnic": "",
"sender_email": "",
"receiver_name": "Arif",
"receiver_contact1": "03364199945",
"receiver_address1": "Multan,Pakistan",
"receiver_city": "Multan",
"receiver_cnic": "3630234219423",
"receiver_email": "[email protected]"
}
],
"TrackingDetails": [
{
"booking_no": 181291509,
"BarCode": 3000000003,
"Date": "Oct 1 2018 11:15AM",
"PortalDate": "2018-10-01 11:15:50",
"Status": "OR - ON ROUTE",
"Status_Reason": "ON ROUTE",
"TransactionTerminal": "LAHORE - THOKAR",
"add_user": "KASHIF",
"remarks": "",
"Collector_Name": "",
"Collector_Contact": "",
"Collector_Cnic": "",
"Rem": "Sheet # 26817 | Delivery # 8397",
"Collector_Relation": ""
},
{
"booking_no": 181291509,
"BarCode": 3000000003,
"Date": "01/10/2018 11:16:01",
"PortalDate": "01/10/2018 11:16:01",
"Status": "OK - DELIVERED",
"Status_Reason": "DELIVERED",

Page 11 of 16
DAEWOO EXPRESS BUS SERVICE PAKISTAN
DEPBS – COD HOME DELIVERY API INTEGRATION GUIDE Version 1.6

"TransactionTerminal": "LAHORE - THOKAR",


"add_user": "KASHIF",
"remarks": "",
"Collector_Name": "",
"Collector_Contact": "AAAAAAAA",
"Collector_Cnic": "",
"Rem": "Sheet # 26817 | Delivery # 8397",
"Collector_Relation": "OWNER"
}
] },
"Id": 92,
"Exception": null,
"Status": 5,
"IsCanceled": false,
"IsCompleted": true,
"CreationOptions": 0,
"AsyncState": null,
"IsFaulted": false
}

Page 12 of 16
DAEWOO EXPRESS BUS SERVICE PAKISTAN
DEPBS – COD HOME DELIVERY API INTEGRATION GUIDE Version 1.6

3.4. Booking Cancellation


This service method allows you to cancel a booking in real-time.
WEB SERVICE quickCancel
DESCRIPTION Booking cancellation
/api/booking/quickCancel?apiKey=[API_KEY]&apiUser=[API_USER]
API Link
&apiPassword=[API_PASSWORD]&trackingNo=[TRACKING NO]
Request Type HTTP POST Request
INPUT PARAMETERS
PARAMETERS DESCRIPTION MANDATORY/OPTIONAL DATA TYPE
apiKey Unique alphanumeric key provided by Daewoo. Mandatory String
Unique user id provided by Daewoo to access
apiUser Mandatory String
API.
apiPassword Alphanumeric password for user authorization. Mandatory String
Unique Tracking # assigned to consignment by
trackingNo Mandatory String
Booking API endpoint.
OUT PARAMETERS
KEY DESCRIPTION DATA FORMAT DATA TYPE
Boolean value indicating if the operation is
Success JSON Boolean
successful or not.
Boolean value indicating if any error is occurred
Error JSON Boolean
during the request operation.
Response API response. JSON String

3.4.1. Sample Request/Response Body


Request Body:
string ReqURL = @"https://codapi.daewoo.net.pk/";
string myMethod =
@"api/booking/quickCancel?apiKey[API_KEY]&apiUser=[API_USER]&apiPassword=[API_PASSWORD]&trackingNo=[TRACKI
NG NO]
using (var client = new HttpClient())
{
client.BaseAddress = new Uri(ReqURL);
var result = client.PostAsync(myMethod);
object resultContent = result.Result.Content.ReadAsStringAsync();
}

Response Body:
{
"Success": true, "Error": false, "Response": "Booking has been cancelled."
}

Page 13 of 16
DAEWOO EXPRESS BUS SERVICE PAKISTAN
DEPBS – COD HOME DELIVERY API INTEGRATION GUIDE Version 1.6

3.5. Calculate Tariff Rate


This service method allows you to calculate tariff rate against selected category.
WEB SERVICE quickCalculateRate
DESCRIPTION Calculate tariff rate
/api/booking/quickCalculateRate?apiKey=[API_KEY]&apiUser=[API_USER]
API Link
&apiPassword=[API_PASSWORD]
Request Type HTTP POST Request
INPUT PARAMETERS
PARAMETERS DESCRIPTION MANDATORY/OPTIONAL DATA TYPE
apiKey Unique alphanumeric key provided by Daewoo. Mandatory String
Unique user id provided by Daewoo to access
apiUser Mandatory String
API.
apiPassword Alphanumeric password for user authorization. Mandatory String
JSON Body
cNModel JSON Model body containing item information. Mandatory
Object
OUT PARAMETERS
KEY DESCRIPTION DATA FORMAT DATA TYPE
Boolean value indicating if the operation is
Success JSON Boolean
successful or not.
Boolean value indicating if any error is occurred
Error JSON Boolean
during the request operation.
Boolean value indicating if any validation error is
Validations JSON Boolean
occurred during the request operation.
Response API response. JSON String
Service Charges / Tariff amount calculated
ServiceCharges JSON Decimal
against selected category

3.5.1. Sample Request/Response Body


Request Body:
string ReqURL = @"https://codapi.daewoo.net.pk/";
string myJson = @"{
"destination_terminal_id" : "10",
"qty" : "1",
"weight" : "1.5"
}";
string myMethod = @"api/booking/quickCalculateRate?apiKey=[API_KEY]&apiUser=[API_USER]
&apiPassword=[API_PASS]&trackingNo=[TRACKING_NO]";
client.BaseAddress = new Uri(ReqURL);
var content = new StringContent(myJson, Encoding.UTF8, "application/json");
var result = client.PostAsync(myMethod, content);
object resultContent = result.Result.Content.ReadAsStringAsync();

Page 14 of 16
DAEWOO EXPRESS BUS SERVICE PAKISTAN
DEPBS – COD HOME DELIVERY API INTEGRATION GUIDE Version 1.6

Response Body:
{
"Success": true,
"Error": false,
"Validations": true,
"Response": "",
"ServiceCharges": 208
}

Page 15 of 16
DAEWOO EXPRESS BUS SERVICE PAKISTAN
DEPBS – COD HOME DELIVERY API INTEGRATION GUIDE Version 1.6

THANK YOU
DEPBS
DAEWOO EXPRESS PAKISTAN BUS SERVICE
MIS TEAM, ALL COPY RIGHTS RESERVED 2018 - 2020

Page 16 of 16
DAEWOO EXPRESS BUS SERVICE PAKISTAN

You might also like