New event formats

Sterling Intelligent Promising introduces a new event format for inventory service. Going forward, any new events are delivered in the new format.

The following list mentions events delivered in the newer formats:

Change events

Whenever any change in inventory occurs, the following events are published to the specified endpoints.
Event ID in Inventory Visibility Event code in payload
Deprecated featureSupply.Change Deprecated featuresupplyChange
supplyChange.v2 supplyChange.v2
productAvailability.v2 productAvailability.v2
availableSupplyChange.v2 availableSupplyChange.v2
dgAvailabilityChange.v2 dgAvailabilityChange.v2
Demand.Change demandChange

Snapshot events

The following snapshot events allow you to publish the change event to external systems.
Event ID in Inventory Visibility Event code in payload
productAvailabilitySnapshot.v2 productAvailabilitySnapshot.v2
dgAvailabilitySnapshot.v2 dgAvailabilitySnapshot.v2
demandSnapshot demandSnapshot
supplySnapshot supplySnapshot
Note: For the supply and demand records prior to June 2024 and no delta adjustments made post June 2024, you need to sync them again to view those records in the snapshot events.
Deprecated featureSupply.Change
When the supply changes for an item, the Supply.Change event is triggered. The code for this event is supplyChange.
The following sample JSON is an example of a published Supply.Change event.
{
  "eventbatch":[
   {
     "channel":"Order Management",
     "identifiers":[],
     "events":[
    {
      "code": "supplyChange",
      "timestamp": "2020-01-18T06:00:00.021Z",
      "attributes": [
          { "name":"tenantId", "type":"String", "value":"tenant1" },
          { "name":"productID", "type":"String", "value":"SKU1024" },
          { "name":"unitOfMeasure", "type":"String", "value":"EACH" },
          { "name":"productClass", "type":"String", "value":"NEW" },
          { "name":"shipNode", "type":"String", "value":"Matrix-Store-001" },
          { "name":"shipByDate", "type":"dateTime", "value":"2500-01-01T00:00:00.000Z" },
          { "name":"lineReference", "type":"String", "value":"" },
          { "name":"reference", "type":"String", "value":"" },
          { "name":"referenceType", "type":"String", "value":"" },
          { "name":"segment", "type":"String", "value":"" },
          { "name":"segmentType", "type":"String", "value":"" },
          { "name":"quantity", "type":"Number", "value":"1.0" },
          { "name":"changedQuantity", "type":"Number", "value":"1.0" },
          { "name":"type", "type":"String", "value":"ONHAND_BACKROOM_01" },
          { "name":"baseType", "type":"String", "value":"ONHAND" },
          { "name":"tagNumber", "type":"String", "value":"|||" },
          { "name":"updatedTs", "type":"dateTime", "value":"IGNORE_VALUE" },
          { "name":"eta", "type":"dateTime", "value":"1900-01-01T00:00:00.000Z" },
          { "name":"adjustmentReason", "type":"String", "value":"ADJUSTMENT"},
        ]
        },
    {
      "code":"supplyChange",
      "timestamp":"2020-01-03T15:48:02Z",
      "attributes":[
          { "name":"tenantId", "value":"tenant1", "type":"String"},
          { "name":"productID", "value":"SKU1024", "type":"String"},
          { "name":"unitOfMeasure", "value":"EACH", "type":"String"},
          { "name":"productClass", "value":"NEW", "type":"String"},
          { "name":"lineReference", "value":" ", "type":"String"},
          { "name":"shipNode", "value":"Matrix-Store-002", "type":"String"},
          { "name":"shipByDate", "value":"2500-01-01T00:00:00Z", "type":"dateTime"},
          { "name":"reference", "value":" ", "type":"String"},
          { "name":"referenceType", "value":" ", "type":"String"},
          { "name":"quantity", "value":"200.0", "type":"Number"},
          { "name":"segment", "value":" ", "type":"String"},
          { "name":"segmentType", "value":" ", "type":"String"},
          { "name":"type", "type":"String", "value":"ONHAND_BACKROOM_01" },
          { "name":"baseType", "type":"String", "value":"ONHAND" },
          { "name":"tagNumber", "type":"String", "value":"|||" },
          { "name":"updatedTs", "value":"2020-01-03T15:47:48Z", "type":"dateTime"},
          { "name":"eta", "value":"1900-01-01T00:00:00Z", "type":"dateTime"},
          { "name":"adjustmentReason", "type":"String", "value":"ADJUSTMENT"},
        ]}
     ]
  }]
}
The updatedTs field indicates the time when the database was updated for this supply. If no database record is present, then it is null during the forcePublish. By default when a supply sync is performed, the supply change event is published only for those records that must be upserted as part of the supply sync. However, when forcePublish is passed as true in a supply sync, an event is published for every supply record that is part of supply sync. This, in turn, publishes node and network availability change events as well, regardless of change in availability due to incoming supply record. If a supply record is not present in the system and is ignored as part of the sync process, then updatedTs is null for this record's event.
Note: This parameter is applicable in productAvailability.v2, availableSupplyChange.v2, dgAvailabilityChange.v2.
supplyChange.v2
When the supply changes for an item, the supplyChange.v2 event is triggered. The code for this event is supplyChange.v2.
The following sample JSON is an example of a published supplyChange.v2 event.
{
  "type": "supplyChange.v2",
  "datacontenttype": "application/json",
  "id": "2a8d36a3-485b-3fc0-bd15-d530625a6ec5",
  "specversion": "1.0",
  "time": "2023-08-30T10:20:31.102Z",
  "data": {
      "tenantId": "tenant1",
      "itemId": "SKU1024",
      "unitOfMeasure": "EACH",
      "productClass": "NEW",
      "shipNode": "Matrix-Store-001"
      "shipByDate": "2500-01-01T00:00:00.000Z",
      "lineReference":null,
      "reference":null,
      "referenceType":null,
      "segment": null,
      "segmentType": null,
      "quantity": 1,
      "changedQuantity": 1,
      "customAttributes" : [ {
         "double" : 10.1,
         "key" : "futureQuantity"
      }, {
         "key" : "adjustmentReasonText",
         "string" : "returnDamaged"
      }, {
         "date" : "2023-01-01T00:00:00.000Z",
         "key" : "manufacturingDate"
     }],
      "type": "ONHAND_BACKROOM_01",
      "baseType": "ONHAND",
      "tagNumber": "|||",
      "updatedTs": "2023-08-30T10:20:31.102Z",
      "eta": "1900-01-01T00:00:00.000Z",
      "adjustmentReason": "ADJUSTMENT",
  }
}
The updatedTs field indicates the time when the database was updated for this supply. If no database record is present, then it is null during the forcePublish. By default when a supply sync is performed, the supply change event is published only for those records that must be upserted as part of the supply sync. However, when forcePublish is passed as true in a supply sync, an event is published for every supply record that is part of supply sync. This, in turn, publishes node and network availability change events as well, regardless of change in availability due to incoming supply record. If a supply record is not present in the system and is ignored as part of the sync process, then updatedTs is null for this record's event.
productAvailability.v2
Node availability in productAvailability.v2 events is published per item-node basis whenever there is a change in available quantity. The change may be triggered in case of updates in supply, demand, safety stock, fulfillment option, and capacity levels.
The following sample JSON is an example of a published event for SHP and PICK delivery method.
  • SHP delivery method
    {
      "type": "productAvailability.v2",
      "datacontenttype": "application/json",
      "id": "2a8d36a3-485b-3fc0-bd15-d530625a6ec5",
      "specversion": "1.0",
      "time": "2021-03-10T00:00:00.288Z",
      "data": {
      "itemAttributes" : 
      {
          "color": ["red", "black"],
          "material": ["cotton"],
          "size": ["L", "M"]
      },
      "computeTs": "2021-03-10T00:00:00.097Z",
      "tenantId": "tenant1",
      "productId": "SHIRT",
      "productClass": "CLASS_1",
      "deliveryMethod": "SHP",
      "segment": null,
      "segmentType": null,
      "shipNode": "store-BostonMA",
      "unitOfMeasure": "EACH",
      "currentAvailability": {
         "demandQuantity": 0,
         "supplyQuantity": 5,
         "toTs": "2021-04-01T00:00:00.000Z",
         "availableQuantity": 35,
         "consumedSafetyQuantity": 0,
         "fulfillmentAllowed": true,
         "reservedQuantity": 0,
         "shortageQuantity": 0,
         "thresholdLevel": 0,
         "demandShortage": 0,
         "reservationShortage":0,
         "safetyShortage":0,
         "segmentedQuantity": 5.0,
         "unsegmentedQuantity": 25.0,
         "consumptionDemandQuantity" : 0.0,
         "consumptionReservedQuantity" : 0.0
         "unplanned": {
           "availableQuantity": 5.0,
           "demandQuantity": 3.0,
           "reserveQuantity": 2.0
           }
      },
      "futureAvailability": [
      {
         "demandQuantity": 0,
         "supplyQuantity": 5,
         "fromTs": "2021-04-01T00:00:00.000Z",
         "toTs": "2500-01-01T00:00:00.000Z",
         "availableQuantity": 45,
         "consumedSafetyQuantity": 0,
         "fulfillmentAllowed": true,
         "reservedQuantity": 0,
         "shortageQuantity": 0,
         "demandShortage": 0,
         "reservationShortage":0,
         "safetyShortage":0,
         "segmentedQuantity": 5.0,
         "unsegmentedQuantity": 35.0,
         "consumptionDemandQuantity" : 0.0,
         "consumptionReservedQuantity" : 0.0,  
         "unplanned": {
           "availableQuantity": 5.0,
           "demandQuantity": 3.0,
           "reserveQuantity": 2.0
           }
         }
       ]
     }
    }
  • PICK delivery method
    {
      "type": "productAvailability.v2",
      "datacontenttype": "application/json",
      "id": "2a8d36a3-485b-3fc0-bd15-d530625a6ed6",
      "specversion": "1.0",
      "time": "2021-03-10T00:00:00.288Z",
      "data": {
      "itemAttributes" : 
      {
          "color": ["red", "black"],
          "material": ["cotton"],
          "size": ["L", "M"]
      },
      "computeTs": "2021-03-10T00:00:00.097Z",
      "tenantId": "tenant1",
      "productId": "SHIRT",
      "productClass": "CLASS_1",
      "deliveryMethod": "PICK",
      "segment": null,
      "segmentType": null,
      "shipNode": "store-BostonMA",
      "unitOfMeasure": "EACH",
      "currentAvailability": {
         "demandQuantity": 0,
         "supplyQuantity": 5,
         "toTs": "2021-04-01T00:00:00.000Z",
         "availableQuantity": 35,
         "consumedSafetyQuantity": 0,
         "fulfillmentAllowed": true,
         "reservedQuantity": 0,
         "shortageQuantity": 0,
         "thresholdLevel": 0,
         "demandShortage": 0,
         "reservationShortage":0,
         "safetyShortage":0,
         "segmentedQuantity": 5.0,
         "unsegmentedQuantity": 25.0,
         "consumptionDemandQuantity" : 0.0,
         "consumptionReservedQuantity" : 0.0,
         "unplanned": {
           "availableQuantity": 5.0,
           "demandQuantity": 3.0,
           "reserveQuantity": 2.0
           }
      },
      "futureAvailability": [
      {
         "demandQuantity": 0,
         "supplyQuantity": 5,
         "fromTs": "2021-04-01T00:00:00.000Z",
         "toTs": "2500-01-01T00:00:00.000Z",
         "availableQuantity": 45,
         "consumedSafetyQuantity": 0,
         "fulfillmentAllowed": true,
         "reservedQuantity": 0,
         "shortageQuantity": 0,
         "demandShortage": 0,
         "reservationShortage":0,
         "safetyShortage":0,
         "segmentedQuantity": 5.0,
         "unsegmentedQuantity": 35.0,
         "consumptionDemandQuantity" : 0.0,
         "consumptionReservedQuantity" : 0.0,
         "unplanned": {
           "availableQuantity": 5.0,
           "demandQuantity": 3.0,
           "reserveQuantity": 2.0
           }
        }
       ]
     }
    }
