Alokai
You are reading the documentation for v7.x and earlier, which is no longer the latest version. Switch to v8.x

getBaseStore

Method fetching details of a specific Base Store from SAP Commerce Cloud.

This method sends a GET request to the getBaseStore endpoint of the Alokai Middleware. In turn, it receives data from the getBaseStore endpoint exposed by the SAP OCC API Base Stores Controller.

The param is optional. If not provided, the method will fall back to either baseStoreUid or baseSiteId provided in middleware.config.js.

Signature

export declare function getBaseStore<Res extends BaseStore = BaseStore,
	Props extends GetBaseStoreProps = GetBaseStoreProps>(
	props?: Props,
	options?: MethodOptions
): Promise<Res>;

Parameters

NameRequiredTypeDescription
propsOptionalPropsParameter object which can be used with this method. Refer to its type definition to learn about possible properties.
optionsOptionalMethodOptionsOptions that can be passed to additionally configure the request or customize the logic in a plugin.

Returns

Returns a representation of a Base Store.

Referenced Types

Examples

Calling the method without any params and letting it fall back to either baseStoreUid or baseSiteId provided in middleware.config.js

import { sdk } from '~/sdk';

const category = await sdk.commerce.getBaseStore();

Calling the method with the param to explicitly choose the desired Base Store.

import { sdk } from '~/sdk';

const category = await sdk.commerce.getBaseStore({ baseStoreUid: 'electronics' });

Fetching details of a specific Base Store and selecting response fields.

import { sdk } from '~/sdk';

const category = await sdk.commerce.getBaseStore({ fields: 'defaultCurrency(isocode),currencies(isocode)' });

On this page