Skip to main content

Product Not Found & Wrong Product Command Advanced

This document provides an advanced guide to handling the "Product Not Found" and "Wrong Product" scenarios within the Akinon Order Management System (OMS) using the DetectedOutOfStockItemCommandAdvanced. These situations arise when certain items in a packaging order are unavailable at the designated stock location, affecting the packaging process.

The guide explains the involved actors, domain objects, and step-by-step processes that OMS follows to manage such events. Unlike the standard version of the command, this advanced command focuses on re-planning only the out-of-stock items to a new stock location, while keeping the remaining items at the same location.

Additionally, it covers the command parameters, prerequisites, and valid states required for executing this command, ensuring a smooth transition of affected items to the Out of Stock status. The document also includes detailed API references, request body examples, and possible response outcomes, enhancing the fulfillment process when discrepancies occur in stock availability.

Actors

  • Akinon Order Management System (OMS)
  • Integrated Application (ERP)

Domain Objects

  • Packaging Order
  • OMS Command (Packaging Order Command)

Process

  1. The OMS application copies orders from the Akinon Omnitron Application to itself to prepare delivery/distribution plans, generate packaging orders and transfer them to operation points.
  2. The products in the order are distributed to the Packaging Orders by running the rules in the distribution scenarios designated by the brand.
  3. Packaging Orders are transferred to the Akinon Instore App or the brand’s integrated software. (Packaging Orders Webhooks)
  4. Packaging orders assigned to the Store/Warehouse commence in the Waiting status.
  5. In the event that a particular product in the package is out of stock, the store/warehouse employee informs the OMS that packaging cannot be carried out. The relevant package and its items are moved to the Out of Stock status, and the package items that are suitable for packaging are rescheduled to create new packages.
  6. By this command, only the out-of-stock items in the package are re-planned for a new stock location. Remaining items are planned at the same location.
  7. The DetectedOutOfStockItemCommandAdvanced is run for a packaging order in the Waiting, Preparing and Ready for Packaging status, completing the transition of the Package and its items to the Out of Stock status.

Command Parameters and Prerequisites

For each packaging order:

ParameterParameter NameParameter TypeParameter DescriptionRequirement
Packaging Order IDpackageintegerThe ID of the packageMandatory
Command Transition IDtransitionintegerThe ID of the commandOptional (if slug is given)
SlugslugslugUnique slug of the commandOptional (if Command Transition ID is given)
Package Item IDspackage_itemslistA list of out-of-stock package item IDsMandatory
Denial Reasondenial_reasonintegerDenial reason IDOptional

This command may only be run for packages in the following states:

  • Waiting (enum_value: 100)
  • Preparing (enum_value: 200)
  • Ready for Packaging (enum_value: 400)

Running the command in other states will trigger a validation error.


POST Product Not Found & Wrong Product Advanced

Path: https://{customer_api_url}/api/v1/oms/packages/{package_id}/command/

  • Package ID: XXX
  • Transition ID: NNN (set after OMS installation)
  • Slug: SSS (Unique Slug Value)

Request Body

{
"transition": NNN,
"slug": SSS,
"package": XXX,
"package_items": [
1,
2,
3
]
}

Successful Response

Status Code: 200 OK

After the successful execution of the command, the API returns following responses.

  1. If there are package items that are planned at the same location:
{
"package__id": 123,
"package__number": "1234567891234567P3",
"package__stock_location__id": 2,
"package__stock_location__name": "Test Store",
"is_same_location": true
}
  1. If there are no package items that are planned at the same location:
{
"package__id": null,
"package__number": "",
"package__stock_location__id": null,
"package__stock_location__name": ""
}