Home > widget-integration > ProductAPI

ProductAPI class

API service for fetching product details used in Quick View modal.

Returns pre-rendered HTML from server including product images, variant swatches, price display, and add to cart functionality.

Signature:

export declare class ProductAPI extends BoostAPI 

Extends: BoostAPI

Example

Extend to add custom query parameters:

window.boostWidgetIntegration.extend('ProductAPI', (ProductAPI) => {
  return class CustomProductAPI extends ProductAPI {
    protected buildQuickViewQueryParams(params) {
      const enhanced = super.buildQuickViewQueryParams(params);
      const customer = this.platformLoader.platform.customer;
      if (customer?.tags?.includes('wholesale')) {
        enhanced.pricing_tier = 'wholesale';
      }
      return enhanced;
    }
  };
});

Constructors

Constructor

Modifiers

Description

(constructor)(platformLoader, appService, b2bService)

Constructs a new instance of the ProductAPI class

Properties

Property

Modifiers

Type

Description

appService

protected

AppService

b2bService

protected

B2BService

platformLoader

protected

PlatformLoader

Methods

Method

Modifiers

Description

buildQuickViewQueryParams(params)

protected

getProductDetail(params)