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

getTitles

Get list of all localized titles from SAP Commerce Cloud.

This method receives data from the getTitles endpoint exposed by the SAP OCC API Miscs Controller.

Signature

export declare function getTitles(
	context: SapccIntegrationContext,
	props?: BaseProps
): Promise<TitleList>;

Parameters

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

Returns

Returns a representation of a Title List.

Referenced Types

Examples

Fetching a list of all localized titles.

import { sdk } from '~/sdk';

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

Using the method the way it will be possible to cache the response.

import { sdk } from '~/sdk';

const category = await sdk.commerce.getTitles({ lang: 'en', currency: 'GBP' });

Fetching a list of all localized titles and selecting fields.

import { sdk } from '~/sdk';

const category = await sdk.commerce.getTitles({ fields: 'titles(code)' });

On this page