2.1 Create / Modify Shipment

This section will show the data structure for create and modify the shipments, and the example of how you can create and modify shipments.

Parameters

Shipper Info

No. Parameter Data Type Length Mandatory Description
1 ShipperName String 80 No Company Name
2 ContactPerson String 80 Yes Contact Person
3 Address1 String 80 Yes Address 1
4 Address2 String 80 Yes Address 2
5 Address3 String 80 No Address 3
6 PostCode String 20 Yes Post Code / Zip Code
7 City String 100 Yes City
8 State String 100 Yes State
9 CountryCode String 3 Yes Country Code.

Example:
- AU
10 StationCode String 10 No Station Code. Default value is empty string.
11 Phone1 String 30 Yes Phone 1
12 Phone2 String 30 No Phone 2
13 MobilePhone String 30 No Mobile Phone
14 Fax String 30 No Fax No.
15 Email String 150 No Email
16 URL String 256 No URL

Example:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
ShipperInfo _shipper = new ShipperInfo();
_shipper.ShipperName = "Unixus Solutions Sdn. Bhd.";
_shipper.ContactPerson = "IT Department";
_shipper.Address1 = "46-02 JALAN TUN ABDUL RAZAK";
_shipper.Address2 = "SUSUR 1";
_shipper.Address3 = "";
_shipper.PostCode = "80000";
_shipper.City = "JOHOR BHARU";
_shipper.State = "JOHOR";
_shipper.CountryCode = "MY";
_shipper.StationCode = "";
_shipper.Phone1 = "+60-7-2222668";
_shipper.Phone2 = "";
_shipper.MobilePhone = "";
_shipper.Fax = "";
_shipper.Email = "[email protected]";
_shipper.Url = "ezlabel.unixus.com.my";

Consignee Info

User needs to fill in the consignee info. Please provide the correct consignee info in order for the destination agent to deliver the shipment.

No. Parameter Data Type Length Mandatory Description
1 ConsigneeName String 80 No Company Name
2 ContactPerson String 80 Yes Contact Person
3 IdentityNo String 30 No Consignee Identity No.
4 Address1 String 80 Yes Address 1
5 Address2 String 80 Yes Address 2
6 Address3 String 80 No Address 3
7 PostCode String 20 Yes Post Code / Zip Code
8 City String 100 Yes City
9 State String 100 Yes State
10 CountryCode String 3 Yes Country Code.

Example:
- AU
11 StationCode String 10 No Station Code. Default value are empty string.
12 Phone1 String 30 Yes Phone 1
13 Phone2 String 30 No Phone 2
14 MobilePhone String 30 No Mobile Phone
15 Fax String 30 No Fax No.
16 Email String 150 No Email
17 URL String 256 No URL

Example:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
ConsigneeInfo _consignee = new ConsigneeInfo ();
_consignee.ConsigneeName = "LWE (AU) Ltd.";
_consignee.ContactPerson = "Mr. Ng";
_consignee.IdentityNo = "A123456789"
_consignee.Address1 = "Test Address 1";
_consignee.Address2 = "Test Address 2";
_consignee.Address3 = "";
_consignee.PostCode = "0845";
_consignee.City = "BATCHELOR";
_consignee.State = "NT";
_consignee.CountryCode = "AU";
_consignee.StationCode = "";
_consignee.Phone1 = "1234567890";
_consignee.Phone2 = "";
_consignee.MobilePhone = "";
_consignee.Fax = "";
_consignee.Email = "[email protected]";
_consignee.Url = "http://www.lwe.com.hk";

Item Info

User needs to at least fill in one Item Info.

No. Parameter Data Type Length Mandatory Description
1 ItemReference String 255 Yes Item name
2 NoOfUnit Integer Yes Numbers of item in one shipment
3 ItemValue Numeric 10,2 Yes Subtotal of the items. Eg: 1 item $5, 3 items $15. ItemValue = 15.
4 ItemHSCode String 100 No Item HS Code
5 ItemSKU String 64 No Item SKU
6 ItemUrl String 1024 No Item URL

Example:

1 2 3 4 5 6 7 8
shipments.ItemInfo = new ItemInfo[1];
shipments.ItemInfo[0] = new ItemInfo();
shipments.ItemInfo[0].ItemReference = "Ladies Shoes";
shipments.ItemInfo[0].NoOfUnit = 3;
shipments.ItemInfo[0].ItemValue = 15; // 1 item $5, 3 items $15. ItemValue = 15
shipments.ItemInfo[0].ItemHSCode = "15"; 
shipments.ItemInfo[0].ItemSKU = "15"; 
shipments.ItemInfo[0].ItemUrl = "http://www.abc.com";

Weight Info

User needs to at least fill in one weight info.

NB: Some TOS mode, however, for example registered post and normal mail service, only allow 1 piece of shipment per 1 HAWB NO, other TOS will allow more than 1 shipments per 1 HAWB NO.

No. Parameter Data Type Length Mandatory Description
1 PackageReference String 255 Yes Package reference name
2 PackageHeight Numeric 7,2 Yes Package Height in 2 decimal point
3 PackageWidth Numeric 7,2 Yes Package Width in 2 decimal point
4 PackageLength Numeric 7,2 Yes Package Length in 2 decimal point
5 ActualWeight Numeric 7,2 Yes Actual Weight in 2 decimal point