Note:
  • The shortageQuantity is the shortage generated in the system because of excess demand, excess reservation, and excess safety stock.
  • The consumedSafetyQuantity is the safety quantity that got adjusted with the availability in hand.
  • The fulfillmentAllowed field mentions whether fulfillment is allowed or not.
  • demandShortage gives the excess demand quantity that could not get adjusted with supply.
  • reservationShortage gives the value of any excess in reservation.
  • safetyShortage gives the safety stock quantity that could not get adjusted with available supplies and
  • shortageQuantity = demandShortage + reservationShortage + safetyShortage.
  • SegmentedQuantity is the availability coming from segmented inventory. It is calculated only when segment consumes unsegmented inventory and is 0.0 if event shows unsegmented availability.
  • UnsegmentedQuantity is the availability coming from unsegmented inventory. It is calculated only when segment consumes unsegmented inventory.
  • When the event is published for unsegmented availability, consider the following parameters for calculation:
    • consumptionDemandQuantity is the additional segmented demand quantity allocated to unsegmented availability. This is calculated only when consumption is enabled and event is raised for unsegmented inventory.
    • consumptionReservedQuantity is the additional segmented reservation quantity placed with unsegmented availability. This is calculated only when consumption is enabled and event is raised for unsegmented inventory.
  • The unplanned quantities in currentAvailability indicate overselling of existing stock, while those in futureAvailability imply that supplier backfilling is required.
