getCategory
Fetches a single Category by ID.
This method sends a GET request to the getCategory endpoint of the Vue Storefront API Middleware. In turn, it receives data from the getCategory endpoint exposed by the BigCommerce API
Signature
declare function getCategory$1(
props: CategoryParameters,
options?: MethodOptions
): Promise<CategoryResponse>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
props | Required | CategoryParameters | Parameter object which can be used with this method. Refer to its type definition to learn about possible properties. |
options | Optional | MethodOptions |
Returns
Returns a response with the matching category data.
Referenced Types
Examples
Fetching category that matches the id from the query. Sending it this way, the response can be cached safely.
import { sdk } from '~/sdk.config.ts';
const category = await sdk.bigcommerce.getCategory({ categoryId: 1 });