Skip to content

Master Data Item

Master Data Item -> (layer: 'object', label: 'master')

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: /item_data_notification:itemDataNotificationMessage/tradeItemData
{
  "objectDescription": "tradeItemDescription",
  "objectID": "gtin",
  "objectSKU": "sku",
  "dataSourceGLN": "dataSource/gln",
  "dataRecipientGLN": "dataRecipient/gln"
}

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"?>
<item_data_notification:itemDataNotificationMessage
        xmlns:item_data_notification="urn:gs1:ecom:item_data_notification: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:item_data_notification:xsd:3 ../Schemas/gs1/ecom/ItemDataNotification.xsd">
    <sh:StandardBusinessDocumentHeader>
        <sh:HeaderVersion>1.0</sh:HeaderVersion> <!--Don't change-->
        <sh:Sender>
            <sh:Identifier Authority="GS1">string</sh:Identifier> <!--Mandatory: GLN (global location number) for the party who sent this item information-->
        </sh:Sender>
        <sh:Receiver>string
            <sh:Identifier Authority="GS1"></sh:Identifier>
        </sh:Receiver>
        <sh:DocumentIdentification>
            <sh:Standard>GS1</sh:Standard> <!--Don't change-->
            <sh:TypeVersion>3.2</sh:TypeVersion> <!--Don't change-->
            <sh:InstanceIdentifier>string</sh:InstanceIdentifier>
            <sh:Type>Item Data Notification</sh:Type> <!--Don't change-->
            <sh:MultipleType>false</sh:MultipleType> <!--Don't change-->
            <sh:CreationDateAndTime>2004-05-24T18:12:00.000-05:00</sh:CreationDateAndTime>
        </sh:DocumentIdentification>
    </sh:StandardBusinessDocumentHeader>
    <tradeItemData>
        <tradeItemDescription languageCode="en">description codes</tradeItemDescription>
        <gtin>string</gtin>
        <sku>string</sku>
        <dataSource>
            <gln>string</gln>
        </dataSource>
        <dataRecipient>
            <gln></gln>
        </dataRecipient>
    </tradeItemData>
    <tradeItemData>
        <tradeItemDescription languageCode="en">description codes</tradeItemDescription>
        <gtin>string</gtin>
        <sku>string</sku>
        <dataSource>
            <gln>string</gln>
        </dataSource>
        <dataRecipient>
            <gln></gln>
        </dataRecipient>
    </tradeItemData>
    <tradeItemData>
        <tradeItemDescription languageCode="en">description codes</tradeItemDescription>
        <gtin>string</gtin>
        <sku>string</sku>
        <dataSource>
            <gln>string</gln>
        </dataSource>
        <dataRecipient>
            <gln></gln>
        </dataRecipient>
    </tradeItemData>
    <tradeItemData>
        <tradeItemDescription languageCode="en">description codes</tradeItemDescription>
        <gtin>string</gtin>
        <sku>string</sku>
        <dataSource>
            <gln>string</gln>
        </dataSource>
        <dataRecipient>
            <gln></gln>
        </dataRecipient>
    </tradeItemData>
</item_data_notification:itemDataNotificationMessage>

Output

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

For each tradeItemData, this is the generated ID:

{
  "id": "urn:ibm:provenance:asset:object:master:security_disabled:default:default:string"
}

For each tradeItemData, this is the generated JSON:

{
    "objectDescription": "description codes",
    "objectID": "string",
    "objectSKU": "string",
    "dataSourceGLN": "string",
    "dataRecipientGLN": "",
    "documentHeader": {
        "senderGLN": "string",
        "receiverGLN": "",
        "documentID": "string",
        "documentType": "Item Data Notification",
        "creationDateTime": "2004-05-24T18:12:00.000-05:00"
    }
}