When fulfillment is off either at node or item level, the availability change events are not raised with any inventory related activity like supply and demand. If there is a need to receive the events even when fulfillment is disabled, then the tenant based rule event.alwaysPublishEventForDelMethod should be set with required delivery methods as comma separated list. By default, this rule is empty. You can use the Update settings API to modify this rule.

For more information, see Update settings API.

Note: The node availability change events for specified delivery methods is raised when above rule is set and fulfillment is disabled at node or item level. This is applicable to productAvailability.v2 events.
availableSupplyChange.v2
The availableSupplyChange.v2 event provides the availability picture based on supply dates when there are changes happen in supply, demand, reservation, or safety stock. The code for this event is availableSupplyChange.v2. The trigger point of the availableSupplyChange.v2 event is same as that of productavailability.v2.

For more information, see Node available supplies.

The following sample JSON is an example of a published event for SHP and PICK delivery method.
  • SHP delivery method
    {
       "specversion": "1.0",
       "type": "availableSupplyChange.v2",
       "id": "515aa404-4411-38d8-9855-b6ab093a451e",
       "time": "2023-12-05T23:35:56.616Z",
       "datacontenttype": "application/json",
       "data":{
          "tenantId":"us-b5d0aae5",
          "productId":"SHIRT",
          "segment":null,
          "segmentType":null,
          "unitOfMeasure":"EACH",
          "productClass":"NEW",
          "deliveryMethod":"SHP",
          "shipNode": "store-BostonMA",
          "computeTs": "2023-12-05T23:35:56.584Z",
          "thresholdLevel": "0",
          "availableSupplies":[{
             "availableQuantity" : 8.0,
             "consumedSafetyQuantity" : 0.0,
             "demandQuantity" : 4.0,
             "fromTs" : "2023-12-01T00:00:00.000Z",
             "fulfillmentAllowed" : true,
             "reservedQuantity" : 0.0,
             "shortageQuantity" : 0.0,
             "supplyQuantity" : 12.0,
             "toTs" : "2023-12-30T00:00:01.000Z",
             "demandShortage": 0,
             "reservationShortage":0,
             "safetyShortage":0
          }, 
       {
          "availableQuantity" : 15.0,
          "consumedSafetyQuantity" : 0.0,
          "demandQuantity" : 0.0,
          "fromTs" : "2023-12-10T00:00:00.000Z",
          "fulfillmentAllowed" : true,
          "reservedQuantity" : 0.0,
          "shortageQuantity" : 0.0,
          "supplyQuantity" : 10.0,
          "toTs" : "2024-01-10T00:00:01.000Z",
          "demandShortage": 0,
          "reservationShortage":0,
          "safetyShortage":0,
       }],
       "unsegmentedAvailableSupplies":[{ 
          "availableQuantity" : 90.0,
          "consumedSafetyQuantity" : 0.0,
          "demandQuantity" : 0.0,
          "fromTs" : "1900-01-01T00:00:00.000Z",
          "fulfillmentAllowed" : true,
          "reservedQuantity" : 0.0,
          "shortageQuantity" : 0.0,
          "supplyQuantity" : 90.0,
          "toTs" : "2500-01-01T00:00:00.000Z",
          "demandShortage": 0,
          "reservationShortage":0,
          "safetyShortage":0,
          "consumptionDemandQuantity" : 0.0,
          "consumptionReservedQuantity" : 0.0
       }],
       "itemAttributes" : 
       {
          "color": ["red", "black"],
          "material": ["cotton"],
          "size": ["L", "M"]
        }
      }
    }
  • PICK delivery method
    {
       "specversion": "1.0",
       "type": "availableSupplyChange.v2",
       "id": "515aa404-4411-38d8-9855-b6ab093a462f",
       "time": "2023-12-05T23:35:56.616Z",
       "datacontenttype": "application/json",
       "data":{
          "tenantId":"us-b5d0aae5",
          "productId":"SHIRT",
          "segment":null,
          "segmentType":null,
          "unitOfMeasure":"EACH",
          "productClass":"NEW",
          "deliveryMethod":"PICK",
          "shipNode": "store-BostonMA",
          "computeTs": "2023-12-05T23:35:56.584Z",
          "thresholdLevel": "0",
          "availableSupplies":[{
             "availableQuantity" : 13.0,
             "consumedSafetyQuantity" : 0.0,
             "demandQuantity" : 4.0,
             "fromTs" : "2023-12-01T00:00:00.000Z",
             "fulfillmentAllowed" : true,
             "reservedQuantity" : 0.0,
             "shortageQuantity" : 0.0,
             "supplyQuantity" : 12.0,
             "toTs" : "2023-12-30T00:00:01.000Z",
             "demandShortage": 0,
             "reservationShortage":0,
             "safetyShortage":0,
          }, 
       {
          "availableQuantity" : 10.0,
          "consumedSafetyQuantity" : 0.0,
          "demandQuantity" : 0.0,
          "fromTs" : "2023-12-10T00:00:00.000Z",
          "fulfillmentAllowed" : true,
          "reservedQuantity" : 0.0,
          "shortageQuantity" : 0.0,
          "supplyQuantity" : 10.0,
          "toTs" : "2024-01-10T00:00:01.000Z",
          "demandShortage": 0,
          "reservationShortage":0,
          "safetyShortage":0
       }],
       "unsegmentedAvailableSupplies":[{ 
          "availableQuantity" : 90.0,
          "consumedSafetyQuantity" : 0.0,
          "demandQuantity" : 0.0,
          "fromTs" : "1900-01-01T00:00:00.000Z",
          "fulfillmentAllowed" : true,
          "reservedQuantity" : 0.0,
          "shortageQuantity" : 0.0,
          "supplyQuantity" : 90.0,
          "toTs" : "2500-01-01T00:00:00.000Z",
          "demandShortage": 0,
          "reservationShortage":0,
          "safetyShortage":0,
          "consumptionDemandQuantity" : 0.0,
          "consumptionReservedQuantity" : 0.0
       }],
       "itemAttributes" : 
       {
          "color": ["red", "black"],
          "material": ["cotton"],
          "size": ["L", "M"]
        }
      }
    }
