getCategory
Fetches a single Category by ID.
It receives data from the getCategory endpoint exposed by the BigCommerce API
Signature
declare function getCategory(
context: BigcommerceIntegrationContext,
params?: CategoryParameters
): Promise<CategoryResponse>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
context | Required | BigcommerceIntegrationContext | |
params | Optional | CategoryParameters |
Returns
Returns a response with the matching category data.
Referenced Types
Examples
Fetching category that matches the id from the query.
import { sdk } from '~/sdk.config.ts';
const category = await sdk.bigcommerce.getCategory({ categoryId: 1 });