You are reading the documentation for v7.x and earlier, which is no longer the latest version. Switch to v8.x
getCostCenters
Fetch Active Cost Centers list from SAP Commerce Cloud in the B2B channel.
This method sends a POST request to the getCostCenters endpoint of the Alokai Middleware. In turn, it receives data from the getCostCenters endpoint exposed by the SAP OCC API B2B Cost Centers Controller.
Signature
export declare function getCostCenters<Res extends B2BCostCenterList = B2BCostCenterList,
Props extends GetCostCentersProps = GetCostCentersProps>(
props: Props,
options?: MethodOptions
): Promise<Res>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
props | Required | Props | Parameter object which can be used with this method. Refer to its type definition to learn about possible properties. |
options | Optional | MethodOptions | Options that can be passed to additionally configure the request or customize the logic in a plugin. |
Returns
Returns a representation of a B2BCostCenterList.
Referenced Types
- B2BCostCenterList
GetCostCentersProps- MethodOptions
Examples
Fetching active cost centers with optional parameters
import { sdk } from '~/sdk';
const costCenters = await sdk.commerce.getCostCenters({ sort: "byCode", pageSize: 10 });