Import XML format
This section describes the XML used for importing shipments. The XML is intended to be compatible with the XML used by DHL. Importing is used for shipments that have been created by a carrier (eg. DHL), and simply need to be imported into Leaps for tracking or accounting purposes.
THIS SECTION IS INCOMPLETE
HDR
The <HDR>
element must contain a <Sndr>
element specifying the name of the application that generated the XML.
BD
The <BD>
element contains a list of shipments (<Shp>
elements), package details (<Pcs>
elements) and status messages (<Gevt>
elements).
The <Shp>
elements should come first, then the <Pcs>
elements, and finally the <Gevt>
elements.
Shp
The <Shp>
element describe a shipment. It must have an Id
attribute which specifies the AWB number, and must contain a <ShpDsc>
element, one or more <ShpRef>
elements, and a <ShpTr>
element.
ShpDsc
This specifies the goods description, the value is shared by all packages in the shipment.
<ShpDsc Cd="CNT" DscGds="GOODSDESCRIPTION"/>
ShpRef
This defines various references for the shipment:
<ShpRef CRITyCd="TYPE" ShpRef="SENDERSREF"/>
The reference type is specified by the CRITyCd
attribute, and the value by the ShpRef
attribute.
The following types are supported:
CRITyCd | Type |
---|---|
SP | senders ref. |
AAO | receivers ref. |
PRN | booking confirmation number |
CU | sender ref. (this is different from senders ref.) |
ShpTr
The <ShpTr>
element contains a number of <SCDtl>
elements: one with CRITyCd
equal to SP
(shipper), one with CRITyCd
equal to RV
(receiver), and one with CRITyCd
equal to PY
(payor).
The following details are specified in attributes for the element:
Attribute | Value | Example |
---|---|---|
SrvOpCd | Product code | A |
PuDtm | Pickup date and time | 2017-01-31 12:40:00 |
CWgtUom | Weight units | KG |
SDclWgt | Total declared weight | 15.6 |
DclNoPcs | Number of packages | 2 |
EstDtmDlv | Estimated delivery date | 2017-02-04 23:59:00 |
CstVal | Value, optional | 100 |
CstValCurCd | Currency code, optional | DKK |
InsVal | Insurance value, optional | 100 |
SCDtl
The <SCDtl>
element describes either shipper/sender, receiver or payor. This is determined by the value of the attribute CRITyCd
, see <ShpTr>
.
For payor the only attribute is an account number in AccNo
:
<SCDtl CRITyCd="PY" AccNo="123456789"/>
The account number is matched against the accountnumbers specified per portal in the Leaps system, to determine which portal the shipment belongs to.
For sender and receiver, the following details are specified in attributes:
Attribute | Value | Example |
---|---|---|
CustNm | Name | MegaCorporation |
CntNm | Contact name | Peter Smith |
Addr1 | Address 1 | |
Addr2 | Address 2 | |
Zip | Zip | 1000 |
CtyNm | City name | Copenhagen |
CtryCd | Country code | DK |
CtryDivNm | Optional state name |
For sender and receiver the email adresse and phone number may be specified in <SCCDev>
elements.
Pcs
The <Pcs>
elements describe the packages; the following values are specified in the attributes:
Attribute | Value | Example |
---|---|---|
ShpId | AWB number of the shipment | |
PcsId | Optional unique ID of the package | |
CWgtUom | Weight units | KG |
DclWgt | Weight of the package |
The <Pcs>
must be included in the same XML as the corresponding <Shp>
element.
Gevt
The <Gevt>
element describes a status message / event / scanning. The <Gevt>
elements in an XML file need not refer to any of the <Shp>
or <Pcs>
elements in the same file, however, a shipment will not be imported unless there is a SD
status in the XML, ie. <Gevt LevtCd=“SD” …>
.
The following attribues are read from the element:
Attribute | Value | Example |
---|---|---|
ShpId | AWB number | |
LEvtCd | The type of status/event/scan, 2 letters | RW |
EvtDtm | The date+time | 2017-02-03 15:30:00 |
RpSrvaCd | Location where this took place | Hamburg Airport |
Sign | Name of whoever signed ('POD') | SMITH |
PcsId | Optional ID of the package this applies to | |
EvtRmk | Textual equivalent of LEvtCd | WEIGHT AND DIMENSION |
SpcTx | Additional info, depends on LEvtCd |
Some of the supported values for LEvtCd
:
LEvtCd | Meaning | SpcTx |
---|---|---|
RW | Weight and dimensions of a package | The weight and dimensions, see below |
SD | Shipment details | |
OK | Delivered | |
DF | Depart facility | |
WC | With courier |
Weight and dimensions are specified in SpcTx
as a list of values separated by |. The format is:
|||weight|||height|width|length|weightunit|dimensionunit|
See example below. Weight unit and dimension unit should be 'kg' and 'cm' respectively.
Example of the XML structure
<MSG> <HDR> <Sndr AppNm="GLSIMPORT"/> </HDR> <Bd> <Shp Id="AWBNUMBER"> <ShpDsc Cd="CNT" DscGds="PACKAGEDESCRIPTION"/> <ShpRef CRITyCd="CU" ShpRef="SENDERSREF"/> <ShpRef CRITyCd="PRN" ShpRef="REF"/> <ShpTr SrvOpCd="PRODUCTCODE" PuDtm="2017-01-17 12:39:00" CWgtUom="KG" SDclWgt="TOTALDECLAREDWEIGHT" DclNoPcs="NUMPIECES" CmtdDtm="2017-01-23 23:59:00" EstDtmDlv="2017-01-23 23:59:00"> <SCDtl CRITyCd="SP" CustNm="NAME" CntNm="CONTACT" Addr1="ADDR" Addr2="ADDR2" Zip="ZIP" CtyNm="CITY" CtryCd="COUNTRYCODE"> <SCCDev CDevNo="TELEPHONENO" CDevTyCd="TEL"/> </SCDtl> <SCDtl CRITyCd="RV" CustNm="NAME" CntNm="CONTACT" Addr1="ADDR1" Addr2="ADDR2" Zip="ZIP" CtyNm="CITY" CtryCd="COUNTRYCODE" CtryDivNm="STATE"> <SCCDev CDevNo="TELEPHONENO" CDevTyCd="TEL"/> <SCCDev CDevNo="EMAILADDR" CDevTyCd="EML"/> </SCDtl> <SCDtl CRITyCd="PY" AccNo="ACCOUNTNO"/> </ShpTr> </Shp> <Pcs ShpId="AWBNUMBER" PcsId="UNIQUEIDFORPACKAGE" CWgtUom="KG" DclWgt="WEIGHT"/> <Gevt ShpId="AWBNUMBER" RpSrvaCd="SHA" LEvtCd="RW" EvtDtm="2017-01-22 09:38:00" EvtGMT="+08:00" EvtRmk="WEIGHT AND DIMENSION" SpcTx="|||7.6|||20|20|30|KG|CM|"> </Gevt> </Bd> </MSG>