UpsertInventoryQuantity
Changed on:
17 Feb 2025
Overview
Create or Update an Inventory Quantity.
Plugin Name | Inventory 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 or update an Inventory Quantity of Type {" + PROP_DEFAULT_TYPE + "} using Event attributes.
Accepts
- INVENTORY_POSITION
Actions
- This Rule produces a MutationAction that will create or update an Inventory Quantity
Rule parameters
Name | Type | Description |
|
| The Fallback Type for an Inventory Quantity to be created/updated |
Event attributes
Name | Type | Description | Required |
|
| The quantity value of the Inventory Quantity | Yes |
|
| The condition of the Inventory Quantity | No |
|
| The date when the Inventory Quantity is expected to be available | No |
|
| The Reference of the storage area where the Inventory Quantity will be located | No |
|
| The associated Inventory Position Reference | Yes |
|
| The Object that contains the Inventory Quantity specific data. See the Sub-attributes below. | No |
InventoryQuantityUpdate Object Sub-attributes
Name | Type | Description | Required |
|
| The Reference of the Inventory Quantity | No |
|
| The quantity value of the Inventory Quantity | No |
|
| The Type of the Inventory Quantity | No |
|
| The Status of the Inventory Quantity | No |
|
| The following attributes are supported:
| No |
Exceptions
- This Rule throws a when the Rule parameter(s) is not provided.
`PropertyNotFoundException`
- This Rule throws an when the required Event attribute(s) is not provided.
`EventAttributeNotFoundException`
- This Rule throws an when the provided:
`InvalidAttributeTypeException`
- attribute value is not
`qty`
`Integer`
- attribute value type can not be identified
`expectedOn`
- This Rule throws an when the provided
`InvalidAttributeValueException`
attribute value can not be parsed to a valid date (or null).`expectedOn`
Configuration example
1{
2 "name": "[[account.id]].globalinventory.UpsertInventoryQuantity",
3 "props": {
4 "defaultType": "LAST_ON_HAND"
5 }
6}
Language: json
Detailed Technical Description
This Rule execution includes the following steps:
- Validate that:
- The Rule parameter has been provided
`defaultType`
- The mandatory Event attributes have been provided:
`qty`
`inventoryPositionRef`
- The attribute value is an
`qty`
`Integer`
- The
- Retrieve the Inventory Position and its Inventory Quantity(ies) based on the provided:
`inventoryPositionRef`
`inventoryQuantity.ref`
This Sub-attribute is optional, so when it is not provided, the fallback logic will generate the Inventory Quantity Reference based on the following pattern:
The Inventory Position Reference, a colon, and the Inventory Quantity Type. For example:- If the (Event attribute) is
`inventoryPositionRef`
`PRDREF:LOCREF:DEFAULT`
- And the Inventory Quantity Type is :
`LAST_ON_HAND`
- Sub-attribute (when provided)
`inventoryQuantity.type`
- Otherwise, (Rule parameter)
`defaultType`
- The generated Inventory Quantity Reference will be
`PRDREF:LOCREF:DEFAULT:LAST_ON_HAND`
- If the
- Execute a to:
`MutationAction`
- Update the Inventory Quantity with the provided attributes when it exists (i.e., was successfully retrieved by its Reference)
- Otherwise, create a new Inventory Quantity with the provided attributes
Version History
v25.2.18
Refers to the Product Release Version.