UpdateStandardProduct
Changed on:
13 Nov 2023
Overview
Update a standard product using the information provided in the
Plugin Name | Inventory Reference Module |
---|---|
Namespace | [[account.id]].globalinventory |
The is the foundation for 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 Module includes the following areas:
- Product Catalogue workflow
- Inventory Catalogue workflow
- Control Group workflow
- Virtual Catalogue workflow
UI Description
Update a standard product using the information provided in the event
Accepts
- PRODUCT
Actions
- This rule produces a MutationAction that will update the standard product with provided values
Rule parameters
This has no Input Parameters.
Event attributes
This uses all the attributes to update a standard product. Note that some attributes represent complex types and their definitions follow the main definition.
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 |
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 | [] | 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 | String | Required |
type | The type of the | String | Required E.g. STRING, INTEGER, BOOLEAN, OBJECT |
value | The value of the | JSON or scalar | Required |
Exceptions
If the `{ref}`
is null or empty, an EventAttributeNotFoundException will be thrown
Configuration example
1{
2 "name": "FLUENTRETAIL.globalinventory.UpdateStandardProduct"
3}
Detailed Technical Description
All the event attributes of the incoming 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 TaxType taxType;
21
22 private List<Attribute> attributes;
23}
An example JSON payload that represents the attributes of an incoming
1{
2 "ref": "STD_1_88",
3 "type": "STANDARD",
4 "status": "ACTIVE",
5 "gtin": "STD_1-87",
6 "name": "Blue Jeans",
7 "summary": "summary",
8 "categoryRefs": [],
9 "prices": [{"type": "RRT", "currency": "EUR", "value": 34.56}],
10 "taxType": {"country": "AU", "tariff": "GST", "group": "GSTG1"},
11 "attributes": [{"name": "isDangerous", "value": false, "type": "BOOLEAN"}]
12}
This parses/deserializes all the attributes into a Product object outlined above. It then creates an "update product mutation" request using all the values. It uses the `{ref}`
of the incoming as the reference of the standard product and `{rootEntityRef}`
value of the incoming as the product catalogue reference of the standard product being updated.
Version History
v2.0.0
refers to