4.2 - BOM
BOM stands for "Bill Of Material". It's a set JSON object containing the description of the current product, with the data required for an "Add to cart" action for example.
Event name | Input / Output | Payload | Reason |
---|---|---|---|
getBom | Input event | None. | Request the BOM for the current state. |
bom | Output event | See the description below. | Receive the requested BOM. |
Exampleβ
// Receive the BOM.
configurator.addEventListener("bom", (event) => {
console.log(event.detail);
});
// Send a request to get the BOM.
configurator.dispatchEvent(new CustomEvent("getBom"))
Payload descriptionβ
The BOM is a complex JSON object. At the top level, it contains the following attributes:
Attribute name | Type | Content |
---|---|---|
packs | Array of BOM object. π | If some pack were detected in the BOM, they will appear here. |
products | Array of BOM object. π | This will contain the product currently loaded. |
totalPrice | The Total price. π | This object contains the total price of the current product. |
BOM objectβ
This is the description of a product or sub product.
Attribute name | Type | Content |
---|---|---|
children | Array of BOM object. π | Sub products of this product. |
clientMetadata | any | Client metadata for this product. |
commercialDescription | string | Commercial description. |
dbID | string | Identifier of this product in the database. If you load the same product multiple times, the dbid will be the same. |
depth Β ? | number | Optional product current depth value. |
endDate Β ? | string | Optional end date of the product availability (timestamp). |
freeTags | Array of string | Array of free tags associated to the furniture. |
height Β ? | number | Optional product current height value. |
isExpired | boolean | True if the product was expired at the time of BOM generation. |
name | string | Product name. |
packs | Array of BOM object. π | See packs description. π |
parameters Β ? | Parameter values. π | The optional list of parameters applied on this product. |
price Β ? | Product price. π | An optional price for this product. |
priceDetails Β ? | Array of Product price detail. π | An optional array of price details for this product. |
priceExtra | number | An optional value to add to the price. All values are valid, even negative one (to reduce the total price). |
priceMultiplier | number | A multiplier to apply to the price. It should be >= 0. 0 would put all prices to 0. |
recognizedBlock Β ? | BOM object. π | The optional recognized block, if blocks are configured. |
reference | string | Product reference. |
shortDescription Β ? | string | Optional short description of the product. |
startDate Β ? | string | Optional start date of the product availability (timestamp). |
thumbnailURLSmall Β ? | string | Optional product thumbnail (size 64). |
typeID | number | Product closed tag ID of the product. |
uuid | string | A unique random identifier for this instance of the product. |
width Β ? | number | Optional product current width value. |
Dimensionsβ
The depth
, height
and width
attributes contains:
- For a simple configurable product π or a module π in a modular composition, the current value of the parameter of the same id (
depth
,height
orwidth
). - For a modular context π: the computed dimensions for the scene, as displayed by the dimensions button.
Product priceβ
This is the description of the price of a product. It contains the following attributes:
Attribute name | Type | Content |
---|---|---|
current | Price. π | The computed current price. Can be the same as the regular price. |
discountType | string | The type of the current price. "regular", "reduced", "discounted" or "membership" |
ecoFee Β ? | Price. π | The optional currently applied ecofee. |
regular | Price. π | The computed regular price. |
Product price detailβ
When a product is priced using configuration sets, this object contains the details of the computed price. It contains the following attributes:
Attribute name | Type | Content |
---|---|---|
id | string | The identifier of the configuration set. |
mode | string | The mode associated to this price detail. "ADD" or "OVERRIDE" |
name | string | The translated name of the configuration set. Can be the id if no translation is available. |
configurationName | string | The translated name of the matching configuration. Can be the id of the configuration if no translation is available. |
reference Β ? | string | The optional reference associated with the matching configuration. |
price Β ? | Base price. π | The optional price associated with the matching configuration. |
Base priceβ
This is the description of a price.
Attribute name | Type | Content |
---|---|---|
type | string | The type of the current price. "regular", "reduced", "discounted" or "membership" |
value | number | The value for this price, without any multiplier applied. |
startDate Β ? | string | The optional date at which this price starts being available. |
endDate Β ? | string | The optional date at which this price availability ends. |
The start and end date format should follow the Date time string format. π
Priceβ
The price is a Base price with additional attributes:
Attribute name | Type | Content |
---|---|---|
totalValue | number | The value for this price once any multiplier or price extra is applied. |
Total priceβ
This is the description of the total price of the current product.
Attribute name | Type | Content |
---|---|---|
currency | string | The currency to use, a 3 letters string following ISO 4217 π |
current | number | The computed current price. Can be the same as the regular price. |
discountType | string | The discount type of the current price. "regular", "reduced", "discounted" or "membership" |
regular | number | The computed regular price. |
startDate Β ? | string | The optional date at which this price starts being available. |
endDate Β ? | string | The optional date at which this price availability ends. |
The start and end date format should follow the Date time string format. π
Packsβ
If some products are bought by packs, like "A box of two sofa legs", they will appear in the "packs" attribute. Their description will contain the same data found in a BOM object π, with those additional attributes:
Attribute name | Type | Content |
---|---|---|
quantity | number | Number of packs products needed for the project |
Recognized Blockβ
If blocks are configured π, the BOM can contain a recognized block. The recognized block object contains the same data found in a BOM object π, with small differences:
- The "children" attribute of the recognized block will contain only additional products. π
- The recognized block will not have another recognized block inside.
When a product has a recognizedBlock attribute filled, the children of this product will still be available, but they will have no price. They are only useful if you want the full description of the composition. The price of the composition will make use of the recognized block price and the additional products prices.
Parameter valuesβ
This only contains data if you enable the associated ParameterBOMRule. π The rule will configure a list of parameters that must be displayed in the BOM.
When the rule is correctly configured, this is an object where the attribute names are the parameter ids. For each attribute, the value is the current value for the parameter.
Default parameter valuesβ
When the rule does not enable product details, the parameter targeting a product will contain the database identifier of that product.
{
"seat_width": 120,
"finish": "blue_fabric"
}
Detailed parameter valuesβ
When the rule enables product details, the parameter targeting a product will contain a product object with more commercial data. That product object contains the same data found in a BOM object π, except for the following attributes:
children
parameters
recognizedBlock
uuid
packs
{
"seat_width": 120,
"finish": {
"dbID": "blue_fabric",
"reference": "blue_fabric",
"name": "Blue fabric",
"typeID": 1,
"freeTags": [],
"commercialDescription": "Blue fabric",
"shortDescription": "Blue fabric",
"thumbnailURLSmall": "url to thumbnail",
"startDate": null,
"endDate": null,
"isExpired": false,
"clientMetadata": null,
"priceMultiplier": 1,
"priceExtra": 0
}
}