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. πŸ”—If some pack were detected in the BOM, they will appear here.
productsArray of BOM object. πŸ”—This will contain the product currently loaded.
totalPriceThe 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 nameTypeContent
childrenArray of BOM object. πŸ”—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.
depthΒ ?numberOptional product current depth value.
endDateΒ ?stringOptional end date of the product availability (timestamp).
freeTagsArray of stringArray of free tags associated to the furniture.
heightΒ ?numberOptional product current height value.
isExpiredbooleanTrue if the product was expired at the time of BOM generation.
namestringProduct name.
packsArray 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.
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.
recognizedBlockΒ ?BOM object. πŸ”—The optional recognized block, if blocks are configured.
referencestringProduct reference.
shortDescriptionΒ ?stringOptional short description of the product.
startDateΒ ?stringOptional start date of the product availability (timestamp).
thumbnailURLSmallΒ ?stringOptional product thumbnail (size 64).
typeIDnumberProduct closed tag ID of the product.
uuidstringA unique random identifier for this instance of the product.
widthΒ ?numberOptional 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. πŸ”—The computed current price. Can be the same as the regular price.
discountTypestringThe type of the current price. "regular", "reduced", "discounted" or "membership"
ecoFeeΒ ?Price. πŸ”—The optional currently applied ecofee.
regularPrice. πŸ”—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 nameTypeContent
idstringThe identifier of the configuration set.
modestringThe mode associated to this price detail. "ADD" or "OVERRIDE"
namestringThe translated name of the configuration set. Can be the id if no translation is available.
configurationNamestringThe translated name of the matching configuration. Can be the id of the configuration if no translation is available.
referenceΒ ?stringThe 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 nameTypeContent
typestringThe type of the current price. "regular", "reduced", "discounted" or "membership"
valuenumberThe value for this price, without any multiplier applied.
startDateΒ ?stringThe optional date at which this price starts being available.
endDateΒ ?stringThe optional date at which this price availability ends.
info

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

Price​

The price is a Base price with additional attributes:

Attribute nameTypeContent
totalValuenumberThe 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 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.
startDateΒ ?stringThe optional date at which this price starts being available.
endDateΒ ?stringThe optional 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
}
}