Fluent Commerce Logo
Docs

CreateInventoryQuantity

Rule

Changed on:

12 Aug 2025

Overview

Create an inventory quantity based on the incoming event attributes
Plugin NameInventory Reference Module
Namespace[[account.id]].globalinventory
The Inventory Reference Module is the foundation for inventory related implementations. It provides reference Workflows for inventory ingestion and processing. Extensible by design, use this Module as a base to build a solution to the needs of your customers.The Inventory Module includes the following areas:
  • Product Catalogue workflow
  • Inventory Catalogue workflow
  • Control Group workflow
  • Virtual Catalogue workflow

UI Description

Create an inventory quantity based on the incoming event attributes

Accepts

  • INVENTORY_POSITION

Actions

  • This rule produces a MutationAction that will create an inventory quantity.

Rule parameters

ParameterDescription
`type`The type of the inventory quantity that will be created.

Event attributes

ParameterDescriptionData TypeRequired?
`inventoryPositionRef`The associated inventory position refStringYes
`qty`The quantity value of the Inventory QuantityIntegerYes
`expectedOn`The date when the quantity is expected to be availableDate (ISO-8601 format)No
`storageAreaRef`The ref of the storage area where the quantity will be locatedStringNo
`condition`The condition of the quantityStringNo
`locationRef`Location of the Inventory PositionStringNo
`inventoryQuantity`inventoryQuantityUpdate[InventoryQuantity]No
InventoryQuantity sub-attributes
ParameterDescriptionData TypeRequired?
`ref`The reference of the inventory quantityStringNo 
`type`The type of the inventory quantityStringNo 
`qty`The quantity value of the inventory quantityIntegerNo
`status`The status of the inventory quantityStringNo 

Exceptions

  • This rule will throw a PropertyNotFoundException, which is a subclass of RubixException, if the type property is not provided.
  • If `inventoryPositionRef` or `qty` values are not provided, EventAttributeNotFoundException (subclass of RubixException) will be thrown. If the `qty` is not an integer, InvalidAttributeTypeException will be thrown.
  • If the `expectedOn` value cannot be parsed to valid date (or null), InvalidAttributeValueException(subclass of RubixException) will be thrown. If the type of the value cannot be identified, InvalidAttributeTypeException (subclass of RubixException) will be thrown

Configuration example

1{
2  "name": "[[account.id]].globalinventory.CreateInventoryQuantity",
3  "props": {
4    "type":"SALE"
5  }
6}

Detailed Technical Description

Creates an inventory quantity based on the incoming event attributes.
If the inventory quantity reference is not provided as `inventoryQuantity.ref`, the reference for the new inventory quantity is created by combining the inventory position reference, a colon, and the inventory quantity type. For example, if the inventory position reference is `PRD:LOC:DEFAULT` and the quantity type is 'SALE', the inventory quantity reference will be `PRD:LOC:DEFAULT:SALE`.

Version History

2023-07-28

v2.0.0

refers to plugin