getProductsByCategory
Fetches products by the category id.
It receives data from the BigCommerce getProductsByCategory GraphQL API.
Signature
declare function getProductsByCategory(
context: BigcommerceIntegrationContext,
params: GetProductsByCategoryParameters
): Promise<ProductsResponse>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
context | Required | BigcommerceIntegrationContext | |
params | Required | GetProductsByCategoryParameters |
Returns
Returns a response with the matching products data.
Referenced Types
Examples
Fetching products data by category id.
import { sdk } from '~/sdk.config.ts';
const products = await sdk.bigcommerce.getProductsByCategory({ entityId: 77 });