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.

You can request for the following snapshots:
Legacy events
  • Node availability snapshot (productAvailabilitySnapshot).
  • Distribution group availability snapshot (dgAvailabilitySnapshot).
For more information, see Legacy event formats.
New events
  • Product availability snapshot (productAvailabilitySnapshot.v2)
  • Distribution group availability snapshot (dgAvailabilitySnapshot.v2)
  • Supply snapshot (supplySnapshot)
  • Demand snapshot (demandSnapshot).
For information, see New snapshot event formats.
The event for snapshots differs from the availability change event to help the downstream systems in providing different handler logic.
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 snapshot API 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.
For example, if DistributionGroup1 consists of [Node1, Node2, Node3], then the node availability snapshot would publish node level events for all items in Node1, Node2, and Node3.
For more information, see Node availability snapshot event.
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 snapshot API by specifying the target distribution group.
For more information, see Distribution group availability snapshot event.
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).
For more information, see Product availability snapshot event.
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.
For more information, see Distribution group snapshot event.
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 snapshot API by specifying the target ship node, inventory type, and item.
For more information, see Trigger Supply Snapshot API and Supply snapshot event.
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 snapshot API by specifying the target ship node, inventory type, and item.
For more information, see Trigger Demand Snapshot API and Demand snapshot event.

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.

You can use the itemId, productClass and unitOfMeasure attributes as filtering options in both the V1 and V2 node and distribution group snapshots.
Note: The deliveryMethod attribute is only applicable for the V2 node and distribution group availability snapshots.
For example, you can filter the event snapshot to 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
Note: For compatibility with the earlier version, the V1 snapshot trigger API also supports the same item filter.
For more information, see IBM® Sterling Intelligent Promising APIs.

Handling of snapshot completion status

In the response payload of the snapshot request, you can use the 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.

At the end of the snapshot publishing, the inventory service publishes the end of file (EOF) event to signify that the specific 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.

Sample of the node availability snapshots.
{
  "shipNode": "Matrix-Store-001",
  "distributionGroupId": "US_Group",
  "suppressZeroQty": false,
  "considerEventThreshold": false
}