When fulfillment is off either at node or item level, the availability change events are not raised with any inventory related activity like supply and demand. If there is a need to receive the events even when fulfillment is disabled, then the tenant based rule event.alwaysPublishEventForDelMethod should be set with required delivery methods as comma separated list. By default, this rule is empty. You can use the Update settings API to modify this rule.

For more information, see Update settings API.

Note: The node availability change events for specified delivery methods is raised when above rule is set and fulfillment is disabled at node or item level. This is applicable to availableSupplyChange.v2 events.
dgAvailabilityChange.v2
dgAvailabilityChange.v2 events represent the overall network availability for a distribution group. A new event is published whenever one or more contained nodes experience a change in availability quantity or timestamp. These changes can be triggered by updates in supply, demand, safety stock, fulfillment options, or capacity levels.
The following sample JSON is an example of a published event for SHP and PICK delivery method.
  • SHP delivery method
    {
      "type": "dgAvailabilityChange.v2",
      "datacontenttype": "application/json",
      "id": "304746ba-4d53-3514-94d9-9353b8b14152",
      "specversion": "1.0",
      "time": "2021-03-10T00:00:00.283Z",
      "data": {
      "itemAttributes" : 
      {
         "color": ["red", "black"],
         "material": ["cotton"],
         "size": ["L", "M"]
      },
      "computeTs": "2021-03-10T00:00:00.119Z",
      "tenantId": "tenant1",
      "productId": "SHIRT",
      "productClass": "CLASS_1",
      "deliveryMethod": "SHP",
      "segment" : "Platinum",
      "segmentType" : "B2B Accounts",
      "distributionGroupId": "WEB",
      "unitOfMeasure": "EACH",
      "currentAvailability": {
         "toTs": "2021-04-01T00:00:00.000Z",
         "availableQuantity": 35,
         "consumedSafetyQuantity": 0,
         "fulfillmentAllowed": true,
         "reservedQuantity": 0,
         "shortageQuantity": 0,
         "thresholdLevel": 0,
         "demandShortage": 0,
         "reservationShortage": 0,
         "safetyShortage":0,
         "segmentedQuantity": 20.0,
         "unsegmentedQuantity": 10.0,
         "consumptionDemandQuantity" : 0.0,
         "consumptionReservedQuantity" : 0.0,
         "unplanned": {
           "availableQuantity": 5.0,
           "demandQuantity": 3.0,
           "reserveQuantity": 2.0
           }
        },
        "futureAvailability": [
        {
           "fromTs": "2021-04-01T00:00:00.000Z",
           "toTs": "2500-01-01T00:00:00.000Z",
           "availableQuantity": 45,
           "consumedSafetyQuantity": 0,
           "fulfillmentAllowed": true,
           "reservedQuantity": 0,
           "shortageQuantity": 0,
           "demandShortage": 0,
           "reservationShortage":0,
           "safetyShortage":0,
           "segmentedQuantity": 5.0,
           "unsegmentedQuantity": 35.0,
           "consumptionDemandQuantity" : 0.0,
           "consumptionReservedQuantity" : 0.0
           "unplanned": {
             "availableQuantity": 5.0,
             "demandQuantity": 3.0,
             "reserveQuantity": 2.0
             }
           }
        ]
      }
    }
  • PICK delivery method
    {
      "type": "dgAvailabilityChange.v2",
      "datacontenttype": "application/json",
      "id": "515aa404-4411-38d8-9855-b6ab093a46df",
      "specversion": "1.0",
      "time": "2021-03-10T00:00:00.283Z",
      "data": {
        "itemAttributes" :
        {
          "color": ["red", "black"],
          "material": ["cotton"],
          "size": ["L", "M"]
        },
      "computeTs": "2021-03-10T00:00:00.119Z",
      "tenantId": "tenant1",
      "productId": "SHIRT",
      "productClass": "CLASS_1",
      "deliveryMethod": "PICK",
      "segment": null,
      "segmentType": null,
      "distributionGroupId": "WEB",
      "unitOfMeasure": "EACH",
      "currentAvailability": {
         "toTs": "2021-04-01T00:00:00.000Z",
         "availableQuantity": 35,
         "consumedSafetyQuantity": 0,
         "fulfillmentAllowed": true,
         "reservedQuantity": 0,
         "shortageQuantity": 0,
         "thresholdLevel": 0,
         "demandShortage": 0,
         "reservationShortage":0,
         "safetyShortage":0,
         "segmentedQuantity": 5.0,
         "unsegmentedQuantity": 25.0,
         "consumptionDemandQuantity" : 0.0,
         "consumptionReservedQuantity" : 0.0,
         "unplanned": {
           "availableQuantity": 5.0,
           "demandQuantity": 3.0,
           "reserveQuantity": 2.0
           }
         },
         "futureAvailability": [
         {
           "fromTs": "2021-04-01T00:00:00.000Z",
           "toTs": "2500-01-01T00:00:00.000Z",
           "availableQuantity": 45,
           "consumedSafetyQuantity": 0,
           "fulfillmentAllowed": true,
           "reservedQuantity": 0,
           "shortageQuantity": 0,
           "demandShortage": 0,
           "reservationShortage":0,
           "safetyShortage":0,
           "segmentedQuantity": 20.0,
           "unsegmentedQuantity": 20.0,
           "consumptionDemandQuantity" : 0.0,
           "consumptionReservedQuantity" : 0.0
           "unplanned": {
             "availableQuantity": 5.0,
             "demandQuantity": 3.0,
             "reserveQuantity": 2.0
             }
           }
        ]
      }
    }
