Fluent Commerce Logo
Docs

AllocateConfirmedItemsByFulfilmentExpiry

Rule

Changed on:

12 Aug 2025

Overview

Allocates picked items to all Fulfilments in the Wave. Priortizing the Fulfilments expiring first and not in specified statuses. Secondly, notifies Fulfilments with the specified event name.
Plugin NameFulfilment Reference Module
Namespace{{accountId}}.fulfilment
The Fulfilment Reference Module is the foundation for in-store operations. It provides a reference Workflow for pickpack, and shipping of orders for in-store staff. Extensible by design, use this Module as a base to build a solution to the needs of your customers.

UI Description

Allocates picked items to all Fulfilments in the Wave. Priortizing the Fulfilments expiring first and not in specified statuses. Secondly, notifies Fulfilments with the specified event name.

Accepts

  • Wave

Actions

  • Type: sendEvent
  • Condition: Always
  • Description: Sends an event containing the items picked by the Store associate, and how the individual items were then allocated to the Fulfilments.

Rule parameters

PropertiesTypeDescription
eventName`string`Name of the outgoing event sent for each Fulfilment
excludedStatuses`Array of Strings`The statuses of the Fulfilments that should be excluded from having picked items allocated to them

Event attributes

NameTypeRequired?DefaultDescription
pickedItems`Array of PickedItems`YesN/AContains the details of what was picked for each item.

Attribute Types

PickedItems 
NameTypeRequired?Description
productRef`string`YesThe ref of the item that was picked
availableQty`integer`YesThe quantity of the item that was picked by the store associate
catalogueRef`string`YesThe catalogue of the product that was picked

Detailed Technical Description

Detailed Rule Logic

No alt provided
  • Checks if event attribute `pickedItems` is null or empty, if this is true then "Event does not have `pickedItems` attributes"
  • Validate each `pickedItem` to ensure the items are valid by:
    • Check `availableQty` is less than 0 then --> "`pickedItem` `availableQty` is negative for `productRefs`"
    • Check `productRef` is blank or empty then --> "`pickedItem` `productRef` is empty or blank"
  • Loop through each `FulfilmentItem` and determine if there is an available quantity from the picked items to allocate to that Fulfilment. If so, we then set the `FulfilmentItem.filledQuantity` equal to the amount requested and decrement the `availableQty` for that item.
  • If, you can't allocate any of the available quantity to a `FulfilmentItem`, then set the rejected quantity equal to the outstanding amount. Note, Fulfilments can be partially fulfilled, you still allocate available quantities to a Fulfilment even if one particular line could not be filled.
  • For each Fulfilment, send an event, the details of what is contained in that event can be found in the Actions section below.

Version History

2023-08-02

v23.8.2

refers to plugin