New event formats

Sterling Intelligent Promising has introduced a new event format for inventory service. Any new events going forward 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 endpoint.
Event ID in Inventory Visibility Event code in payload
Deprecated featureSupply.change Deprecated featuresupplyChange
supplyChange.v2 supplyChange.v2
productAvailability.v2 productAvailability.v2
dgAvailabilityChange.v2 dgAvailabilityChange.v2
Demand.Change demandChange

Snapshot events

The following snapshot events allows 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
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 have to 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. 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.
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": "2021-03-10T00:00:00.288Z",
  "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,
      "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 have to 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. 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
When the availability for an item at a ship node changes, the productAvailability.v2 event is triggered.
The following sample JSON is an example of a published event.
{
  "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": 30,
     "toTs": "2021-04-01T00:00:00.000Z",
     "availableQuantity": 30,
     "consumedSafetyQuantity": 0,
     "fulfillmentAllowed": true,
     "reservedQuantity": 0,
     "shortageQuantity": 0,
     "thresholdLevel": 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,
    }
   ]
 }
}
dgAvailabilityChange.v2
When availability changes for a distribution group, the dgAvailabilityChange.v2 event is triggered to record the change.
The following sample JSON is an example of a published event.
{
  "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": null,
  "segmentType": null,
  "distributionGroupId": "WEB",
  "unitOfMeasure": "EACH",
  "currentAvailability": {
     "toTs": "2021-04-01T00:00:00.000Z",
     "availableQuantity": 30,
     "consumedSafetyQuantity": 0,
     "fulfillmentAllowed": true,
     "reservedQuantity": 0,
     "shortageQuantity": 0,
     "thresholdLevel": 0
    },
    "futureAvailability": [
    {
       "fromTs": "2021-04-01T00:00:00.000Z",
       "toTs": "2500-01-01T00:00:00.000Z",
       "availableQuantity": 40,
       "consumedSafetyQuantity": 0,
       "fulfillmentAllowed": true,
       "reservedQuantity": 0,
       "shortageQuantity": 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, consumedSafetyQuantityfulfillmentAllowed.
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.
{
  "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": 30,
      "consumedSafetyQuantity": 0,
      "fulfillmentAllowed": true,
      "reservedQuantity": 0,
      "shortageQuantity": 0,
      "thresholdLevel": 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
     }
   ]
  }
}
The following EOF sample is an example of a published event:
{
  "type": "productAvailabilitySnapshot.v2",
  "datacontenttype": "application/json",
  "id": "2a8d36a3-485b-3fc0-bd15-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
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.

{
   "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": "PICK",
     "segment": null,
     "segmentType": null,
     Deprecated feature"distributionGroup": "Stores",
     "distributionGroupId": "Stores",
     "currentAvailability": {
       "availableQuantity": 0,
       "consumedSafetyQuantity": 0,
       "fulfillmentAllowed": true,
       "reservedQuantity": 0,
       "shortageQuantity": 0,
       "thresholdLevel": 3,
       "toTs": "2021-07-20T00:00:00.000Z"
     },
     "futureAvailability": [
       {
         "availableQuantity": 10,
         "consumedSafetyQuantity": 0,
         "fromTs": "2021-07-20T00:00:00.000Z",
         "fulfillmentAllowed": true,
         "reservedQuantity": 0,
         "shortageQuantity": 0,
         "toTs": "2021-08-16T00:00:01.000Z"
       }
     ]
   } 
 }
  
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, consumedSafetyQuantityfulfillmentAllowed.
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 must 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 out on 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
  }
}
supplySnapshot

As a System 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 have to 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: The legacy events publish void values as empty string ‘ ‘. Whereas new events publish void values as null in the event message.