Fluent Commerce Logo
Docs

ValidateVariantProduct

Rule

Changed on:

12 Aug 2025

Overview

Validates the incoming variant product event payload
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

Validates the incoming variant product event payload

Accepts

  • PRODUCT_CATALOGUE

Actions

  • This rule does not produce any Output Actions. It validates the existence of the standard product if the incoming event has an event attribute called standardProductRef. If the standardProductRef value is not empty and there is no corresponding standard product in the product catalogue an IllegalArgumentException will be thrown.

Rule parameters

This rule has no Input Parameters.

Event attributes

Main Event Attributes
ParameterDescriptionData TypeRequired?
refThe ref of the productStringRequired
typeThe type of the productStringRequired
nameThe name of the productStringOptional
gtinThe gtin of the productStringOptional
standardProductRefThe ref of the parent Standard ProductStringOptional
categoryRefsA list of string category references[String]Optional
summaryA brief summary of the productStringOptional
pricesA list of prices. See the below table for its attributes[Price]Optional
taxTypeTax type of this product. See the below table for its attributesTaxOptional
attributesExtra attributes that may be used as part of this product. See the table below for the definition[Attribute]Optional
Price sub-attribute
ParameterDescriptionData TypeRequired?
typeThe type of the priceStringRequired
currencyThe currency of the priceStringRequired E.g. EUR, AUD
valueThe value of the priceFloating PointRequired
Tax type sub-attribute
ParameterDescriptionData TypeRequired?
countryThe country of this tax typeStringRequired
groupThe tax groupStringRequired
tariffThe tariff of this tax typeStringRequired
Attribute type sub-attribute
ParameterDescriptionData TypeRequired?
nameThe name of the attributeStringRequired
typeThe type of the attributeStringRequired E.g. STRING, INTEGER, BOOLEAN, OBJECT
valueThe value of the attributeJSON or scalarRequired

Exceptions

If there is no standard product for the standard product reference, an IllegalArgumentException will be thrown.

Configuration example

1{
2  "name": "{{accountId}}}}.globalinventory.ValidateVariantProduct"
3}

Detailed Technical Description

All the event attributes of the incoming event are parsed/deserialized into a "Product" object which has the following structure
1public class Product {
2
3    @NonNull
4    private String ref;
5
6    private String type;
7
8    private String status;
9
10    private String gtin;
11
12    private String name;
13
14    private String summary;
15
16    private List<String> categoryRefs;
17
18    private List<Price> prices;
19
20    private String standardProductRef;
21
22    private TaxType taxType;
23
24    private List<Attribute> attributes;
25}
An example JSON payload that represents the event attributes of an incoming event
1{
2  "ref": "VP_1_45",
3  "type": "VARIANT",
4  "status": "ACTIVE",
5  "gtin": "VP_1-45",
6  "name": "Blue Jeans Size 8",
7  "summary": "Variant product summary",
8  "standardProductRef": "STD_1_88",
9  "categoryRefs": [],
10  "prices": [{"type": "RRT", "currency": "AUD", "value": 34.56}],
11  "taxType": {"country": "AU", "tariff": "GST", "group": "GSTG1"},
12  "attributes": [{"name": "isDangerous", "value": false, "type": "BOOLEAN"}]
13}
This rule parses/deserializes all the event attributes into a Product object outlined above. If the product type is not `VARIANT`, it skips the validation. It also skips validation if there is no standard product reference value found in the event attributes. If there is a standard product reference value and a corresponding standard product exist in the product catalogue, it passes the validation and outputs nothing. If there is no standard product for the specified standard product ref, it throws an IllegalArgumentException.

Version History

2023-08-03

v2.0.0

refers to plugin