Note: The shortageQuantity attribute represents the aggregation of node-level shortage quantities across all nodes of the distribution group. For more information, see definitions for shortageQuantity, consumedSafetyQuantity, and fulfillmentAllowed.
Demand.Change
The inventory service allows you to publish the demand change data to an external system for analytics. Such data enables the supply chain (SC) manager to be alerted when there is a sudden flux of inventory demand. For example, if there is a sudden hand sanitizer demand spike, the SC manager can quickly alter the fulfillment strategy to mitigate contractual damage to some of the high valued buyers.

The following sample payload is an example of a published event. The Inventory Visibility event ID is Demand.Change and event code in payload is demandChange.

{
    "specversion" : "1.0",
    "datacontenttype" : "application/json",
    "type": "demandChange",
    "id": "<UUID>",
    "time": "<time ISO-8601 format>",
    "data": {
        "itemId": "SHIRT",
        "unitOfMeasure": "EACH",
        "productClass": "CLASS_1",
        "tagNumber": "A|02",
        "shipNode": "store-BostonMA",
        "baseType": "OPEN_ORDER",
        "type": "CUSTOM_OPEN_ORDER",
        "segment": "Web",
        "segmentType": "Channel",
        "shipDate": "2020-05-29T13:00:00.000Z",
        "cancelDate": "2020-06-28T13:00:00.000Z",
        "minShipByDate": "2022-01-22T05:00:00.000Z",
        "quantity": 3.0,
        "changedQuantity": 2.0,
        "updatedTs": "2020-05-28T06:00:00.000Z",
        "adjustmentReason" : "PROCESS"
    }
}
Note: The updatedTs field indicates the time when the database was updated for this demand.
productAvailabilitySnapshot.v2
Use the productAvailabilitySnapshot.v2 event to send a snapshot (on demand) of availability for a specific node, all nodes, or nodes that belong to a distribution group.
The following sample JSON is an example of a published event for SHP and PICK delivery method.
  • SHP delivery method
    {
      "type": "productAvailabilitySnapshot.v2",
      "datacontenttype": "application/json",
      "id": "2a8d36a3-485b-3fc0-bd15-d530625a6ec5",
      "specversion": "1.0",
      "time": "2021-03-10T00:00:00.288Z",
      "data": {
        "computeTs": "2021-03-10T00:00:00.097Z",
        "tenantId": "tenant1",
        "snapshotId": "productAvailabilitySnapshot-test",
        "productId": "SHIRT",
        "productClass": "CLASS_1",
        "deliveryMethod": "SHP",
        "segment": null,
        "segmentType": null,
        "shipNode": "store-BostonMA",
        "unitOfMeasure": "EACH",
        "currentAvailability": {
          "demandQuantity": 0,
          "supplyQuantity": 30,
          "toTs": "2021-04-01T00:00:00.000Z",
          "availableQuantity": 35,
          "consumedSafetyQuantity": 0,
          "fulfillmentAllowed": true,
          "reservedQuantity": 0,
          "shortageQuantity": 0,
          "thresholdLevel": 0,
          "demandShortage": 0,
          "reservationShortage":0,
          "safetyShortage":0,
          "segmentedQuantity": 20.0,
          "unsegmentedQuantity": 10.0,
          "consumptionDemandQuantity" : 0.0,
          "consumptionReservedQuantity" : 0.0,
          "unplanned": {
             "availableQuantity": 5.0,
             "demandQuantity": 3.0,
             "reserveQuantity": 2.0
             }
    
        },
        "futureAvailability": [
        {
          "demandQuantity": 0,
          "supplyQuantity": 45,
          "fromTs": "2021-04-01T00:00:00.000Z",
          "toTs": "2500-01-01T00:00:00.000Z",
          "availableQuantity": 40,
          "consumedSafetyQuantity": 0,
          "fulfillmentAllowed": true,
          "reservedQuantity": 0,
          "shortageQuantity": 0,
          "demandShortage": 0,
          "reservationShortage":0,
          "safetyShortage":0,
          "segmentedQuantity": 20.0,
          "unsegmentedQuantity": 20.0,
          "consumptionDemandQuantity" : 0.0,
          "consumptionReservedQuantity" : 0.0
          "unplanned": {
             "availableQuantity": 5.0,
             "demandQuantity": 3.0,
             "reserveQuantity": 2.0
             }
           }
         ]
      }
    }
  • PICK delivery method
    {
      "type": "productAvailabilitySnapshot.v2",
      "datacontenttype": "application/json",
      "id": "2a8d36a3-485b-3fc0-be26-d530625a6ec5",
      "specversion": "1.0",
      "time": "2021-03-10T00:00:00.288Z",
      "data": {
        "computeTs": "2021-03-10T00:00:00.097Z",
        "tenantId": "tenant1",
        "snapshotId": "productAvailabilitySnapshot-test",
        "productId": "SHIRT",
        "productClass": "CLASS_1",
        "deliveryMethod": "PICK",
        "segment": null,
        "segmentType": null,
        "shipNode": "store-BostonMA",
        "unitOfMeasure": "EACH",
        "currentAvailability": {
          "demandQuantity": 0,
          "supplyQuantity": 30,
          "toTs": "2021-04-01T00:00:00.000Z",
          "availableQuantity": 30,
          "consumedSafetyQuantity": 0,
          "fulfillmentAllowed": true,
          "reservedQuantity": 0,
          "shortageQuantity": 0,
          "thresholdLevel": 0,
          "demandShortage": 0,
          "reservationShortage":0,
          "safetyShortage":0,
          "segmentedQuantity": 20.0,
          "unsegmentedQuantity": 10.0,
          "consumptionDemandQuantity" : 0.0,
          "consumptionReservedQuantity" : 0.0
        },
        "futureAvailability": [
        {
          "demandQuantity": 0,
          "supplyQuantity": 40,
          "fromTs": "2021-04-01T00:00:00.000Z",
          "toTs": "2500-01-01T00:00:00.000Z",
          "availableQuantity": 40,
          "consumedSafetyQuantity": 0,
          "fulfillmentAllowed": true,
          "reservedQuantity": 0,
          "shortageQuantity": 0,
          "demandShortage": 0,
          "reservationShortage":0,
          "safetyShortage":0,
          "segmentedQuantity": 20.0,
          "unsegmentedQuantity": 20.0,
          "consumptionDemandQuantity" : 0.0,
          "consumptionReservedQuantity" : 0.0
          "unplanned": {
            "availableQuantity": 5.0,
            "demandQuantity": 3.0,
            "reserveQuantity": 2.0
            }
          }
        ]
      }
    }
