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

Freight Mark Web API Technical Documentation v2.51 18dec18

This document provides technical documentation for Freight Mark's web API customer interface. It describes the file format, transfer method, and platform used. It also provides details on the staging and production API endpoints, authentication process requiring a security token, and summaries of two API endpoints - one for track and trace status/milestones, and another for consignment note generation and order creation.

Uploaded by

Amirul Amin IV
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
171 views

Freight Mark Web API Technical Documentation v2.51 18dec18

This document provides technical documentation for Freight Mark's web API customer interface. It describes the file format, transfer method, and platform used. It also provides details on the staging and production API endpoints, authentication process requiring a security token, and summaries of two API endpoints - one for track and trace status/milestones, and another for consignment note generation and order creation.

Uploaded by

Amirul Amin IV
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Web API document V.2.

51
Freight Mark Web API Technical documentation
(Customer Interface)

FileFormat = JSON (Java Script Object Notations)  


Transfer Method = REST (Representational State Transfer)
Platform = Microsoft Web service (ASP.net)  

API Endpoint

Staging: http://27.131.53.78:8899

Production: https://api.freightmark.asia:4445

Authentication

This API is to allow customer obtain security token to be used for all other data posting for the API below. Each time
when a session / connection terminated, a new security token has to be retrieve again in order to connect
successfully. The Security token has to be included in the “Header” in each API call.

URL: /token

Content-Type: application/x-www-form-urlencoded

Token Type: Bearer

Field
Parameter Data Type Mandatory Description

username varchar(20) Yes User Name provided by FM

password varchar(20) Yes Password provided by FM

grant_type varchar(20) Yes password (fixed value)

Result from API


Success Result:

System will generate a security token to be used in the next API call

"access_token": "9aih23pw2poPxI_j4ZDbZ3-
hfODYp_NNIfCiqDB2CmhvD8ZYtMnfqxgUWetUGKAydFw7iZAJpxr4IMWsz8Yi5h72_xXx-
lfO8Ooqqr7vLjNLAg93GZUsWX7M4IBHqw5f1Pr44o3neVtAi7kfWviXVnCTy9hLAxefpq3ysVVZqD8pCraenqM48w_8o8f
Uhrs4UvZ17aqNP6j0bSO9FWGuJ9Tsw38ReDOB_IV1RWbsaaIti9n2R9v_CwNAfWnZc-bSQGrS9Jsg-
oloaeDwsdXTe9s2Ft92EAOt9gUlbcwoeOCIFHvXrVMzHv_9uQvORea8NBwtKq9knWnCVoxPSAJrD1kgBeA2JTrcs4z1xqu
YgrhRKdHJnjON98CmSWeNK83Wv-
MK5Xgqb7ruVLkOxeLUHyi3Vbco7lxHH_rrRm0yhPywWiEhsCSD55_64IFDPnyp3oiKDTwIQtqmU-
H9tHoatiUimm_XYGiVaE4Lkpj_kbjfpOMiwRtWIhyF6JYH8tZg",
Prepare by: Freight Mark IT Department
Web API document V.2.51
"token_type": "bearer",

"expires_in": 1209599,

"userName": "testmk ",

".issued": "Sun, 23 Aug 2015 14:19:00 GMT",

".expires": "Sun, 06 Sep 2015 14:19:00 GMT"

Fail Result:

"error": "invalid_grant",

"error_description": "The user name or password is incorrect."

1. Get Track and Trace Status / Milestone


This API is to allow customer to get track and trace status via API call
URL: /api/order/trackandtrace

Content-Type: application/json

Field Parameter Data Type Mandatory Description

AccountKey varchar(20) Yes Account Key Provided by FM

CompanyCode varchar(10) Yes FXFX (fixed value)

ConsignmentN varchar(20) Yes Consignment or Ref number which want to trace


o
GetOptions int Yes Option 1 = Get latest milestone, Option 2 = Get all milestone

IsConType Int Yes 1 = Search Consignment No, 2 = Search customer Ref No

Result from API


Success Result:

System will generate result as below if is posted successfully.

