Skip to main content

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 nameInput / OutputPayloadReason
getBomInput eventNone.Request the BOM for the current state.
bomOutput eventSee 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 nameTypeContent
packsArray of BOM object data. πŸ”—If some pack were detected in the BOM, they will appear here.
productsArray of BOM object data. πŸ”—This will contain the product currently loaded.
totalPriceThe Total price data. πŸ”—This object contains the total price of the current product.

BOM Object data​

This is the description of a product or sub product.

Attribute nameTypeContent
childrenArray of BOM object data. πŸ”—Sub products of this product.
clientMetadataanyClient metadata for this product.
commercialDescriptionstringCommercial description.
dbIDstringIdentifier of this product in the database. If you load the same product multiple times, the dbid will be the same.
depthnumber?Product current depth value.
endDatestring?End date of the product availability (timestamp).
freeTagsArray of stringArray of free tags associated to the furniture.
heightnumber?Product current height value.
isExpiredbooleanTrue if the product was expired at the time of BOM generation.
namestringProduct name.
packsArray of BOM object data. πŸ”—See packs description. πŸ”—
parametersOptional Parameter values. πŸ”—The optional list of parameters applied on this product.
priceOptional Product price. πŸ”—An optional price for this product.
priceExtranumberAn optional value to add to the price. All values are valid, even negative one (to reduce the total price).
priceMultipliernumberA multiplier to apply to the price. It should be >= 0. 0 would put all prices to 0.
recognizedBlockOptional BOM object data. πŸ”—The recognized block, if blocks are configured.
referencestringProduct reference.
shortDescriptionstring?Short description of the product.
startDatestring?Start date of the product availability (timestamp).
thumbnailURLSmallstring?Product thumbnail (size 64).
typeIDnumberProduct closed tag ID of the product.
uuidstringA unique random identifier for this instance of the product.
widthnumber?Product current width value.

Dimensions​

info

The depth, height and width attributes contains:

Product price​

This is the description of the price of a product. It contains the following attributes:

Attribute nameTypeContent
currentPrice Data. πŸ”—The computed current price. Can be the same as the regular price.
discountTypestringThe type of the current price. "regular", "reduced", "discounted" or "membership"
ecoFeeOptional Price Data. πŸ”—The current applied ecofee.
regularPrice Data. πŸ”—The computed regular price.

Price data​

This is the description of a price.

Attribute nameTypeContent
totalValuenumberThe value for this price once any multiplier or price extra is applied.
typestringThe type of the current price. "regular", "reduced", "discounted" or "membership"
valuenumberThe value for this price, without any multiplier applied.
startDatestring?Optional. The date at which this price starts being available.
endDatestring?Optional. The date at which this price availability ends.
info

The start and end date format should follow the Date time string format. πŸ”—

Total price​

This is the description of the total price of the current product.

Attribute nameTypeContent
currencystringThe currency to use, a 3 letters string following ISO 4217 πŸ”—
currentnumberThe computed current price. Can be the same as the regular price.
discountTypestringThe discount type of the current price. "regular", "reduced", "discounted" or "membership"
regularnumberThe computed regular price.
startDatestring?Optional. The date at which this price starts being available.
endDatestring?Optional. The date at which this price availability ends.
info

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 nameTypeContent
quantitynumberNumber 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.
info

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
}
}