Example:

1 2 3 4 5 6 7
shipments.WeightInfo = new WeightInfo[shipments.NoOfPieces];
shipments.WeightInfo[0] = new WeightInfo();
shipments.WeightInfo[0].PackageReference = "PKG01";
shipments.WeightInfo[0].PackageHeight = 1.00;
shipments.WeightInfo[0].PackageWidth = 1.00;
shipments.WeightInfo[0].PackageLength = 1.00;
shipments.WeightInfo[0].ActualWeight = 5.00;

Tags Info

Tags Info are used for storing any other extra information. This field is not mandatory. User can choose not to fill in this tag info by settings the new TagsInfo array to 0.

No. Parameter Data Type Length Mandatory Description
1 TagCode String 50 Yes Tag Code

Value:
"TAG1"
"TAG2"
"TAG3"
2 TagValue String 255 Yes Tag Value

Example:

1 2 3 4
shipments.TagsInfo = new TagsInfo[1];
shipments.TagsInfo[0] = new TagsInfo();
shipments.TagsInfo[0].TagCode = "TAG1";
shipments.TagsInfo[0].TagValue = "Any extra information";

TOS Mode

TOS stand for Type of Service. The value of TOS Mode in Shipment Info is based on the consignee country code. The following code is the example of how you assign the TOSMode value. If you facing the error of invalid TOS, please contact our customer support.

Example:

if (consignee.CountryCode.Equals("MY")) {
  s.TOSMode = "MY-E-EXPRESS";
}
else if (consignee.CountryCode.Equals("TH")) {
  s.TOSMode = "TH-E-EXPRESS";
}
else if (consignee.CountryCode.Equals("HK")) {
  s.TOSMode = "HK-E-EXPRESS";
}
else if (consignee.CountryCode.Equals("SG")) {
  s.TOSMode = "SG-E-EXPRESS";
}
else if (consignee.CountryCode.Equals("ID")) {
  s.TOSMode = "ID-E-EXPRESS";
}
else if (consignee.CountryCode.Equals("CN")) {
  s.TOSMode = "CN-E-EXPRESS";
}
else {
  // Error
}

Shipment Info

No. Parameter Data Type Length Mandatory Description
1 ShipmentsCredentials ShipmentsCredentials Yes Refer to section 1.2
2 ActionType Enum Yes Refer to section 1.3
3 CustomerCode String 20 Yes Refer to section 1.4
4 ProfitCentreCode String 20 No Refer to section 1.4
5 ShipperInfo ShipperInfo Yes Refer to ShipperInfo
6 ConsigneeInfo ConsigneeInfo Yes Refer to ConsigneeInfo
7 ItemInfo ItemInfo[] Yes Refer to ItemInfo
8 WeightInfo WeightInfo[] Yes Refer to WeightInfo
9 TagsInfo TagsInfo[] No Refer to TagsInfo
10 ShipmentDate DateTime Yes Unix Timestamp in 13 digits. Example: /Date(1506330946000+0800)/
11 Submitted_Date DateTime Yes Unix Timestamp in 13 digits. Example: /Date(1506330946000+0800)/
12 HawbNo String 50 No Leave this if create a new shipment
13 ReferenceNo String 50 No User own reference No.
14 ReferenceAgent String 36 No Can left this field as blank.
15 TOSMode String 20 Yes Refer to TOSMode
16 PackageType Enum Yes Each TOS Mode is assign to specific package type, please refer to enum below.
17 NoOfPieces Integer Yes The size of WeightInfo[]
18 WeightType Enum No An indicator to notify the API the weight pass to this API is calculate in what weight type.
19 CurrencyCode String 3 Yes Currency Code
20 NatureOfGoods String 255 Yes Description of the shipment
21 Remarks String 8000 No Remarks
22 CODCurrency String 3 No/Yes COD Value currency.Mandatory if CODValue is specified
23 CODValue Double No/Yes Mandatory if CODCurrency is specified
24 InsuranceCurrency String 3 No Insurance Value currency
25 InsuranceValue Double No Insurance Value
// Values of PackageType
// If you are using SOAP, use enumeration as value. 
// If you are using JSON, use numeric number as value.
// If in doubt, select SPX
public enum PackageType {
  DOX = 0, // Document
  SPX = 1, // Parcel
  SPX_L = 2, // Mail-Large
  SPX_P = 3, // Mail-Package
  SPX_S = 4 // Mail-Small 
}

// Values of WeightType
// If you are using SOAP, use enumeration as value. 
// If you are using JSON, use numeric number as value.
public enum WeightType {
  Kilogram = 0,
  Pounds = 1
}

Example:

1 2 3 4 5 6 7 8 9 10 11
shipments.ShipmentDate = DateTime.Now;
shipments.HawbNo = string.Empty;
shipments.ReferenceNo = "123456";
shipments.ReferenceAgent = "";
shipments.TOSMode = "UBX-E-AU";
shipments.PackageType = PackageType.SPX;
shipments.NoOfPieces = 1;
shipments.WeightType = WeightType.Kilogram;
shipments.CurrencyCode = "AUD";
shipments.NatureOfGoods = "Shoes";
shipments.Remarks = "Fragile, please be careful.";
Copyright © 2018 Unixus Solutions Sdn. Bhd. All rights reserved.