The following EOF sample is an example of a published event:
{
  "type": "productAvailabilitySnapshot.v2",
  "datacontenttype": "application/json",
  "id": "2a8d36a3-485b-3fc0-be26-d530625a6ec5",
  "specversion": "1.0",
  "time": "2021-03-10T00:00:00.288Z",
  "data": {
    "tenantId": "tenant1", 
    "snapshotId": "productAvailabilitySnapshot-test",
  }
}
You can manually trigger the snapshot for a specific node by calling the publish_all API. The productAvailabilitySnapshot.v2 publish_all API returns a job URL along with the jobId. It also publishes a dummy event when the process is complete, which has the same format as the normal message, but it omits all attributes other than tenantId and snapshotId. The snapshotId is a UUID to recognize the event. The URL for productAvailabilitySnapshot.v2 is:
https://api.watsoncommerce.ibm.com/<tenantId>/v2/configuration/events/productAvailabilitySnapshot.v2/publish_all
Note:
dgAvailabilitySnapshot.v2
Use the dgAvailabilitySnapshot.v2 event to send a snapshot (on demand) of availability to a distribution group.
The following sample JSON is an example of a published event for SHP and PICK delivery method.
  • SHP delivery method
    {
       "type": "dgAvailabilitySnapshot.v2",
       "datacontenttype": "application/json",
       "id": "240fe0ec-e24a-31c2-93a0-74cb8160aa98",
       "specversion": "1.0",
       "time": "2021-07-17T00:00:00.503Z",
       "data": {
         "computeTs": "2021-07-17T00:00:00.174Z",
         "tenantId": "tenant1",
         "productClass": "NEW",
         "productId": "book",
         "snapshotId": "dgAvailabilitySnapshot-test",
         "unitOfMeasure": "EACH",
         "deliveryMethod": "SHP",
         "segment": null,
         "segmentType": null,
         Deprecated feature"distributionGroup": "Stores",
         "distributionGroupId": "Stores",
         "currentAvailability": {
           "availableQuantity": 5,
           "consumedSafetyQuantity": 0,
           "fulfillmentAllowed": true,
           "reservedQuantity": 0,
           "shortageQuantity": 0,
           "thresholdLevel": 3,
           "toTs": "2021-07-20T00:00:00.000Z",
           "demandShortage": 0,
           "reservationShortage":0,
           "safetyShortage":0,         
           "segmentedQuantity": 0.0,
           "unsegmentedQuantity": 0.0,
           "consumptionDemandQuantity" : 0.0,
           "consumptionReservedQuantity" : 0.0,
           "unplanned": {
             "availableQuantity": 5.0,
             "demandQuantity": 3.0,
             "reserveQuantity": 2.0
           }
         },
         "futureAvailability": [
           {
             "availableQuantity": 15,
             "consumedSafetyQuantity": 0,
             "fromTs": "2021-07-20T00:00:00.000Z",
             "fulfillmentAllowed": true,
             "reservedQuantity": 0,
             "shortageQuantity": 0,
             "toTs": "2021-08-16T00:00:01.000Z",
             "demandShortage": 0,
             "reservationShortage":0,
             "safetyShortage":0,
             "segmentedQuantity": 5.0,
             "unsegmentedQuantity": 5.0,
             "consumptionDemandQuantity" : 0.0,
             "consumptionReservedQuantity" : 0.0
             "unplanned": {
               "availableQuantity": 5.0,
               "demandQuantity": 3.0,
               "reserveQuantity": 2.0
               }
             }
          ]
       } 
     }
  • PICK delivery method
    {
       "type": "dgAvailabilitySnapshot.v2",
       "datacontenttype": "application/json",
       "id": "240fe0ec-e24a-31c2-93a0-74cb8160bb00",
       "specversion": "1.0",
       "time": "2021-07-17T00:00:00.503Z",
       "data": {
         "computeTs": "2021-07-17T00:00:00.174Z",
         "tenantId": "tenant1",
         "productClass": "NEW",
         "productId": "book",
         "snapshotId": "dgAvailabilitySnapshot-test",
         "unitOfMeasure": "EACH",
         "deliveryMethod": "PICK",
         "segment": null,
         "segmentType": null,
         Deprecated feature"distributionGroup": "Stores",
         "distributionGroupId": "Stores",
         "currentAvailability": {
           "availableQuantity": 5,
           "consumedSafetyQuantity": 0,
           "fulfillmentAllowed": true,
           "reservedQuantity": 0,
           "shortageQuantity": 0,
           "thresholdLevel": 3,
           "toTs": "2021-07-20T00:00:00.000Z",
           "demandShortage": 0,
           "reservationShortage":0,
           "safetyShortage":0,
           "segmentedQuantity": 0.0,
           "unsegmentedQuantity": 0.0,
           "consumptionDemandQuantity" : 0.0,
           "consumptionReservedQuantity" : 0.0,
           "unplanned": {
              "availableQuantity": 5.0,
              "demandQuantity": 3.0,
              "reserveQuantity": 2.0
           }
         },
         "futureAvailability": [
           {
             "availableQuantity": 15,
             "consumedSafetyQuantity": 0,
             "fromTs": "2021-07-20T00:00:00.000Z",
             "fulfillmentAllowed": true,
             "reservedQuantity": 0,
             "shortageQuantity": 0,
             "toTs": "2021-08-16T00:00:01.000Z",
             "demandShortage": 0,
             "reservationShortage":0,
             "safetyShortage":0,
             "segmentedQuantity": 5.0,
             "unsegmentedQuantity": 5.0,
             "consumptionDemandQuantity" : 0.0,
             "consumptionReservedQuantity" : 0.0
             "unplanned": {
                "availableQuantity": 5.0,
                "demandQuantity": 3.0,
                "reserveQuantity": 2.0
                }
             }
          ]
       } 
     }
