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
| Name | Required | Type | Description |
|---|---|---|---|
context | Required | BigcommerceIntegrationContext | |
props | Required | GetProductReviewCollectionProps | |
query | Optional | GetProductReviewCollectionQuery |
Returns
Returns a response with the product reviews
Referenced Types
- BigcommerceIntegrationContext
- GetProductReviewCollectionProps
- GetProductReviewCollectionQuery
- ProductReviewCollectionResponse
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'
});