Alokai

getProductReviewCollection

Fetches reviews of a product

It receives data from the getProductReviewCollection endpoint exposed by the BigCommerce API

Signature

declare function getProductReviewCollection(
	context: BigcommerceIntegrationContext,
	props: GetProductReviewCollectionProps,
	query?: GetProductReviewCollectionQuery
): Promise<ProductReviewCollectionResponse>;

Parameters

NameRequiredTypeDescription
contextRequiredBigcommerceIntegrationContext
propsRequiredGetProductReviewCollectionProps
queryOptionalGetProductReviewCollectionQuery

Returns

Returns a response with the product reviews

Referenced Types

Examples

Fetching reviews for a product and passing an optional exclude_fields property to exclude the review titles from the response.

import { sdk } from '~/sdk.config.ts';

const getProductReviewCollectionResponse = await sdk.bigcommerce.getProductReviewCollection({
 productId: 132,
 exclude_fields: 'title'
});

On this page