Note:
  • The shortageQuantity attribute represents the aggregation of node-level shortage quantities across all nodes of the distribution group.
  • The distributionGroup attribute is deprecated and will be removed in a subsequent release of the product. Instead, use the distributionGroupId attribute.
For more information, see definitions for shortageQuantity, consumedSafetyQuantity, and fulfillmentAllowed.
The following EOF sample is an example of a published event:
{
    "type": "dgAvailabilitySnapshot.v2",
    "datacontenttype": "application/json",
    "id": "2a8d36a3-485b-3fc0-bd15-d530625a6ec5",
    "specversion": "1.0",
    "time": "2021-03-10T00:00:00.288Z",
    "data": {
      "tenantId": "tenant1",
      "snapshotId": "dgAvailabilitySnapshot-test"
    }
}
You can manually trigger the snapshot for a specific distribution group by calling the publish_all API. The dgAvailabilitySnapshot.v2 publish_all API returns a job URL along with the jobId. It also publishes a dummy event when the process is complete, which has the same format as the normal message, but it omits all attributes other than tenantId and snapshotId. You can generate a snapshot for a specific distribution group or all of them. The URL for dgAvailabilitySnapshot.v2 is:
https://api.watsoncommerce.ibm.com/<tenantId>v2/configuration/events/dgAvailabilitySnapshot.v2/publish_all
demandSnapshot

