Next-generation platform

Physical inventory count

During the physical count process, the store stops all inventory transactions and physically counts its entire inventory.

Configuring physical count

To configure physical count, call the Create Physical Count Configuration API. Before starting the physical count process, ensure that you have defined the appropriate configurations for the physical count task. For example, configuration to calculate variance at the product level or count task level.

For your business, if you want to create multiple count tasks for the same product and location, then configure the variance calculation at the product level. By default, the variance calculation is considered at the product level.

Physical count program

To create a count program for a physical count, call the Create Count Program API. In the count program, you can define the start and end date, exclude criteria, and so on.

Creating physical count request

To create a physical count request for the count program, all the Create Count Program API. The application considers all the configurations from the count program and automatically creates a physical count request on the start date. To manually create a physical count request, call the Create Physical Count Request API. At any point, a store can have only one active physical count request.

Note: You can create a count request without a count program.

Starting physical count

To start a physical count process in a store, call the Start Physical Count Request API. Before you call the API to start the physical count process in a store, ensure that the store is closed and all inventory transactions are stopped, except for recording count. Count requests that are in not started status are moved to in progress status.

Recording physical count

After completing physical count, you must record the count in the application. A store associate records the count details in a worksheet that can be printed by using an external system. This process involves creating a count task for the store, product and location, assigning a user to the task, starting the count task, and recording the count for the assigned task.

Completing count tasks

After recording the inventory count, call the Complete Count Task API to mark the count task as completed. On completion of a particular count task, the variance is calculated and stored accordingly.

  • Variance calculation set to task level - When you call the Complete Count Task API, it fetches the actual inventory. The variance is then calculated by comparing the actual inventory with the recorded count. After calculating the variance, the variance is stamped on the count task. Based on the variance calculation, the count task status is updated to either COMPLETED or COMPLETED_WITH_VARIANCE.
  • Variance calculation set to product level - When you call the Complete Count Task API, and after a basic validation the count task is marked as COMPLETION_IN_PROGRESS. Also, an event is triggered that calculates the variance for that particular count task. The backend server listens to the event and checks if a variance exists for the product at the specific location. If the variance exists, it is updated by considering the recorded count for the current count task. If a variance does not exist, the variance is calculated based on the inventory count and a record is created in the count_task_variance table. After the variance calculation is complete, the status of the count task is changed to COMPLETED, irrespective of whether or not the existence of the variance.
Note: After completing a count task, you can approve or reject the variance after the application completes and records the variance calculation in the count_task_variance table.

Creating recount task

To create a recount task, call the Create Recount Task API. If you configure the variance calculation at the product level, when a count task ends in the variance, recount tasks are not automatically generated. Hence, you can use this API to generate recount task. When you call the Create Recount Task API, after a basic validation, an event is triggered to update the variance. The backend server listens to the event, determines the change in variance and updates the count_task_variance table.

Resetting counts

To reset the recorded count, call the Reset count task API.

Approving variances

To approve variances, call the Approve Count Task and Approve Physical Count Variance APIs.
  • If variance is calculated at the task level, call the Approve Count Task API to approve variance for the count task. After approval, the API invokes inventory adjustment with the variance or delta count.
  • If variance is calculated at product level, call the Approve Physical Count Variance API to approve variance for a product, product present at a specific location, or count request. If cancelOpenTasks is passed as true, all open tasks are canceled.
    • Approving variances at the product location level - When you call the Approve Physical Count Variance API with product and location as parameters, and after a basic validation, an event is triggered to approve the variance. The backend server listens to the event and fetches the variance for the given pair of product and location. Based on the variance, an event is triggered for inventory adjustment and the variance is marked as APPROVED.
    • Approving variances at the product level - When you call the Approve Physical Count Variance API with product as a parameter, and after a basic validation, an event is triggered to approve the variance. The backend server listens to the event and fetches all the open variances for the given product. It also iterates through all the product location variances, and for the variance found an event is triggered for inventory adjustment. Then the open variances are marked as APPROVED. The variance status at the product level is determined based on the variance status for the product location variances.
    • Approving variances at the request level - When you call the Approve Physical Count Variance API without any parameters, and after a basic validation, the count request is marked as COMPLETION_IN_PROGRESS. Also, an event is triggered to approve the variance. The backend server listens to the event and fetches all the open variances for the given count request. It also iterates through all the product location variances and triggers an event to approve each product location variance. And finally, the count request status is updated to COMPLETED.

