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

getBaseStore

Fetch details of a specific Base Store from SAP Commerce Cloud.

This method 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(
	context: SapccIntegrationContext,
	props?: GetBaseStoreProps
): Promise<BaseStore>;

Parameters

NameRequiredTypeDescription
contextRequiredSapccIntegrationContext
propsOptionalGetBaseStorePropsParameter object which can be used with this method. Refer to its type definition to learn about possible properties.

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 baseStoreUid 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