{
[0] => Array
{
[APIStatus] => Sucess
[PODStatus] => 10
[PODDesc] => Shipment Received in Depot
[PODDate] => 2015-05-18 17:41:24
[PODBranch] => Petaling Jaya
Prepare by: Freight Mark IT Department
Web API document V.2.51
}
}

Error Result:

System will return error when mandatory fields are not provided, wrong account or other information as example
below:

{
[0] => Array
{
[APIStatus] => Fail
[Reason] => Invalid ConNo
}
}

{
[0] => Array
{
[APIStatus] => Fail
[Reason] => Invalid Account
}
}

2. Consignment Note Generation (Order creation)


This API is to allow customer to place booking and get consignment number via API call.
URL: /api/order/congen

Content-Type: application/json

Field Parameter Data Type Mandatory Description

CompanyCode varchar(10) Yes FXFX (fix value)

ProgramId varchar(1) Yes 1

OrderDate varchar(20) Yes Order date ( yyyy-mm-dd )

DeliveryDate varchar(20)   Delivery Date ( yyyy-mm-dd )

CustomerReference1 nvarchar(50) Yes Customer Order / DO / Invoice No

CustomerReference2 nvarchar(50)   Customer Order / DO / Invoice No

Remark nvarchar(200)   Order Remark

AccountKey varchar(20) Yes Customer Account Key provided by FM

AccountName nvarchar(50) Yes Customer Account Name provided by FM


ServiceCode varchar(10) Yes Type of services:
Product Code Description

Prepare by: Freight Mark IT Department


Web API document V.2.51
ECO Economy Express
EXP Express
LTL Transport (Ctn Rate)
AFT Airfreight
SFW Seafreight / Seaforwarding
TPT Transport
WHS Warehouse

Commodity nvarchar(50) Yes Goods description

Currency varchar(10) Yes Currency of goods value , e.g. MYR, SGD, USD

Value varchar(20) Yes Goods value

Weight varchar(5) Yes Weight of the shipment in kg

Volume varchar(5) Yes Volume of the shipment in cm3

Quantity varchar(5) Yes Total quantity / pieces

Uom nvarchar(50)  Yes UOM of the shipment, e.g. PAR, DOC

Width varchar(5)   Width of the shipment in cm

Length varchar(5)   Length of the shipment in cm

Height varchar(5)   Height of the shipment in cm

ShipperName nvarchar(50) Yes Name of the shipper (Company Name)

ShipperAddress1 nvarchar(150) Yes Address of the shipper

ShipperAddress2 nvarchar(150)   Address of the shipper

ShipperPostcode nvarchar(7) Yes Postcode of the shipper

ShipperCity nvarchar(50) Yes City of the shipper

ShipperState nvarchar(50)   State of the shipper

ShipperRegion nvarchar(50)   Region of the shipper

ShipperCountry nvarchar(2) Yes Country of the shipper. E.g MY /SG/TH

ShipperContactName nvarchar(50) Yes Name of shipper contact

ShipperContactTel varchar(20)  Yes Telephone number of shipper

ShipperMobileNo varchar(20) Mobile number of shipper

ShipperEmail varchar(50)   Email of shipper

ReceiverName nvarchar(50) Yes Name of receiver

ReceiverAddress1 nvarchar(200) Yes Address of the Receiver

Prepare by: Freight Mark IT Department


Web API document V.2.51

ReceiverAddress2 nvarchar(200)   Address of the Receiver

ReceiverPostcode nvarchar(7) Yes Postcode of the Receiver

ReceiverCity nvarchar(50) Yes City of the Receiver

ReceiverState nvarchar(50)   State of the Receiver

ReceiverRegion nvarchar(50)   Region of the Receiver

ReceiverCountry nvarchar(2) Yes Country of the Receiver E.g MY /SG/TH


ReceiverContactNam
e nvarchar(50) Yes Contact name of the Receiver

ReceiverContactTel varchar(20) Yes Telephone number of the Receiver

ReceiverMobileNo varchar(20) Mobile number of the Receiver

ReceiverEmail varchar(50)   Email of the Receiver

PickupDate Varchar(20) Pickup date ( yyyy-mm-dd )

isCOD bit To define is COD

COD varchar(20) COD value


