You are reading the documentation for v7.x and earlier, which is no longer the latest version. Switch to v8.x
getTitles
Method fetching a list of all localized titles from SAP Commerce Cloud.
This method sends a GET request to the getTitles endpoint of the Alokai Middleware. In turn, it receives data from the getTitles endpoint exposed by the SAP OCC API Miscs Controller.
Signature
export declare function getTitles<Res extends TitleList = TitleList,
Props extends BaseProps = BaseProps>(
props?: Props,
options?: MethodOptions
): Promise<Res>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
props | Optional | 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 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 response fields.
import { sdk } from '~/sdk';
const category = await sdk.commerce.getTitles({ fields: 'titles(code)' });