Rejecting variances

To reject variances, call the Reject Count Task and Reject Physical Count Variance APIs.
  • If variance is calculated at the task level, call the Reject Count Task API to reject variance for the count task.
  • If variance is calculated at the product level, call the Reject Physical Count Variance API to reject variance for a product, product at a specific location, or count request. If cancelOpenTasks is passed as true, all open tasks are canceled.
    • Rejecting variances at the product location level - When you call the Reject Physical Count Variance API with product and location as parameters, and after a basic validation, an event is triggered to reject the variance. The backend server listens to the event and fetches the variance for the given pair of product and location, and then marks the variance as REJECTED
    • Rejecting variances at the product level - When you call the Reject Physical Count Variance API with product as a parameter, and after a basic validation, an event is triggered to reject the variance. The backend server listens to the event and fetches all the variances for the given product. It also iterates through all the product location variances and marks the open variances as REJECTED. The variance status at the product level is determined based on the variance status for the product location variances.
    • Rejecting variances at the request level - When you call the Reject Physical Count Variance API without any parameters, and after a basic validation, the count request is marked as COMPLETION_IN_PROGRESS. An event is triggered to reject the variance. The backend server listens to the event and fetches all the open variances for the given count request. It also iterates through all the product location variances and triggers an event to reject each product location variance. And finally, the count request status is updated to COMPLETED.

After rejection, the API invokes inventory adjustment with the variance or delta count. If cancelOpenTasks is passed as true, all open tasks are canceled.

Ending physical counts

To end a physical count, call the Finish Physical Count Request API.

When variance calculation is set at the product level, and if there are open tasks, pass the cancelOpenTask flag. If this flag is set to false, and if there are open tasks, the API displays an error message. When you call the Finish Physical Count Request API, and after a basic validation, the count request is marked as COMPLETION_IN_PROGRESS, and an event is triggered to complete the count request. The backend server listens to the event and cancels the open tasks, if any when cancelOpenTask is set to true. It then triggers approve or reject variance event at the request level based on the value passed for varianceStatus. After approving or rejecting all the variances for the count request, the count request status is marked as COMPLETED.

Rectifying physical counts

To rectify counts, call the Rectify physical count API. You can rectify count for a count task or rectify the recorded count for a product at a specific location. You can rectify counts only if the variance calculation is configured at the product level.

When you call the Rectify physical count API, after a basic validation, an event is triggered to rectify the recorded count. The backend server listens to the event, determines the variance, and updates the count_task_variance table.

Canceling physical count requests

To cancel physical count requests that are not started, call the Cancel Count Request API.

Canceling physical count tasks

To cancel physical count tasks that are not started or in progress, call the Cancel Count Task API.

Viewing variance details

To view the variance details, call the Search Count Tasks within Count Request API.
  • If variance is calculated at the task level, set discrepancy=true to view all the tasks with variance.
  • If variance is calculated at the product level, you can set discrepancy=true or discrepancy=false. Set fields=count-tasks to view discrepancy for count tasks and fields=product-locations to view discrepancy for products at the location level.

Viewing physical count program, count requests, or count tasks

To fetch or view details of physical count programs, physical count requests, and count tasks, call the following APIs:

Updating count programs

To modify an existing count program, call the Update Count Program API.

Deleting count programs

To delete an existing count program, call the Delete Count Program API.