/
Import XML format

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:


CRITyCdType
SPsenders ref.
AAOreceivers ref.
PRNbooking confirmation number
CUsender 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:


AttributeValueExample
SrvOpCdProduct codeA
PuDtmPickup date and time2017-01-31 12:40:00
CWgtUomWeight unitsKG
SDclWgtTotal declared weight15.6
DclNoPcsNumber of packages2
EstDtmDlvEstimated delivery date2017-02-04 23:59:00
CstValValue, optional100
CstValCurCdCurrency code, optionalDKK
InsValInsurance value, optional100


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:


AttributeValueExample
CustNmNameMegaCorporation
CntNmContact namePeter Smith
Addr1Address 1
Addr2Address 2
ZipZip1000
CtyNmCity nameCopenhagen
CtryCdCountry codeDK
CtryDivNmOptional 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:


AttributeValueExample
ShpIdAWB number of the shipment
PcsIdOptional unique ID of the package
CWgtUomWeight unitsKG
DclWgtWeight 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:


AttributeValueExample
ShpIdAWB number
LEvtCdThe type of status/event/scan, 2 lettersRW
EvtDtmThe date+time2017-02-03 15:30:00
RpSrvaCdLocation where this took placeHamburg Airport
SignName of whoever signed ('POD')SMITH
PcsIdOptional ID of the package this applies to
EvtRmkTextual equivalent of LEvtCdWEIGHT AND DIMENSION
SpcTxAdditional info, depends on LEvtCd


Some of the supported values for LEvtCd:

LEvtCdMeaningSpcTx
RWWeight and dimensions of a packageThe weight and dimensions, see below
SDShipment details
OKDelivered
DFDepart facility
WCWith 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> 

Related content

Pickup XML format
More like this
Booking XML format
More like this
Booking CSV format
More like this
EDI specification
More like this