Deprecated Inventory snapshot events
Inventory snapshot events are triggered when an inventory snapshot is captured in Store Inventory Management. These snapshots represent the state of inventory at a specific time to show the quantities of products that are available in different locations. The event is triggered during API calls without the repeatPeriod attribute or as part of the scheduled snapshot operations.
When an inventory snapshot is captured, the application triggers the inventorySnapshot event, which captures the point-in-time inventory data for a store. The event provides details such as product identifiers, quantities, locations, and other relevant data. The code for this event is inventorySnapshot.
The following JSON example shows a published event that is generated when an inventory snapshot is captured. The application encodes and adds the event data to the messages[].data JSON path.
{
"messages": [
{
"data": [
{
"productId": "100001",
"unitOfMeasure": "EACH",
"inventoryStatus": "GOOD",
"productClass": "",
"segmentType": "",
"segment": "",
"tagNo": "",
"batchNo": "",
"lotNo": "",
"manufacturedDate": "",
"locationId": "Bin1",
"quantity": 9.0
},
{
"productId": "100002",
"unitOfMeasure": "EACH",
"inventoryStatus": "GOOD",
"productClass": "",
"segmentType": "",
"segment": "",
"tagNo": "",
"batchNo": "",
"lotNo": "",
"manufacturedDate": "",
"locationId": "FoH",
"quantity": -1.0
}
],
"attributes": {
"code": "inventorySnapshot",
"timestamp": "2024-10-10T08:00Z[Etc/UTC]",
"messageId": "17d03402-7176-49df-9dc5-b0c25c22f310",
"batchId": "1692ae82-25f9-4943-b4d6-79458077925e",
"totalMessages": "1",
"messageSequence": "1",
"storeId": "Store1",
"groupBy": ""
}
}
]
}
The following example shows the JSON schema specification that defines the structure of the JSON data that is published to the inventorySnapshot event. To request the Inventory snapshot events V2 feature for a store, use the Create inventory snapshot scheduled for the associated stores API.
{
"properties": {
"messages": {
"type": "array",
"description": "Array containing the message details",
"items": {
"type": "object",
"properties": {
"data": {
"type": "array",
"description": "Array containing the inventory details",
"items": {
"type": "object",
"properties": {
"productId": {
"type": "string",
"description": "Unique identifier of the product"
},
"unitOfMeasure": {
"type": "string",
"description": "Unit of measure for the product"
},
"inventoryStatus": {
"type": "string",
"description": "Status of the inventory (e.g., GOOD)"
},
"productClass": {
"type": "string",
"description": "Classification of the product"
},
"segmentType": {
"type": "string",
"description": "Type of segment for the product"
},
"segment": {
"type": "string",
"description": "Segment details of the product"
},
"tagNo": {
"type": "string",
"description": "Tag number for the product"
},
"batchNo": {
"type": "string",
"description": "Batch number for the product"
},
"lotNo": {
"type": "string",
"description": "Lot number for the product"
},
"manufacturedDate": {
"type": "string",
"description": "Manufacturing date of the product"
},
"locationId": {
"type": "string",
"description": "Location identifier where the product is stored"
},
"quantity": {
"type": "number",
"description": "Quantity of the product in stock"
}
}
}
},
"attributes": {
"type": "object",
"description": "Object containing the event attributes",
"properties": {
"code": {
"type": "string",
"description": "Code representing the event"
},
"timestamp": {
"type": "string",
"description": "The exact time when the snapshot was taken"
},
"messageId": {
"type": "string",
"format": "uuid",
"description": "A unique identifier for the event message"
},
"batchId": {
"type": "string",
"format": "uuid",
"description": "Unique identifier of a store batch"
},
"totalMessages": {
"type": "string",
"description": "The total number of messages for this store (for pagination)"
},
"messageSequence": {
"type": "string",
"description": "Page number of the current message"
},
"storeId": {
"type": "string",
"description": "Unique identifier of the store"
},
"groupBy": {
"type": "string",
"description": "Attribute used for grouping the data"
}
}
}
}
}
}
}
}