Near U pick up point taken from NUPEE plugin.
Note: In addition, replace ReceiverAddress1, ReceiverAddress2,
ReceiverPostcode, ReceiverCity, ReceiverState, ReceiverRegion
and ReceiverCountry with the given pick up point address.
NUPCPoint varchar(5) (ignore for non-NearU service)
Near U on demand time slot e.g. 0900-1100 (ignore for non-
NUODSlot varchar(20) NearU service)
1 or 0, to define if label image required. Default 0 (ignore for
LabelImg bit non-NearU service)

Result from API


Success Result:

System will generate result as below if is posted successfully.

{
[APIStatus] => Success

[CnoteNo] => FX7987987

[RouteID] => KLV-001

[NearUID] => D1 S123

Error Result:

Prepare by: Freight Mark IT Department


Web API document V.2.51
System will return error when mandatory fields are not provided, wrong account or other information as example
below:

{
[APIStatus] => Fail

[Reason] => Invalid Customer

Array
{
[APIStatus] => Fail

[Reason] => Duplicate Order ID Found

3. Get Shipping Label (pdf file in byte array)


This API is to allow customer to get order shipping label for printing via API call
URL: /api/order/label/[consignmentno]

Content-Type: application/json

Field
Parameter Data Type Mandatory Description

consignmentno varchar(20) Yes Consignment no. received from congen API (eg. FX1234567)

Result from API


Success Result:

System will generate result as below on success.

{
[pdf] => JVBERi0xLjQKMSAwIG9iago8PAovVGl0bGUgKP7…
}

4. Manifest Generation (Order creation)


Prepare by: Freight Mark IT Department
Web API document V.2.51
This API is to allow customer to push consignment detail via API call.
URL: /api/order/pushmanifest

Content-Type: application/json

Field Parameter Data Type Mandatory Description

ConId Varchar(10) Yes FMX Consignment Number

CompanyCode varchar(10) Yes FXFX (fix value)

ProgramId varchar(1) Yes 1

OrderDate varchar(20) Yes Order date ( yyyy-mm-dd )

DeliveryDate varchar(20)   Delivery Date ( yyyy-mm-dd )

CustomerReference1 nvarchar(50) Yes Customer Order / DO / Invoice No

CustomerReference2 nvarchar(50)   Customer Order / DO / Invoice No

Remark nvarchar(200)   Order Remark

AccountKey varchar(20) Yes Customer Account Key provided by FM

AccountName nvarchar(50) Yes Customer Account Name provided by FM


Type of services:
Product Code Description
ECO Economy Express
EXP Express
LTL Transport (Ctn Rate)
AFT Airfreight
SFW Seafreight / Seaforwarding
TPT Transport
ServiceCode varchar(10) Yes WHS Warehouse

Commodity nvarchar(50) Yes Goods description

Currency varchar(10) Yes Currency of goods value , e.g. MYR, SGD, USD

Quantity varchar(5) Yes Total quantity / pieces

Uom nvarchar(50)  Yes UOM of the shipment, e.g. PAR, DOC,PLT

ShipperName nvarchar(50) Yes Name of the shipper (Company Name)

ShipperAddress1 nvarchar(150) Yes Address of the shipper

ShipperAddress2 nvarchar(150)   Address of the shipper

ShipperPostcode nvarchar(7) Yes Postcode of the shipper

ShipperCity nvarchar(50) Yes City of the shipper

Prepare by: Freight Mark IT Department


Web API document V.2.51

ShipperState nvarchar(50)   State of the shipper

ShipperRegion nvarchar(50)   Region of the shipper

ShipperCountry nvarchar(2) Yes Country of the shipper. E.g MY /SG/TH

ShipperContactName nvarchar(50) Yes Name of shipper contact

ShipperContactTel varchar(20) Telephone number of shipper

ShipperMobileNo varchar(20)  Yes Mobile number of shipper

ShipperEmail varchar(50)   Email of shipper

ReceiverName nvarchar(50) Yes Name of receiver

ReceiverAddress1 nvarchar(200) Yes Address of the Receiver

ReceiverAddress2 nvarchar(200)   Address of the Receiver

ReceiverPostcode nvarchar(7) Yes Postcode of the Receiver

ReceiverCity nvarchar(50) Yes City of the Receiver

ReceiverState nvarchar(50)   State of the Receiver

ReceiverRegion nvarchar(50)   Region of the Receiver

ReceiverCountry nvarchar(2) Yes Country of the Receiver E.g MY /SG/TH


ReceiverContactNam
e nvarchar(50) Yes Contact name of the Receiver

ReceiverContactTel varchar(20) Telephone number of the Receiver

ReceiverMobileNo varchar(20)  Yes Mobile number of the Receiver

ReceiverEmail varchar(50)   Email of the Receiver

PickupDate Varchar(20) Pickup date ( yyyy-mm-dd )

isCOD bit To define is COD

COD varchar(20) COD value


Fields:
Field Data Type Example
Commodity nvarchar(50) Sweet
Value varchar(20) 6.00
Weight varchar(5) 7.00
Volume varchar(5) 8.00
Width varchar(5) 10.00
Length varchar(5) 12.00
CargoDetails Table Yes Height varchar(5) 12.00

Example of API Body


Prepare by: Freight Mark IT Department
Web API document V.2.51
[

"ConId" : "MYX1001300058",

"CompanyCode": "FXFX",

"ProgramId": "1",

"OrderDate": "2018-12-13",

"DeliveryDate": "2018-12-13",

"CustomerReference1": "SI-11063",

"CustomerReference2": "",

"Remark": "This is anoter expensive thing",

"AccountKey": "P000145",

"AccountName": "1 UTAMA SHOPPING MALL",

"ServiceCode": "ECO",

"Commodity": "This is another expensive thing pls take care",

"Currency": "USD",

"Quantity": "2",

"Uom": "PAR",

"ShipperName": "LF",

"ShipperAddress1": "26 JLN PANDAN PRIMA 5 DATARAN PANDAN PRIMA",

"ShipperAddress2": "",

"ShipperPostcode": "41500",

"ShipperCity": "Bangsar",

"ShipperState": "Selangor",

"ShipperRegion": "",

"ShipperCountry": "MY",

"ShipperContactName": "Chan Ai Ai",

"ShipperContactTel": "037789017",

"ShipperMobileNo": "0167708911",

"ShipperEmail": "[email protected]",

"ReceiverName": "Chan Mei Mei",

"ReceiverAddress1": "LOT 11, JALAN 225, SEC 51A,",

"ReceiverAddress2": "",

"ReceiverPostcode": "31650",

Prepare by: Freight Mark IT Department


Web API document V.2.51
"ReceiverCity": "Ipoh",

"ReceiverState": "Perak",

"ReceiverRegion": "",

"ReceiverCountry": "MY",

"ReceiverContactName": "Chan Mei Mei",

"ReceiverContactTel": "056678901",

"ReceiverMobileNo": "0155879015",

"ReceiverEmail": "[email protected]",

"PickupDate": "2019-1-1",

"isCOD": "1",

"COD": "7.00",

"CargoDetails":

"Commodity": "Heat",

"value": "57",

"Weight": "19",

"Volume": "20",

"Width": "54",

"Length": "10",

"Height": "26"

},

"Commodity": "Cold",

"value": "20",

"Weight": "18",

"Volume": "20",

"Width": "30",

"Length": "20",

"Height": "15"

Prepare by: Freight Mark IT Department


Web API document V.2.51
]

Result from API


Success Result:

System will generate result as below if is posted successfully.

"APIStatus": "Success",

"Reasons": []

Error Result:

System will return error when mandatory fields are not provided, wrong account or other information as example
below:

{
"APIStatus": Fail

"Reasons": ["E00003 - Consignment No MYX1001300058 is Invalid"]

Error Code for PushManifest Api:

E00001 - Consignment No More Than 100

E00002 – Consignment No MYX1001300058 Have Different Cargo Details Line Number With Quantity

E00003 – Consignment No MYX1001300058 is Invalid

E00004 – Consignment No MYX1001300058 Update Failed

E00005 – Consignment No MYX1001300058 Uom is Invalid

Prepare by: Freight Mark IT Department

You might also like