GS1 format
The GS1 format
GS1 XML format
The GS1 XML format
Example of GS1 import
Currently, we are using this sample GS1 file to demonstrate the GS1 import process. Below is the container information.
📦 DespatchAdviceMessage Structure​
🧱 Root Container​
- SSCC:
124523678524552123
- Contains:
- Container 123456789123456785
- Container 123456789123456786
📦 Container: 123456789123456785
​
Parent SSCC:
124523678524552123
Contains Line Items:
Line Item 1
- GTIN:
12345678901235
- Item ID:
41
- Quantity:
10
- Serial Numbers:
12876138618182
12876138618183
- Purchase Order:
OrderNumber1
, line1
- GTIN:
Line Item 2
- GTIN:
12345678901235
- Item ID:
42
- Quantity:
10
- Serial Numbers:
12876138618182
12876138618183
- Purchase Order:
OrderNumber2
, line2
- GTIN:
📦 Container: 123456789123456786
​
Parent SSCC:
124523678524552123
Contains Line Items:
Line Item 3
- GTIN:
12345678901236
- Item ID:
41
- Quantity:
10
- Batch:
batchnumber1
- Best Before:
2025-08-13
- Expiry:
2026-08-13
- Purchase Order:
OrderNumber3
, line3
- Customer Order:
12345
- GTIN:
Line Item 4
- GTIN:
12345678901236
- Item ID:
42
- Quantity:
10
- Batch:
batchnumber1
- Best Before:
2025-08-13
- Expiry:
2026-08-13
- Purchase Order:
OrderNumber4
, line4
- Customer Order:
12345
- GTIN:
Line Item 5
- GTIN:
12345678901236
- Item ID:
43
- Quantity:
10
- Batch:
batchnumber1
- Best Before:
2025-08-13
- Expiry:
2026-08-13
- Purchase Order:
OrderNumber5
, line5
- Customer Order:
12345
- GTIN:
📊 Summary​
Category | Value |
---|---|
Root Container | 124523678524552123 |
Sub Containers | 123456789123456785 , 123456789123456786 |
Total Line Items | 5 |
GTINs Used | 12345678901235 , 12345678901236 |
Orders | OrderNumber1 to OrderNumber5 |
Customer Order | 12345 (only in container 123456789123456786 ) |
Export format​
{
"businessUnitId": "E2E002",
"comment": "A comment from the supplier/warehouse",
"customsAmount": null,
"deliveryNoteId": "E2ETESTNUMBER1",
"shipperId": "Adidas",
"shipperType": "businessPartnerId",
"submittedBy": "expect.any(String)",
"tenantId": "CIR7nQwtS0rA6t0S6ejd",
"uniqueId": "84bdb5524e4e57b8334b1b7955ff48b0",
"lines": [
{
"lineId": "1",
"approvedQuantity": 12,
"deltaQuantity": 12,
"expectedQuantity": 10,
"batchNumber": null,
"containers": [{ "id": "X" }],
"currencyCode": "EUR",
"itemId": "41",
"orderId": "OrderNumber1",
"orderLineId": "1",
"reasonCodes": [
{ "id": "reasonCode1", "quantity": 1 },
{ "id": "reasonCode2", "quantity": 1 }
],
"serialNumbers": ["12876138618182", "12876138618183"],
"unitPrice": 1000
},
{
"lineId": "2",
"approvedQuantity": 8,
"deltaQuantity": 8,
"expectedQuantity": 10,
"batchNumber": null,
"containers": [{ "id": "X" }],
"currencyCode": "EUR",
"itemId": "42",
"orderId": "OrderNumber2",
"orderLineId": "2",
"reasonCodes": [
{ "id": "reasonCode1", "quantity": -2 }
],
"serialNumbers": ["12876138618182", "12876138618183"],
"unitPrice": 1000
},
{
"lineId": "3",
"approvedQuantity": 10,
"deltaQuantity": 10,
"expectedQuantity": 10,
"batchNumber": "batchnumber1",
"containers": [{ "id": "Y" }],
"currencyCode": "EUR",
"itemId": "41",
"orderId": "OrderNumber3",
"orderLineId": "3",
"reasonCodes": [],
"serialNumbers": [],
"unitPrice": 1000
},
{
"lineId": "4",
"approvedQuantity": 10,
"deltaQuantity": 10,
"expectedQuantity": 10,
"batchNumber": "batchnumber1",
"containers": [{ "id": "Y" }],
"currencyCode": "EUR",
"itemId": "42",
"orderId": "OrderNumber4",
"orderLineId": "4",
"reasonCodes": [],
"serialNumbers": [],
"unitPrice": 1000
},
{
"lineId": "5",
"approvedQuantity": 10,
"deltaQuantity": 10,
"expectedQuantity": 10,
"batchNumber": "batchnumber1",
"containers": [{ "id": "Y" }],
"currencyCode": "EUR",
"itemId": "43",
"orderId": "OrderNumber5",
"orderLineId": "5",
"reasonCodes": [],
"serialNumbers": [],
"unitPrice": 1000
}
]
}
Reason Codes Explanation
Line 1​
Approved quantity is 12 (2 more than expected 10).
Two reason codes explain this extra quantity:
- damaged explains +1 unit
- not delivered explains +1 unit
Line 2​
Approved quantity is 8 (2 less than expected 10).
One reason code explains the reduction:
- damaged explains -2 units
Line 3​
Approved quantity matches expected quantity (10).
No adjustments, so no reason codes.
Line 4​
Approved quantity matches expected quantity (10).
No adjustments, so no reason codes.
Line 5​
Approved quantity matches expected quantity (10).
No adjustments, so no reason codes.
Delta Quantity Explanation with Example
First-Time Export​
When the delivery lines are exported for the first time, the deltaQuantity
is equal to the approvedQuantity
.
For example, if the approved quantity for a line is 7, then:
{
"approvedQuantity": 7,
"deltaQuantity": 7
}
Consider line with below details​
Line Item Details​
- Expected quantity: 10
- Approved quantity: 7 (3 less due to damage or shortage)
- Adjustments: One reason code explaining the 3 missing items (e.g., damaged goods)
JSON Representation​
{
"lineId": "X",
"expectedQuantity": 10,
"approvedQuantity": 7,
"deltaQuantity": 7,
"reasonCodes": [
{ "id": "damaged", "quantity": -3 }
]
}
Modifying After Goods Are Received​
Suppose after the first export, an additional item is found damaged, reducing the approved quantity by 1 more.
This modification export will only send the change in quantity, not the whole approved quantity again.
If the previous approved quantity was 7, now it becomes 6. The delta will be the difference: -1.
{
"lineId": "X",
"approvedQuantity": 6,
"deltaQuantity": -1,
"reasonCodes": [
{ "id": "damaged", "quantity": -1 }
]
}
This means the system reports only the adjustment since the last export (1 less item approved due to damage).
Summary​
First-time export: deltaQuantity = approvedQuantity (full quantity exported)
Subsequent exports: deltaQuantity = change in approved quantity (only adjustments exported)
Reason codes explain the causes of any adjustments (positive or negative quantities).
How and when will I get the data?​
Once submitted, goods received publishes events/data to PubSub. Other Hii Retail services, or external system using External Events, can subscribe to these messages.
Subscriptions​
Tech | Subscription |
---|---|
Pub/Sub | grc.public.event.goods-received.v1 |
External Events | grc.public.event.goods-received.v1 |
Format​
The JSON format.