Skip to content
This repository was archived by the owner on Oct 21, 2021. It is now read-only.

Standard Business Document Header

Josh Horton edited this page Mar 3, 2020 · 3 revisions

This page describes the standard document header included in all GS1 documents.

GS1 to JSON mapping

This section shows the GS1 XML to JSON mappings. JSON keys are on the left, and the XPaths to the corresponding tag in GS1 XML are on the right, separated by a colon character (:).

// ContextNode: /{documentTypeRootTag}/sh:StandardBusinessDocumentHeader
{
"documentHeader": {
"organization": "<string>",
"layer": "location",
"label": "location",
"data":

{
    "senderGLN": "sh:Sender/sh:Identifier",
    "receiverGLN": "sh:Receiver/sh:Identifier",
    "documentID": "sh:documentIdentification/sh:InstanceIdentifier",
    "documentType": "sh:documentIdentification/sh:Type",
    "creationDateTime": "sh:documentIdentifaction/sh:CreationDateAndTime"
  }
}

Input

The following example shows a valid GS1 XML file for input. The JSON output follows.

Note: The following fields have been removed for GDPR compliance:

  1. StandardBusinessDocumentHeader.Sender.ContactInformation (all sub-elements)
  2. StandardBusinessDocumentHeader.Receiver.ContactInformation (all sub-elements)
<?xml version="1.0" encoding="UTF-8"?>
<receiving_advice:receivingAdviceMessage
    xmlns:receiving_advice="urn:gs1:ecom:receiving_advice:xsd:3"
    xmlns:sh="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:gs1:ecom:receiving_advice:xsd:3 ../Schemas/gs1/ecom/ReceivingAdvice.xsd">
    <sh:StandardBusinessDocumentHeader>
        <sh:HeaderVersion>1.0</sh:HeaderVersion>
        <sh:Sender>
            <sh:Identifier Authority="GS1">string</sh:Identifier>
        </sh:Sender>
        <sh:Receiver>
            <sh:Identifier Authority="GS1">string</sh:Identifier>
        </sh:Receiver>
        <sh:DocumentIdentification>
            <sh:Standard>GS1</sh:Standard>
            <sh:TypeVersion>3.2</sh:TypeVersion>
            <sh:InstanceIdentifier>string</sh:InstanceIdentifier>
            <sh:Type>Receiving Advice</sh:Type>
            <sh:MultipleType>false</sh:MultipleType>
            <sh:CreationDateAndTime>2011-04-13T11:45:00.000-05:00</sh:CreationDateAndTime>
        </sh:DocumentIdentification>
    </sh:StandardBusinessDocumentHeader>
    <receivingAdvice>
        <creationDateTime>2011-04-13T11:45:00.000-05:00</creationDateTime>
        <documentStatusCode>ORIGINAL</documentStatusCode>
        <receivingAdviceIdentification>
            <entityIdentification>string</entityIdentification>
        </receivingAdviceIdentification>
        <receivingDateTime>2011-04-11T23:00:00.000-05:00</receivingDateTime>
        <reportingCode>FULL_DETAILS</reportingCode>
        <shipper>
            <gln>string</gln>
        </shipper>
        <receiver>
            <gln>string</gln>
        </receiver>
        <shipTo>
            <gln>string</gln>
        </shipTo>
        <despatchAdvice>
            <entityIdentification>string</entityIdentification>
        </despatchAdvice>
        <receivingAdviceLogisticUnit>
            <packageTypeCode>PE (pallet, modular)</packageTypeCode>
            <logisticUnitIdentification>
                <sscc>string</sscc>
            </logisticUnitIdentification>
            <receivingAdviceLineItem>
                <lineItemNumber>1</lineItemNumber>
                <quantityReceived measurementUnitCode="KGM">48</quantityReceived>
                <quantityAccepted measurementUnitCode="KGM">38</quantityAccepted>
                <transactionalTradeItem>
                    <gtin>string</gtin>
                </transactionalTradeItem>
                <requestedItemIdentification>
                    <gtin>string</gtin>
                </requestedItemIdentification>
                <despatchAdvice>
                    <entityIdentification>string</entityIdentification>
                    <lineItemNumber>1</lineItemNumber>
                </despatchAdvice>
                <receivingConditionInformation>
                    <receivingConditionCode>DAMAGED_PRODUCT_OR_CONTAINER</receivingConditionCode>
                    <receivingConditionQuantity measurementUnitCode="KGM">10</receivingConditionQuantity>
                </receivingConditionInformation>
                <receivingConditionInformation>
                    <receivingConditionCode>GOOD_CONDITION</receivingConditionCode>
                    <receivingConditionQuantity measurementUnitCode="KGM">38</receivingConditionQuantity>
                </receivingConditionInformation>
            </receivingAdviceLineItem>
        </receivingAdviceLogisticUnit>
        <receivingAdviceLogisticUnit>
            <packageTypeCode>PE (pallet, modular)</packageTypeCode>
            <logisticUnitIdentification>
                <sscc>string</sscc>
            </logisticUnitIdentification>
            <receivingAdviceLineItem>
                <lineItemNumber>2</lineItemNumber>
                <quantityReceived measurementUnitCode="KGM">24</quantityReceived>
                <quantityAccepted measurementUnitCode="KGM">24</quantityAccepted>
                <transactionalTradeItem>
                    <gtin>string</gtin>
                </transactionalTradeItem>
                <requestedItemIdentification>
                    <gtin>string</gtin>
                </requestedItemIdentification>
                <despatchAdvice>
                    <entityIdentification>string</entityIdentification>
                    <lineItemNumber>2</lineItemNumber>
                </despatchAdvice>
                <receivingConditionInformation>
                    <receivingConditionCode>GOOD_CONDITION</receivingConditionCode>
                    <receivingConditionQuantity measurementUnitCode="KGM">24</receivingConditionQuantity>
                </receivingConditionInformation>
            </receivingAdviceLineItem>
        </receivingAdviceLogisticUnit>
    </receivingAdvice>
</receiving_advice:receivingAdviceMessage>

Output

The following example shows the JSON output from the input GS1 XML file above.

{
  "documentHeader": {
    "senderGLN": "string",
    "receiverGLN": "string",
    "documentID": "string",
    "documentType": "Receiving Advice",
    "creationDateTime": "2011-04-13T11:45:00.000-05:00"
  }
}
Clone this wiki locally