COD API UserManual
COD API UserManual
Version 1.0
1
API User Guide
Version 1.0
Table of Contents
API Listing ....................................................................................................................................................................................................................... 4
Our List of API includes the following APIs with relevant details: ............................................................................................................................... 4
Authorization .............................................................................................................................................................................................................. 4
E-COM API Listing ....................................................................................................................................................................................................... 5
Authentication ............................................................................................................................................................................................................ 5
Booking – Create......................................................................................................................................................................................................... 6
Booking – Create Cost Center Code .......................................................................................................................................................................... 13
Booking – Cancel....................................................................................................................................................................................................... 14
Booking – Payment Invoice ....................................................................................................................................................................................... 15
Booking – Reverse..................................................................................................................................................................................................... 17
Booking – Get CN Update ......................................................................................................................................................................................... 18
CN Print .................................................................................................................................................................................................................... 18
Inquiry – Cost Center Inquiry .................................................................................................................................................................................... 19
Payment – Status ...................................................................................................................................................................................................... 21
Payment – Detail....................................................................................................................................................................................................... 22
Setup – Area Code .................................................................................................................................................................................................... 24
Setup – Block Code ................................................................................................................................................................................................... 26
Setup – Country List .................................................................................................................................................................................................. 27
Setup – City list by Country ....................................................................................................................................................................................... 28
Setup – Route List ..................................................................................................................................................................................................... 29
Setup – Delivery Status List ....................................................................................................................................................................................... 31
Tracking .................................................................................................................................................................................................................... 32
Status Codes ............................................................................................................................................................................................................. 34
2
API User Guide
Version 1.0
Overview:
To test the complete set of product APIs & get better understanding of TCS API integration visit, please visit:
[Link]
Available APIs:
Check the list of available APIs at: [Link]
Sandbox Access:
Below is the link for UAT and production portals.
[Link]
Production Access:
If you need production access, you must proceed with the successful UAT phase. Please note that production access approval/setup will take at
least three working days.
[Link]
3
API User Guide
Version 1.0
API Listing
Our List of API includes the following APIs with relevant details:
Authorization
4
API User Guide
Version 1.0
E-COM API Listing
Authentication
5
API User Guide
Version 1.0
Booking – Create
Shipper Info
Provided by TCS
Min Length: 3
Max Length: 50
2 shippername String (50) Yes
Min Length: 3
Max Length: 6
6 Zip String (6) No
Min Length: 3
Max Length: 2
7 countrycode String (2) Yes
Min Length: 2
Max Length: 50
8 countryname String (50) Yes
Min Length: 3
6
API User Guide
Version 1.0
Min Length: 0
Max Length: 50
10 cityname String (50) Yes
Min Length: 3
Like (0300xxxxxxx)
Min Length: 11
Consignee Info
Max Length: 10
1 consigneecode String (10) No
Min Length: 2
Max Length: 50
2 firstname String (50) Yes
Min Length: 3
Max Length: 50
3 middlename String (50) Yes
Min Length: 3
Max Length: 50
4 lastname String (50) No
Min Length: 3
Max Length: 6
8 zip String (6) No
Min Length: 0
Max Length: 2
9 countrycode String (2) Yes
Min Length: 2
Max Length: 50
10 countryname String (50) Yes
Min Length: 3
Max Length: 5
11 citycode String (5) No
Min Length: 3
7
API User Guide
Version 1.0
Max Length: 50
12 cityname String (50) Yes
Min Length: 3
Max Length: 50
13 Email String (50) No
Min Length: 3
Max Length: 5
14 areacode String (5) No
Min Length: 3
Max Length: 50
15 areaname String (50) No
Min Length: 3
Max Length: 5
16 blockcode String (5) No
Min Length: 3
Max Length: 50
17 blockname String (50) No
Min Length: 3
Max Length: 50
18 lat String (50) No
Min Length: 3
Max Length: 50
19 lng String (50) No
Min Length: 3
Like (0300xxxxxxx)
Min Length: 11
Vendor Info
Max Length: 50
1 name String (50) No
Min Length: 1
8
API User Guide
Version 1.0
Min Length: 3
Max Length: 5
5 citycode String (5) No
Min Length: 3
Max Length: 50
6 cityname String (50) No
Min Length: 3
Like (0300xxxxxxx)
Min Length: 11
Shipment Info
Max Length: 20
1 costcentercode String (20) Yes
Min Length: 2
Max Length: 50
2 referenceno String (50) No
Min Length: 3
Max Length: 6
4 servicecode String (6) Yes
Min Length: 1
Max Length: 50
5 parametertype String (50) No
Min Length: 1
DD-MM-YYYY
Min Length: 1
Maximum: 10
7 shippingtype String No
Minimum: 0
Min Length: 3
maximum: 250000
9 codamount Number (int32) Yes
minimum: 0
9
API User Guide
Version 1.0
maximum: 250000
10 declaredvalue Number (int32) No
minimum: 0
maximum: 250000
11 insuredvalue Number (int32) No
minimum: 0
Maximum: 10
12 transactiontype String No
Minimum: 0
Max Length: 50
13 dsflag String (50) No
Min Length: 0
Max Length: 50
14 carrierslug String (50) No
Min Length: 0
maximum: 2147483647
16 pieces Number (int32) Yes
minimum: 1
SKU
4 uom String No
maximum: 250000
5 unitprice Number(int32) Yes
minimum: 1
maximum: 250000
6 declaredvalue Number(int32) No
minimum: 0
maximum: 250000
7 insuredvalue Number(int32) No
minimum: 0
Response Parameters
10
API User Guide
Version 1.0
S. No. Response Remarks
5 Request Time
6 Response Time
11
API User Guide
Version 1.0
"mobile": "03451234567"
},
"vendorinfo": {
"name": "Test Vendor",
"address1": "Test address 1",
"address2": "Test address 2",
"address3": "Test address 3",
"citycode": "KHI",
"cityname": "Karachi",
"mobile": "03451234567"
},
"shipmentinfo": {
"costcentercode": "Test-01",
"referenceno": "123456789",
"contentdesc": "Cost center description",
"servicecode": "O",
"parametertype": "Parameter Type",
"shipmentdate": "28/08/2023 01:04:02",
"shippingtype": "",
"currency": "PKR",
"codamount": 250,
"declaredvalue": null,
"insuredvalue": null,
"transactiontype": "",
"dsflag": "",
"carrierslug": "",
"weightinkg": 0.5,
"pieces": 1,
"fragile": false,
"remarks": "Test remarks",
"skus": [
{
"description": "SKU description",
"quantity": 1,
"weight": 0.5,
"uom": "KG",
"unitprice": 250,
"declaredvalue": null,
"insuredvalue": null
}
]
}
}
12
API User Guide
Version 1.0
"message": "success",
"requestTime": "07:27:43",
"responseTime": "07:27:44"
}
Failure Response {
"error": [
{
"errorname": "error description"
}
],
"message": "Summary of error",
"traceid": "00-b5059f8935daf8f3d75e-3d58b17af9ab812-00"
}
OR
{
"code": 401,
"message": "Invalid Bearer token. Mismatch configuration.",
"status": "UnAuthorized"
}
13
API User Guide
Version 1.0
JSON Body Request/Payload {
"costcentercityname": "KARACHI",
"costcentercode": "9211",
"costcentername": "Kathryn Poole1",
"pickupaddress": "KHI Airport",
"returnaddress": "KHI Airport",
"islabelprint": "yes",
"accountNumber": "04011K1",
"phoneNumber": "32122457457",
"email": "test@[Link]",
"accesstoken": ""
}
API Success Response {
"message": "SUCCESS",
"costcentercode": "9211",
"traceid": "49a5e1e7-2f47-430e-9443-8227acba134c"
}
Failure Response {
"message": "FAILURE: Cost Center Already Exists",
"costcentercode": null,
"traceid": "0b131f86-ee51-4a11-abdc-4266e08b65ab"
}
Booking – Cancel
14
API User Guide
Version 1.0
API Success Response {
"message": "SUCCESS",
"traceid": "294d5e4f-913c-45a4-bf90-e00993157c0b"
}
Failure Response {
"message": "Failure: No Record Founds",
"traceid": "e291bead-5a51-4669-87eb-6f65535da994"
}
15
API User Guide
Version 1.0
"codamount": 2057,
"courier_charges": 116,
"gst": 18.56,
"cus_no": "882161",
"invoiceno": "LHEGEW888257"
},
{
"cnsg_no": "779412315161",
"cust_ref": "Internet 571197",
"bkg_dat": "2024-08-07T00:00:00",
"consignee": "Khalid Bashir",
"orgn": "LHE",
"dstn": "LHE",
"wtt_bkg": 0.5,
"paymentperiod": "08_Aug_to_14_Aug_2024",
"status": "Delivered",
"codamount": 0,
"courier_charges": 83,
"gst": 13.28,
"cus_no": "882161",
"invoiceno": "LHEGEW888257"
},
{
"cnsg_no": "779412315162",
"cust_ref": "Internet 571299",
"bkg_dat": "2024-08-07T00:00:00",
"consignee": "Marism Shahid",
"orgn": "LHE",
"dstn": "LHE",
"wtt_bkg": 1,
"paymentperiod": "08_Aug_to_14_Aug_2024",
"status": "Delivered",
"codamount": 2559,
"courier_charges": 83,
"gst": 13.28,
"cus_no": "882161",
"invoiceno": "LHEGEW888257"
}
]
}
Failure Response {
"code": "UnAuthorized",
"message": "Invalid access token",
"status": 401
}
16
API User Guide
Version 1.0
Booking – Reverse
17
API User Guide
Version 1.0
Booking – Get CN Update
CN Print
18
API User Guide
Version 1.0
API Body S No. Parameter Mandatory Data Type Remarks
1 consignmentno Yes String To be provided
2 shipperdetail Yes Dropdown To be provided
Response Parameters
1 accesstoken Yes String (400)
[Link]
Failure Response {
"message": "CN not found",
"url": "",
"traceid": "6e621297-3881-40c1-b611-d03717827690"
}
19
API User Guide
Version 1.0
API Body [Link]. Parameter Data Type Mandatory Remarks
1 accesstoken String (400) Yes Generated through provided Envio credentials
Number
2 customerno Yes TCS account Number
(20)
Response Parameters
Number
1 costcentercode Yes
(20)
Number
4 phoneno No
(11)
Yes -> Y
8 printonlabel String (1) Yes
No -> N
20
API User Guide
Version 1.0
"phoneno": "03112313616",
"email": "info@[Link]",
"pickupaddress": "Lasbella Garden Karachi",
"returnaddress": "Lasbella Garden Karachi",
"printonlabel": "Y"
},
{
"costcentercode": "003 - GUJ",
"costcentercity": "LAHORE",
"costcentername": "Sharif Fabrics Gujranwala",
"phoneno": "03237466222",
"email": "info@[Link]",
"pickupaddress": "M sharif 276 A model town back side of
Jinnah hospital band Gali Gujranwala",
"returnaddress": "M sharif 276 A model town back side of
Jinnah hospital band Gali Gujranwala",
"printonlabel": "Y"
}
],
"message": "success",
"traceid": "15f62e2d-bccf-44ae-9928-63996b4bcc22"
}
Failure Response {
"code": "UnAuthorized",
"message": "Invalid access token",
"status": 401
}
Payment – Status
21
API User Guide
Version 1.0
API Success Response {
"detail": [
{
"booking date": "09/09/2024",
"cn by courier": "779412323079",
"cn status": "RO",
"order no": "Internet 591139",
"payment status": "N",
"amount paid": 0,
"parcel weight": 0.5,
"city": "TMK",
"delivery charges": 116,
"delivery date": "16/09/2024",
"payment date": null
}
],
"message": "SUCCESS",
"status": "true",
"traceid": "7cc65dfc-8b8b-4186-9259-aae6ba9f7d66"
}
Failure Response {
"detail": null,
"message": "Invalid CN",
"status": "true",
"traceid": "3a52a19c-84cc-4416-b7f9-b05d38051eb4"
}
Payment – Detail
22
API User Guide
Version 1.0
JSON Body Request/Payload {
"accesstoken": ""
"customerno": "123456"
"fromdate": "2024-09-08"
"todate": "2024-09-14"
}
API Success Response {
"detail": [
{
"booking date": "09/09/2024",
"cn by courier": "779412322995",
"cn status": "OK",
"order no": "Internet 591128",
"payment status": "N",
"amount paid": 0,
"parcel weight": 1,
"city": "KHI",
"delivery charges": 118,
"delivery date": "10/09/2024",
"payment date": null
},
{
"booking date": "09/09/2024",
"cn by courier": "779412323054",
"cn status": "OK",
"order no": "Internet 590823",
"payment status": "N",
"amount paid": 0,
"parcel weight": 2,
"city": "SLT",
"delivery charges": 174,
"delivery date": "13/09/2024",
"payment date": null
},
{
"booking date": "09/09/2024",
"cn by courier": "779412323079",
"cn status": "RO",
"order no": "Internet 591139",
"payment status": "N",
"amount paid": 0,
"parcel weight": 0.5,
"city": "TMK",
"delivery charges": 116,
"delivery date": "16/09/2024",
"payment date": null
23
API User Guide
Version 1.0
}
],
"message": "SUCCESS",
"status": "true",
"traceid": "7cc65dfc-8b8b-4186-9259-aae6ba9f7d66"
}
Failure Response {
"code": 401,
"message": "Invalid Bearer token. Mismatch configuration.",
"status": "UnAuthorized"
}
24
API User Guide
Version 1.0
"areaid": 164,
"citycode": "JMP",
"areacode": "R80302762",
"areaname": "Jampur"
},
{
"srl": 3,
"areaid": 165,
"citycode": "PEW",
"areacode": "RPK5773",
"areaname": "Jamrud - Khyber Agency"
},
{
"srl": 4,
"areaid": 166,
"citycode": "JND",
"areacode": "R80302688",
"areaname": "Jand"
},
{
"srl": 5,
"areaid": 167,
"citycode": "QML",
"areacode": "R80302947",
"areaname": "Jandala"
},
{
"srl": 6,
"areaid": 168,
"citycode": "NRL",
"areacode": "R80302434",
"areaname": "Jassar"
},
{
"srl": 7,
"areaid": 169,
"citycode": "NOW",
"areacode": "R80302362",
"areaname": "Jehangira"
},
{
"srl": 8,
"areaid": 170,
"citycode": "HZD",
"areacode": "R80302556",
"areaname": "Jhairanwala"
},
25
API User Guide
Version 1.0
{
"srl": 9,
"areaid": 171,
"citycode": "SGD",
"areacode": "R80306616",
"areaname": "Jhal Chakian"
}
],
"traceid": "83351973-9924-4133-ab3-007ead38e62f"
}
Failure Response {
"code": 401,
"message": "Invalid Bearer token. Mismatch configuration.",
"status": "UnAuthorized"
}
26
API User Guide
Version 1.0
"areacode": "R80306631",
"blockcode": "R80306632",
"blockname": "Abdul Karim Road"
},
{
"srl": 2,
"blockid": 19397,
"citycode": "LHE",
"areaid": 593,
"areacode": "R80306631",
"blockcode": "R80306633",
"blockname": "Shaheen Complex"
}
],
"traceid": "ef12bf80-9cd9-46f1-a060-c3b73c4f011e"
}
Failure Response {
"code": 401,
"message": "Invalid Bearer token. Mismatch configuration.",
"status": "UnAuthorized"
}
27
API User Guide
Version 1.0
},
{
"countrycode": "DXB",
"countryname": "UAE"
}
],
"traceid": "20aeb-72fc-4b21-92c8-8abc5eb163b9"
}
Failure Response {
"result": null,
"status": false,
"code": "401"
}
"countrycode": ["PK"]
}
API Success Response {
"message": "SUCCESS",
"data": [
{
"citycode": "TAL",
"cityname": "TALL"
},
{
"citycode": "TDJ",
"cityname": "TANDO JAM"
},
{
28
API User Guide
Version 1.0
"citycode": "TOP",
"cityname": "TOPI"
}
],
"traceid": "e52914aa-1f71-4a0a-b899-b4edd7361b72"
}
Failure Response
{
"result": null,
"status": false,
"code": "401"
}
29
API User Guide
Version 1.0
"latitude": "31.496388",
"longitude": "73.269244",
"flaG_HAZIR": "N",
"flaG_EC": "Y"
},
{
"stA_NO": "SKT",
"routE_CODE": "X24203",
"routE_TYPE": "Franchise",
"exP_NAME": "Shahkot Express Center",
"address": "TCS Express Center Opposite Govt. Elementary
School No. 3 Nankana Road Shahkot ",
"contacT_NUMBER": "3169992870",
"areA_NO": "FSD",
"latitude": "31.575158",
"longitude": "73.483265",
"flaG_HAZIR": "N",
"flaG_EC": "Y"
},
{
"stA_NO": "SKT",
"routE_CODE": "X24404",
"routE_TYPE": "Shop in Shop",
"exP_NAME": "Adda Jhol ",
"address": "TCS Express Center Bismillah Market Sheikhupura
Faisalabad ",
"contacT_NUMBER": "3169992870",
"areA_NO": "FSD",
"latitude": "31.522127",
"longitude": "73.371926",
"flaG_HAZIR": "N",
"flaG_EC": "Y"
}
],
"status": "true",
"traceid": "21291a14-8232-4e5b-a24b-de90a0b13d0f"
}
Failure Response {
"code": 401,
"Message": "Invalid.",
"status": "UnAuthorized"
}
30
API User Guide
Version 1.0
Setup – Delivery Status List
31
API User Guide
Version 1.0
Tracking
32
API User Guide
Version 1.0
"code": "SC",
"allowshow": "Y"
}
],
"checkpoints": [
{
"consignmentno": "779412326902",
"datetime": "Thursday Oct 17, 2024 12:58",
"recievedby": "IMROOZ",
"status": "Shipment Delivered"
},
{
"consignmentno": "779412326902",
"datetime": "Thursday Oct 17, 2024 09:35",
"recievedby": null,
"status": "Out For Delivery"
},
{
"consignmentno": "779412326902",
"datetime": "Wednesday Oct 16, 2024 10:52",
"recievedby": "BAGH",
"status": "Arrived at TCS Facility"
},
{
"consignmentno": "779412326902",
"datetime": "Monday Oct 14, 2024 23:19",
"recievedby": "LAHORE",
"status": "Arrived at TCS Facility"
}
],
"shipmentsummary": "Current Status: DELIVERED\nDelivered On:
Thursday Oct 17, 2024 12:58\nSigned By: Imrooz",
"message": "SUCCESS",
"traceid": "111c95db-9d3b-4b6d-8509-6b116fd372a5"
}
Failure Response {
"shipmentinfo": null,
"deliveryinfo": null,
"checkpoints": null,
"shipmentsummary": "No Data Found/Invalid CN",
"message": "FAIL",
"traceid": "8aded596-4811-408d-b4f7-7481d0602a75"
}
33
API User Guide
Version 1.0
Status Codes
200 OK
201 Created
403 Forbidden
34