Skip to content

Receive Advice

Receiving Advice -> (layer: 'transaction', label: 'receiveAdvice')

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 (:).

// Context Node: /receiving_advice:ReceivingAdviceMessage/receivingAdvice
{
  "transactionID" : "receivingAdviceIdentification/entityIdentification",
  "creationDateTime" : "creationDateTime",
  "receivingDateTime" : "receivingDateTime",
  "documentStatusCode" : "documentStatusCode",
  "contentOwnerGLN" : "contentOwner/gln",
  "receiverGLN" : "receiver/gln",
  "shipperGLN" : "shipper/gln",
  "shipFromGLN" : "shipFrom/gln",
  "shipToGLN" : "shipTo/gln",
  "despatchAdviceID" : "despatchAdvice/entityIdentification",
  // Context Node: receivingAdviceLogisticUnit
  "receivingAdviceLogisticUnit" : [
    {
      "packageTypeCode" : "packageTypeCode",
      "logisticUnitIdentification" : {
        "unitType" : "name(logisticUnitIdentification/*[1])",
        "unitID" : "logisticUnitIdentification/*[1]"
      },
      // Context Node: receivingAdviceLineItem
      "receivingAdviceLineItem" : [
        {
          "lineItemNumber" : "lineItemNumber",
          "receivedQuantity" : "quantityReceived",
          "receivedQuantityMeasurementUnitCode" : "quantityReceived/@MeasurementUnitCode",
          "acceptedQuantity" : "quantityAccepted",
          "acceptedQuantityMeasurementUnitCode" : "quantityAccepted/@MeasurementUnitCode",
          "transactionalTradeItemGTIN" : "transactionalTradeItem/gtin",
          "requestedItemGTIN" : "requestedItemIdentification/gtin",
          // Context Node: despatchAdvice
          "despatchAdvice" : {
            "despatchAdviceId" : "entityIdentification",
            "lineItemNumber" : "lineItemNumber"
          },
          // Context Node: receivingConditionInformation
          "receivingConditionInformation" : [
            {
              "receivingConditionCode" : "receivingConditionCode",
              "receivingConditionQuantity" : "receivingConditionQuantity",
              "receivingConditionQuantityMeasurementUnitCode" : "receivingConditionQuantity/@MeasurementUnitCode"
            }
          ]
        }
      ]
    }
  ],
  "flatEPCList" : [
    "receivingAdviceLogisticUnit/logisticUnitIdentification/*[1]",
    "receivingAdviceLogisticUnit/receivingAdviceLineItem/transactionalTradeItemGTIN",
    ...
  ]
}

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.

This is the generated ID:

"id": "urn:transaction:receiveAdvice:security_disabled:default:default:string"

This is the generated JSON:

{
  "creationDateTime": "2011-04-13T11:45:00.000-05:00",
  "documentStatusCode": "ORIGINAL",
  "transactionID": "string",
  "receivingDateTime": "2011-04-11T23:00:00.000-05:00",
  "shipperGLN": "string",
  "receiverGLN": "string",
  "shipToGLN": "string",
  "despatchAdviceID": "string",
  "receivingAdviceLogisticUnit": [
    {
      "packageTypeCode": "PE (pallet, modular)",
      "logisticUnitIdentification": {
        "unitType": "sscc",
        "unitId": "string"
      },
      "receivingAdviceLineItem": [
        {
          "lineItemNumber": "1",
          "receivedQuantity": "48",
          "receivedQuantityMeasurementUnitCode": "KGM",
          "acceptedQuantity": "38",
          "acceptedQuantityMeasurementUnitCode": "KGM",
          "transactionalTradeItemGTIN": "string",
          "requestedItemGTIN": "string",
          "despatchAdvice": {
            "despatchAdviceID": "string",
            "lineItemNumber": "1"
          },
          "receivingConditionInformation": [
            {
              "receivingConditionCode": "DAMAGED_PRODUCT_OR_CONTAINER",
              "receivingConditionQuantity": "10",
              "receivingConditionQuantityMeasurementCode": "KGM"
            },
            {
              "receivingConditionCode": "GOOD_CONDITION",
              "receivingConditionQuantity": "38",
              "receivingConditionQuantityMeasurementCode": "KGM"
            }
          ]
        }
      ]
    },
    {
      "packageTypeCode": "PE (pallet, modular)",
      "logisticUnitIdentification": {
        "unitType": "sscc",
        "unitId": "string"
      },
      "receivingAdviceLineItem": [
        {
          "lineItemNumber": "2",
          "receivedQuantity": "24",
          "receivedQuantityMeasurementUnitCode": "KGM",
          "acceptedQuantity": "24",
          "acceptedQuantityMeasurementUnitCode": "KGM",
          "transactionalTradeItemGTIN": "string",
          "requestedItemGTIN": "string",
          "despatchAdvice": {
            "despatchAdviceID": "string",
            "lineItemNumber": "2"
          },
          "receivingConditionInformation": [
            {
              "receivingConditionCode": "GOOD_CONDITION",
              "receivingConditionQuantity": "24",
              "receivingConditionQuantityMeasurementCode": "KGM"
            }
          ]
        }
      ]
    }
  ],
  "flatEPCList" : [
    "string",
    "string",
    "string",
    "string"
  ]
}