Inventory snapshots
The Inventory service provides an option to request publishing of inventory availability snapshot at both ship node and distribution group level.
The inventory snapshot provides the current inventory quantities of available items, safety, reserved, and shortage quantities at the time of publishing. When you request for the snapshot, the system publishes the availability for all combination of item and node to the downstream systems. For more information, see New event formats.
The snapshot event is almost identical to the productAvailablity and the
dgAvailabilityChange events. The key difference is that the snapshot can be
triggered only by the user while the availability change events are triggered based on the inventory
updates.
- Legacy events
- Node availability snapshot
(productAvailabilitySnapshot). - Distribution group availability snapshot (
dgAvailabilitySnapshot).
- Node availability snapshot
- New events
- Product availability snapshot
(productAvailabilitySnapshot.v2) - Distribution group availability snapshot
(dgAvailabilitySnapshot.v2) - Supply snapshot (
supplySnapshot) - Demand snapshot (
demandSnapshot).
- Product availability snapshot
- Legacy events
-
- Node availability snapshots
- Node availability snapshot enables the system to publish inventory picture in the context of a
ship node. You can initiate a snapshot by starting the
trigger node availability snapshotAPI by specifying the target ship node. Alternatively, you can also use the distribution group to enable all ship nodes of the target distribution group to receive availability snapshot events. - Distribution group availability snapshot
- The distribution group availability snapshot publishes the inventory picture in the context of a
distribution group, which is the availability picture for all items within a distribution group. To
initiate a snapshot, start the
trigger distribution group availability snapshotAPI by specifying the target distribution group.
- New events
-
- Product availability snapshot
- In the Trigger Node Availability by date V2 snapshot API, if items with zero supply and demand are not updated for a configurable period of days, they are removed from snapshots. You can configure the removal period by using the availability.removeZeroAvailabilityItemAfterDays Inventory tenant setting. This value must be between 30 and 7300 days (20 years) or set to 0 to disable this feature. The default value is 730 days (2 years).
- Distribution group snapshot
- In the Trigger Distribution Group Availability by Date V2
Snapshot API, the items with zero supply and demand are removed from snapshots if
they are not updated within a configurable time period. You can set this period using the
availability.removeZeroAvailabilityItemAfterDays Inventory tenant setting.
- The value must be between 30 and 7,300 days (up to 20 years), or 0 to disable the feature.
- The default value is 730 days equivalent to 2 years.
- Supply snapshot
- The supply snapshot enables you to export the current supply inventory picture in the context of
a ship node or distribution group, which is the supply picture for all items within a ship node or
distribution group. To initiate this snapshot, start the
PublishAll snapshotAPI by specifying the target ship node, inventory type, and item. - Demand snapshot
- The demand snapshot enables you to export the current demand inventory picture in the context of
a ship node or distribution group, which is the demand picture for all items within a ship node or
distribution group. You can initiate the snapshot by starting the
PublishAll snapshotAPI by specifying the target ship node, inventory type, and item.
Providing additional filtering criteria for snapshot
As described in the node and distribution group availability snapshot, you must define the ship node and distribution group in context. Given that the system publishes all items in the system, it might not be beneficial and might increase usage for downstream consumers.
itemId, productClass and
unitOfMeasure attributes as filtering options in both the V1 and V2 node and
distribution group snapshots.deliveryMethod attribute is only applicable
for the V2 node and distribution group availability snapshots.SKU1024 and the SHP delivery method as
follows:{
"shipNode": "Matrix-Store-001",
"distributionGroupId": "US_Group",
"itemId": [ "SKU1024"],
"productClass": [ "NEW"],
"unitOfMeasure": ["EACH"],
"deliveryMethod" : ["SHP"]
}Following are the V2 snapshot triggers.- v2/configuration/events/productAvailabilitySnapshot.v2/publish_all
- v2/configuration/events/dgAvailabilitySnapshot.v2/publish_all
Handling of snapshot completion status
JobId to
inquire the completion status."job": {
"href": "https://api.watsoncommerce.ibm.com/inventory/{tenantID}/v1/jobs/{jobID}"
}In V2, the downstream consumers can identify the snapshot events by its uniquely
generated snapshotId. For more information, see New event formats.
This unique identifier keeps track of the ongoing processing tasks.
snapshotId request is
completed. The EOF data consists of the snapshotId and the
tenantId.{
"type": "dgAvailabilitySnapshot",
"datacontenttype": "application/json",
"id": "736af2e8-86c0-3ccf-a134-79854ab0b6c6",
"specversion": "1.0",
"time": "2020-05-21T00:00:00.328Z",
"data": {
"snapshotId": "DGSnapshotTest01", //UUID
"tenantId": "tenant1"
}
}Considering event thresholds for snapshots
By default, the snapshot events include all items in the system. You might want to apply event threshold consideration for snapshot event to publish only those snapshots that are essential to downstream event consumers. For more information on setting up the event threshold see, Event thresholds.
When requesting for a snapshot at both node and distribution group level, you can activate the
event threshold consideration with considerEventThreshold=true flag. When
activated, the system considers the threshold level that is defined at tenant, item, node, and
distribution group level. This behavior is the same as availability change events.
As an added option, you can suppress event with zero quantity during snapshot request so the
downstream systems are not using resources by updating items that are not available. To suppress the
event, use suppressZeroQty=true flag. When enabled, all event with on-hand and
future availability with a value of zero is omitted.
{
"shipNode": "Matrix-Store-001",
"distributionGroupId": "US_Group",
"suppressZeroQty": false,
"considerEventThreshold": false
}