Alokai

getProductsById

Method fetching products by ids.

This method sends a GET request to the getProductsById endpoint of the Vue Storefront API Middleware. In turn, it receives data from the BigCommerce getProductsById GraphQL API.

Signature

declare function getProductsById(
	props: index_d_exports$1.GetProductsByIdParameters,
	options?: MethodOptions
): Promise<index_d_exports$1.ProductsResponse>;

Parameters

NameRequiredTypeDescription
propsRequiredindex_d_exports$1.GetProductsByIdParametersParameter object which can be used with this method. Refer to its type definition to learn about possible properties.
optionsOptionalMethodOptions

Returns

Returns a response with the matching products data.

Examples

Fetching product data. Sending it this way, the response can be cached safely.

import { sdk } from '~/sdk.config.ts';

const products = await sdk.bigcommerce.getProductsById({ ids: ['77'] });

On this page