Fluent Commerce Logo
Docs
Sign In

CreateVariantProduct

Rule

Changed on:

15 May 2024

Overview

Create a variant product based on the information provided in the event

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 a variant product based on the information provided in the event

Accepts

  • PRODUCT_CATALOGUE

Actions

  • This rule produces a MutationAction that will create a variant product.

Rule parameters

This rule has no Input Parameters.

Event attributes

Main Event Attributes

Parameter

Description

Data Type

Required?

ref

The ref of the product

String

Required

type

The type of the product

String

Required

name

The name of the product

String

Required

gtin

The gtin of the product

String

Required

standardProductRef

The ref of the parent Standard Product

String

Optional

categoryRefs

A list of string category references

[String]

Optional

summary

A brief summary of the product

String

Optional

prices

A list of prices. See the below table for its attributes

[Price]

Optional

taxType

Tax type of this product. See the below table for its attributes

Tax

Optional

attributes

Extra attributes that may be used as part of this product. See the table below for the definition

[Attribute]

Optional

Price sub-attribute

Parameter

Description

Data Type

Required?

type

The type of the price

String

Required

currency

The currency of the price

String

Required E.g. EUR, AUD

value

The value of the price

Floating Point

Required

Tax type sub-attribute

Parameter

Description

Data Type

Required?

country

The country of this tax type

String

Required

group

The tax group

String

Required

tariff

The tariff of this tax type

String

Required

Attribute type sub-attribute

Parameter

Description

Data Type

Required?

name

The name of the attribute

String

Required

type

The type of the attribute

String

Required E.g. STRING, INTEGER, BOOLEAN, OBJECT

value

The value of the attribute

JSON or scalar

Required

Exceptions

If any of the required main attribute fields are null or missing, an EventAttributeNotFoundException will be thrown

Configuration example

1{
2  "name": "<AccountID>.globalinventory.CreateVariantProduct"
3}

Language: json

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}

Language: java

Name: Product

Description:

[Warning: empty required content area]

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}

Language: json

Name: Example JSON payload

Description:

[Warning: empty required content area]


This rule parses/deserializes all the event attributes into a Product object outlined above. It then creates a "variant product mutation" request using all the event attribute values. The 

`{entityRef}`
 value of the incoming event is used as the product catalogue reference of the variant product being created.

Version History

2023-07-28

v2.0.0

refers to plugin

Copyright © 2024 Fluent Retail Pty Ltd (trading as Fluent Commerce). All rights reserved. No materials on this docs.fluentcommerce.com site may be used in any way and/or for any purpose without prior written authorisation from Fluent Commerce. Current customers and partners shall use these materials strictly in accordance with the terms and conditions of their written agreements with Fluent Commerce or its affiliates.

Fluent Logo