You are reading the documentation for v7.x and earlier, which is no longer the latest version. Switch to v8.x
getOrgProduct
Fetch details of a single product from SAP Commerce Cloud in the B2B channel.
This method receives data from the getOrgProduct endpoint exposed by the SAP OCC API B2b Products Controller.
Signature
export declare function getOrgProduct(
context: SapccIntegrationContext,
props: ProductGetProps
): Promise<Product>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
context | Required | SapccIntegrationContext | |
props | Required | ProductGetProps | Parameter object which can be used with this method. Refer to its type definition to learn about possible properties. |
Returns
Returns a representation of a Product.
Referenced Types
Examples
Fetching a product by its code (passed as the id parameter).
import { sdk } from '~/sdk';
const product = await sdk.commerce.getOrgProduct({ id: '1992695' });Using the method the way it will be possible to cache the response.
import { sdk } from '~/sdk';
const product = await sdk.commerce.getOrgProduct({ id: '1992695', lang: 'en', currency: 'GBP' });Fetching a product and selecting response fields.
import { sdk } from '~/sdk';
const product = await sdk.commerce.getOrgProduct({ id: '1992695', fields: 'BASIC' });