As a System Integrator in Inventory Visibility, you publish a snapshot of the demand system for analysis. As a Fulfillment Manager, you use this information to report on the demand system and troubleshoot any issues found in advance of the next financial cycle. For example, as a result of a product promotion that you ran, there is an ongoing spike in demand for the product at a specific node. As a result to meet this increased demand, you must increase the supply available at the location to avoid any customers missing the product. With complete visibility of the demand system, you continue to meet your customer demand.

The following sample JSON is an example of a published event. The event code is demandSnapshot.

{
  "type": "demandSnapshot",
  "datacontenttype": "application/json",
  "id": "a1ae3dcd-8fd6-4f76-b7ed-7916c739ac5a",
  "specversion": "1.0",
  "time": "2023-11-28T00:00:00.000Z",
  "data": {
    "fetchTs": "2023-11-28T00:00:00.000Z",
    "tenantId": "tenant1",
    "snapshotId": "demandSnapshot-test",
    "productId": "SKU1024",
    "unitOfMeasure": "EACH",
    "productClass": "NEW",
    "type": "OPEN_ORDER",
    "shipNode": "Matrix-Store-001",
    "tagNumber": null,
    "segment": "ONLINE",
    "segmentType": "Channel",
    "shipDate": "2023-12-05T00:00:00Z",
    "cancelDate": "2500-01-01T00:00:00Z",
    "referenceType": null,
    "reference": null,
    "minShipByDate": "2500-01-01T00:00:00Z",
    "quantity": 10
  }
}
Note: Inventory Visibility no longer publishes supply or demand records with invalid or unconfigured types in snapshot events. From the coming months, IV enforces validation at ingest to reject such records. Ensure that all custom supply and demand types are configured in IV before sending data.
Use the following URL for demandSnapshot:
https://api.watsoncommerce.ibm.com/inventory/{tenantId}/v2/configuration/events/demandSnapshot/publish_all
supplySnapshot
As a Systems Integrator in Inventory Visibility, you publish a snapshot of the supply system for analysis. As a Fulfillment Manager, you get an insight into the supply system early on so any discrepancies found can be addressed in advance of the next financial cycle. For example, you notice a spike in sales around a new product that you just started to sell lately. To capture more sales, you decide to run a promotion around this product at a certain node. With complete visibility of the supply system, you're aware already of the amount of product that you must supply in advance of the promotion. This ensures that you meet your customer demand successfully.

The following sample JSON is an example of a published event. The event code is supplySnapshot.

{
  "type": "supplySnapshot",
  "datacontenttype": "application/json",
  "id": "4075a47d-9227-432e-ab3e-c369e8802aa0",
  "specversion": "1.0",
  "time": "2023-11-28T00:00:00.000Z",
  "data": {
    "fetchTs": "2023-11-28T00:00:00.000Z",
    "tenantId": "tenant1",
    "snapshotId": "supplySnapshot-test",
    "itemId": "SKU1024",
    "unitOfMeasure": "EACH",
    "productClass": "NEW",
    "type": "ONHAND",
    "shipNode": "Matrix-Store-001",
    "tagNumber": null,
    "segment": "ONLINE",
    "segmentType": "Channel",
    "eta": "1900-01-01T00:00:00Z",
    "shipByDate": "2500-01-01T00:00:00Z",
    "referenceType": null,
    "reference": null,
    "lineReference": null,
    "quantity": 100
  }
}
Note: Inventory Visibility no longer publishes supply or demand records with invalid or unconfigured types in snapshot events. From the coming months, IV enforces validation at ingest to reject such records. Ensure that all custom supply and demand types are configured in IV before sending data.
Use the following URL for demandSnapshot:
https://api.watsoncommerce.ibm.com/inventory/{tenantId}/v2/configuration/events/supplySnapshot/publish_all
Note: The legacy events publish void values as empty string ‘ ‘. Whereas new events publish void values as null in the event message.