Eventos de instantáneas de inventario obsoletos
Los eventos de instantánea de inventario se activan cuando se captura una instantánea de inventario en la Gestión de Inventario de Tienda. Estas instantáneas representan el estado del inventario en un momento determinado para mostrar las cantidades de productos que están disponibles en diferentes ubicaciones. El evento se activa durante las llamadas a la API sin el atributo repeatPeriod o como parte de las operaciones de instantánea programadas.
Cuando se captura una instantánea de inventario, la aplicación activa el evento inventorySnapshot , que captura los datos de inventario puntuales de una tienda. El evento proporciona detalles como identificadores de productos, cantidades, ubicaciones y otros datos relevantes. La dirección code para este acto es inventorySnapshot.
El siguiente ejemplo JSON muestra un evento publicado que se genera cuando se captura una instantánea de inventario. La aplicación codifica y añade los datos del evento a 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": ""
}
}
]
}
El siguiente ejemplo muestra la especificación del esquema JSON que define la estructura de los datos JSON que se publican en el evento " inventorySnapshot ". Para solicitar la función Eventos de instantáneas de inventario V2 para una tienda, utilice la API Crear instantáneas de inventario programadas para las tiendas asociadas.
{
"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"
}
}
}
}
}
}
}
}