3.1 创建货件

描述

本节将向您展示如何使用此API创建货件。

开发/测试环境   : https://sandbox-apiv2.unixus.com.my/shipment/v2/Create
生产/正式环境   : https://apiv2.unixus.com.my/shipment/v2/Create
Method         : POST
Content-Type   : application/json
Accept-Language: en
Authorization  : Bearer {access_token}

请求

数据结构

CreateShipments
字段 类型 必填 备注
Shipments CreateShipmentDetails[] 参考 CreateShipmentDetails
CreateShipmentDetails
字段 类型 必填 备注
Shipper PersonInfo 参考 PersonInfo
Consignee PersonInfo 参考 PersonInfo
Items ItemInfo[] 参考 ItemInfo
Packages PackageInfo[] 参考 Packages
ShipmentDate DateTime Example: 2018-07-01T00:00:00+08:00
TOSMode String 参考 TOS Mode
ProfitCentreCode String
ReferenceNo String
ReferenceSource String
PackageType Enum 参考 PackageType
WeightType Enum 参考 WeightType
CurrencyCode String
Remarks String
PersonInfo
字段 类型 必填 备注
Name String
ContactPerson String
IdentityNo String
Address1 String
Address2 String
Address3 String
Postcode String
City String
State String
CountryCode String
StationCode String
Phone1 String
Phone2 String
MobilePhone String
Fax String
Email String
Url String
ItemInfo
字段 类型 必填 备注
Description String
Quantity Integer
UnitValue Numeric
HSCode String
SKU String
Url String
PackageInfo
字段 类型 必填 备注
PackageReference String
Length Numeric CM的长度
Width Numeric CM的宽度
Height Numeric CM的高度
ActualWeight Numeric 实际重量以KG计
TOS Mode

TOSMode代表服务类型。装运信息中TOSMode的值基于收货人国家/地区代码。以下代码是您如何分配TOSMode值的示例。如果您遇到无效TOS错误,请联系我们的客户支援.

public string GetTOSMode(string consigneeCountry) { switch (consigneeCountry) { case "MY": return "MY-E-EXPRESS"; case "TH": return "TH-E-EXPRESS"; case "HK": return "HK-E-EXPRESS"; case "SG": return "SG-E-EXPRESS"; case "ID": return "ID-E-EXPRESS"; case "CN": return "CN-E-EXPRESS"; default: // error } }
PackageType and WeightType
// If in doubt, choose SPX public enum PackageType { DOX, SPX, SPX_L, SPX_P, SPX_S } public enum WeightType { KG, LBS }

Sample:

{ "Shipments": [ { "Shipper": { "Name": " DEMO ACCOUNT", "ContactPerson": "DEMO ACCOUNT", "Address1": "Block C, 3A01 & 3A02,", "Address2": "Level 3A, Kelana Square,", "Address3": "No.17, Jalan SS7/26", "Postcode": "47301", "City": "Petaling Jaya", "State": "Selangor", "CountryCode": "MY", "Phone1": "+60378038830" }, "Consignee": { "ContactPerson": "LWE (AU) Ltd.", "Address1": "Test Address 1", "Address2": "Test Address 2", "Postcode": "70000", "City": "JOHOR BHARU", "State": "SELANGOR", "CountryCode": "MY", "Phone1": "03-8888888" }, "Items": [ { "Description": "item1", "Quantity": 10, "UnitValue": 20.0, "HSCode": "30", "SKU": "40", "Url": "50" } ], "Packages": [ { "PackageReference": "pkg1", "Length": 10.0, "Width": 20.0, "Height": 30.0, "ActualWeight": 40.0 } ], "PackageType": "SPX", "WeightType": "KG", "ShipmentDate": "2018-07-01T00:00:00+08:00", "TOSMode": "MY-E-EXPRESS", "CurrencyCode": "MYR" } ] }

响应

样品

{ "Summary": { "Total": 1, "Success": 1, "Failed": 0 }, "ShipmentsResponse": [ { "IsSuccess": true, "ShipmentDetails": { "Shipper": { "Name": " DEMO ACCOUNT", "ContactPerson": "DEMO ACCOUNT", "Address1": "Block C, 3A01 & 3A02,", "Address2": "Level 3A, Kelana Square,", "Address3": "No.17, Jalan SS7/26", "Postcode": "47301", "City": "Petaling Jaya", "State": "Selangor", "CountryCode": "MY", "Phone1": "+60378038830" }, "Consignee": { "ContactPerson": "LWE (AU) Ltd.", "Address1": "Test Address 1", "Address2": "Test Address 2", "Postcode": "70000", "City": "JOHOR BHARU", "State": "SELANGOR", "CountryCode": "MY", "Phone1": "03-8888888" }, "Items": [ { "Description": "item1", "Quantity": 10, "UnitValue": 20.0, "HSCode": "30", "SKU": "40", "Url": "50" } ], "Packages": [ { "PackageReference": "pkg1", "Length": 10.0, "Width": 20.0, "Height": 30.0, "ActualWeight": 40.0, "ChildHawb": "458040010409726PC001" } ], "ShipmentsReference": [ { "CarrierName": "POS-LAJU", "ReferenceNo": "458040010409726" } ], "HawbNo": "458040010409726", "TOSMode": "MY-E-EXPRESS", "CurrencyCode": "MYR", "PackageType": "SPX", "WeightType": "KG", "ShipmentDate": "2018-07-01T00:00:00+08:00" } } ] }
Copyright © 2019 Unixus Solutions Sdn. Bhd. All rights reserved.