Alokai

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

NameRequiredTypeDescription
contextRequiredBigcommerceIntegrationContext
paramsRequiredindex_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 });

On this page