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