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