Inventory audit

At any shipping location, whether it is a distribution center or a store, thousands of inventory transactions might be processed which occurs because of the changes in inventory supply or demand. For a supply, it might be an inbound supplier inventory or a micro transaction that is created by a walk-in customer during a cart checkout. For a demand, it can be led by a new online order capture.

A fulfillment manager would need a tool to review large amounts of historic inventory records to understand the correct reason for an inventory action, such as studying the inventory trend, or identifying sets of inventory records belonging to a data group.
  1. Supply diagnostic: If there was an erroneous supply update resulting in an incorrect inventory picture at a store, the fulfillment manager must identify the exact time and details of one or more inventory update so that the root cause can be addressed. In contrast, retrieving a list of supply or demand update alone might not help with the analysis without the audit and time factor.
  2. Audit export for data analysis: After a sales campaign, with the help of an external data analysis tool the fulfillment manager can do a comparative analysis on the trend of inventory movements with the help of audit to discover if there has been a boost or drop in the result of the campaign.
  3. Supply lots identification: Suppose that there was a product recall from a manufacturer, then the fulfillment manager has a need to uncover a group of inventory supply updates that was associated or stamped with the manufacturer name so that the fulfillment manager can trace the impacted receiving node to do protective actions.

There are some transactions that do not result in supply and demand change. For example, if an adjustment for supply or demand is sent with a timestamp that is older than the last supply sync or demand sync timestamp, then that adjustment is not applied and it is ignored. As there is a need to capture audits for such transactions as well, every accepted client request is audited.

Supply and demand audit

The inventory audit service provides the capability to audit both the supply and demand records. When there is an adjustment or synchronization request for supply or demand, and if the request has been accepted by Inventory Visibility, then the audit service records the following details:
  • The activity timestamp.
  • The action that is performed.
  • The details of the inventory record.
  • Transaction ID (that is included during inventory update).

In addition, you can search the audit record through the Order Hub user interface or by using the corresponding supply and demand audit search APIs.

Inventory audit search and details lookup

The inventory audit search is a flexible query-based API, which enables the users to locate audit records by specifying the time period and inventory attributes. These results can be sorted in an ascending or descending order. To aid in export or in UI use cases, you can use the audit search API to see the results in a paginated format by specifying the wanted page size and page offset.

A search query consists for one or more search attribute names and the comparison operator. A few of the nonexhaustive list might include:

Table 1. Search attribute and queries
Search attributes Search queries
Supply attributes itemId, unit of measure, product class, shipnode, shipByDate, line Reference, reference type, reference, eta, type, base type, audit type, purpose, parent actionId, relatedByActionId.
Demand attributes itemId, unit of measure, product class, shipnode, shipDate, reference type, reference, cancel date, min ship by date, type, base type.
The system supports the following operators:
  • Contains.
  • Equals (single value).
  • Equals (multi values similar to a IN clause).
  • Start with.
  • For timestamp fields, From and To date range.

If the audit ID is known, you can use the audit detail API to lookup a specific audit record.

Inventory audit retention period

You can search for inventory audit up to 30 historic days from the time of query. If you want to extend the retention period or interested in analyzing the data, you can export the audit record to an external database with the use of the audit search API.

For information, see Supply audit API and Demand audit API.

Custom inventory attribute for supply audit

The standard supply audit record consists of inventory attributes, which might be insufficient to do a detailed root cause analysis in certain use cases. For example, a fulfillment manager might want to include the manufacturer name, GTIN value, or a modified username as part of the supply adjustment and sync request so that the additional values are persisted in the inventory audit. If there is an issue later, such as a manufacturer recall or erroneous update, the specific supply record and activity time can be identified by using the additional attribute as a filter in the audit search capability. Another example is a fulfillment manager might do an audit search on all supply adjustment records created by a specific system or user by using the custom attribute modifiedUserId as a query term.

The custom inventory attribute can be enabled for audit search by following these steps:

  1. Configuring the custom supply attributes.
  2. Including the custom supply attributes as part of the supply adjustment or sync request.
  3. Searching the supply audit using custom supply attribute as a search query (through the API or Order Hub).

Configuring custom supply attributes

Using the createCustomAttribute API, you must register the JSON attribute that you would like to include as part of supply adjustment and sync request. The label must match the actual attribute value in the supply request. The business purpose in this case is "supply".

For more information on how to create custom attributes, see createCustomAttribute API.

{
   "label":"ManufacturerName",
   "datatype":"string",
   "businessPurposes":[
      "supply",
      "sourcing"
   ]
}
Note: In this example, the same attribute was set to apply to both supply and sourcing rule use case in IBM® Sterling Intelligent Promising.

Supply adjustment or sync with custom attributes

After the custom supply attribute has been defined, the next step is to include the JSON attribute in the supply adjustment and sync request. For example, if the configured custom attribute is ManufacturerName then this attribute is included inside the customAttributes JSON element.

Note: The unregistered attribute included in the supply request will not be considered for the audit purpose.
{
   "supplies":[
      {
         "itemId":"17854",
         "unitOfMeasure":"EACH",
         "productClass":"NEW",
         "type":"ONHAND",
         "shipNode":"matrix",
         "eta":"1900-01-01T00:00:00-00:00",
         "shipByDate":"2500-01-01T00:00:00-00:00",
         "minShipByDate":"2500-01-01T00:00:00-00:00",
         "quantity":"9993.0",
         "customAttributes":{
            "ManufacturerName":"process",
            "ModifyUserId":"123456",
            "ManufacturingDate":"2020-01-01T00:00:00.000Z"
         }
      }
   ]
}

Query inventory audit with custom inventory attributes

After the supply update has been accepted by the system, the custom attribute appears in the audit. You can use Order Hub audit search or you can build a search query for the API request consisting of one or more search terms. For example, if the query is itemId=Item001 and ManufacturerName=ACME, it would return all Item001 supply record that was sourced from ACME.

{
   "offset":0,
   "pageSize":25,
   "time":{
      "fromValue":"2023-03-01T00:00:00.000Z",
      "toValue":"2023-03-03T00:00:00.000Z"
   },
   "data":{
      "itemId":{
         "operator":"contains",
         "values":[
            "SKU1024"
         ]
      },
      "customAttributes":[
         {
            "customAttribute":"ManufacturerName",
            "operator":"equals",
            "values":[
               "ACME"
            ]
         }
      ]
   }
}