-
Notifications
You must be signed in to change notification settings - Fork 34
Purchase Order
This page describes the XML to JSON mappings for Purchase Order.
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: /order:orderMessage/order
{
"assetIdUri": "urn:ibm:provenance:asset:transaction:order:<string>:default:default:<string>",
"organization": "<string>",
"layer": "transaction",
"label": "order",
"data":
{
"transactionID" : "orderIdentification/entityIdentification",
"creationDateTime" : "creationDateTime",
"documentStatusCode" : "documentStatusCode",
"orderTypeCode": "orderTypeCode",
"buyerGLN" : "buyer/gln",
"sellerGLN" : "seller/gln",
// Context Node: orderLogisticalInformation
"orderLogisticalInformation" : {
"shipFromGLN": "shipFrom/gln",
"shipTo": "shipTo/gln",
"orderLogisticalDateInforamtion": {
"requestedDeliveryDateTime": "orderLogisticalDateInformation/requestedDeliveryDateTime"
}
}
// Context Node: referencedOrder
"referencedOrder" : [ {
"entityIdentification" : "entityIdentification",
"lineItemNumber" : "lineItemNumber",
"orderRelationship" : "orderRelationship"
} ],
"isReturnOrder" : "extension/isReturnOrder"
// Context Node: orderLineItem
"orderLineItem" : [
{
"lineItemNumber" : "lineItemNumber",
"transactionalTradeItemGTIN" : "transactionalTradeItem/gtin",
"requestedQuantity" : "requestedQuantity",
"requestedQuantityMeasurementUnitCode" : "requestedQuantity/@MeasurementUnitCode",
// Context Node: itemPriceBaseQuantity
"itemPriceBaseQuantity" : {
"quantity" : "itemPriceBaseQuantity",
"uom" : "itemPriceBaseQuantity/@MeasurementUnitCode"
},
// Context Node: referencedOrder
"referencedOrder" : [ {
"entityIdentification" : "entityIdentification",
"lineItemNumber" : "lineItemNumber",
"orderRelationship" : "orderRelationship"
} ],
"returnReasonCode" : "returnReasonCode",
// Context Node: extension
"extension" : {
"epcList" : "epcList",
// Context Node: quantityList
"quantityList" : [ {
"epcClass" : "epcClass",
"quantity" : "quantity",
"quantity_uom" : "uom"
} ]
}
],
"flatGTINList" : [
"orderLineItem/transactionalTradeItem/gtin",
...
]
}
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:
- StandardBusinessDocumentHeader.Sender.ContactInformation (all sub-elements)
- StandardBusinessDocumentHeader.Receiver.ContactInformation (all sub-elements)
<?xml version="1.0" encoding="UTF-8"?>
<order:orderMessage
xmlns:order="urn:gs1:ecom:order: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:order:xsd:3 ../Schemas/gs1/ecom/Order.xsd">
<sh:StandardBusinessDocumentHeader>
<sh:HeaderVersion>1.0</sh:HeaderVersion>
<sh:Sender>
<sh:Identifier Authority="GS1"/>
</sh:Sender>
<sh:Receiver>
<sh:Identifier Authority="GS1"/>
</sh:Receiver>
<sh:DocumentIdentification>
<sh:Standard>GS1</sh:Standard>
<sh:TypeVersion>3.3</sh:TypeVersion>
<sh:InstanceIdentifier>string</sh:InstanceIdentifier>
<sh:Type>order</sh:Type>
<sh:MultipleType>false</sh:MultipleType>
<sh:CreationDateAndTime>2006-01-10T12:00:01.000-05:00</sh:CreationDateAndTime>
</sh:DocumentIdentification>
</sh:StandardBusinessDocumentHeader>
<order>
<creationDateTime>2011-03-11T11:00:00.000-05:00</creationDateTime>
<documentStatusCode>ORIGINAL</documentStatusCode>
<orderIdentification>
<entityIdentification>string</entityIdentification>
</orderIdentification>
<orderTypeCode>string</orderTypeCode>
<buyer>
<gln>string</gln>
</buyer>
<seller>
<gln>string</gln>
</seller>
<orderLogisticalInformation>
<shipFrom>
<gln>string</gln>
</shipFrom>
<shipTo>
<gln>string</gln>
</shipTo>
<orderLogisticalDateInformation>
<requestedDeliveryDateTime>
<date>2011-04-11</date>
</requestedDeliveryDateTime>
</orderLogisticalDateInformation>
</orderLogisticalInformation>
<referencedOrder>
<entityIdentification>string</entityIdentification>
<lineItemNumber>2</lineItemNumber>
<orderRelationship>RELATED</orderRelationship>
</referencedOrder>
<extension>
<isReturnOrder>true</isReturnOrder>
</extension>
<orderLineItem>
<lineItemNumber>1</lineItemNumber>
<requestedQuantity measurementUnitCode="EA">48</requestedQuantity>
<itemPriceBaseQuantity measurementUnitCode="KGM">48</itemPriceBaseQuantity>
<transactionalTradeItem>
<gtin>string</gtin>
</transactionalTradeItem>
<referencedOrder>
<entityIdentification>string</entityIdentification>
<lineItemNumber>2</lineItemNumber>
<orderRelationship>string</orderRelationship>
</referencedOrder>
<returnReasonCode>27</returnReasonCode>
</orderLineItem>
<orderLineItem>
<lineItemNumber>2</lineItemNumber>
<requestedQuantity measurementUnitCode="EA">24</requestedQuantity>
<itemPriceBaseQuantity measurementUnitCode="KGM">24</itemPriceBaseQuantity>
<transactionalTradeItem>
<gtin>string</gtin>
</transactionalTradeItem>
</orderLineItem>
</order>
</order:orderMessage>
The following example shows the JSON output from the input GS1 XML file above.
This is the generated ID:
{
"id": "urn:transaction:order:security_disabled:default:default:string"
}
This is the generated JSON:
{
"creationDateTime": "2011-03-11T11:00:00-05:00",
"documentStatusCode": "ORIGINAL",
"transactionID": "string",
"orderTypeCode": "string",
"buyerGLN": "string",
"sellerGLN": "string",
"orderLogisticalInformation": {
"shipFromGLN": "string",
"shipToGLN": "string",
"orderLogisticalDateInformation": {
"requestedDeliveryDateTime": "2011-04-11T00:00:00Z"
}
},
"orderLineItems": [
{
"lineItemNumber": 1,
"transactionalTradeItemGTIN": "string",
"requestedQuantity": 48,
"requestedQuantityMeasurementUnitCode": "EA",
"itemPriceBaseQuantity": {
"quantity": 48,
"uom": "KGM"
},
"referencedOrder": {
"entityIdentification": "string",
"lineItemNumber": 2,
"orderRelationship": "string"
},
"returnReasonCode": "27"
},
{
"lineItemNumber": 2,
"transactionalTradeItemGTIN": "string",
"requestedQuantity": 24,
"requestedQuantityMeasurementUnitCode": "EA",
"itemPriceBaseQuantity": {
"quantity": 24,
"uom": "KGM"
}
}
],
"flatGTINList": [
"string"
],
"referencedOrder": [
{
"entityIdentification": "string",
"lineItemNumber": 2,
"orderRelationship": "RELATED"
}
],
"isReturnOrder": true
}
WELCOME!
Modules
Membership
Languages
Browsers
ONBOARDING
Onboarding Steps
Data Requirements
Data Types
Supplier Data
Payload Data
Insights Data
HOW-TO
Join by Invitation
Log in as New User
Authenticate Human Users
Authenticate System Users
Java Sample
Typescript Sample
IIB Sample
Assign User Roles
Upload Data
Automate Data Upload
Convert Spreadsheets
Convert Data
Whitelist Custom URLs
APIs-Swagger
Connector API
Documents API
Converter API
Trace API
Insights API
APIs-Usage
APIs
Insights API
Insights API Usage
Trace API
Connector API Errors
API Error Codes
REFERENCE
GS1
GS1 Identifier Reuse
Authentication
Identifiers
Message Codes
Cryptographic
Signatures
Signature Header
Access Control
Firewall Settings
XML to JSON
EPCIS Aggregation Add
EPCIS Aggregation Delete
EPCIS Object Add
EPCIS Object Delete
EPCIS Object Observed
EPCIS Transformation
Purchase Order
Despatch Advice
Receiving Advice
Master Data Item
Master Data Facility
Standard Business
Document Header