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

getOrgUser

Fetch a B2B customer profile from SAP Commerce Cloud.

This method exchanges data with the getOrgUser endpoint exposed by the SAP OCC API Users Controller.

The method fetches a customer profile based on the vsf-sap-token cookie (which is assigned to that customer). The cookie must be present in the request for the method to work properly.

Signature

export declare function getOrgUser(
	context: SapccIntegrationContext,
	props?: BaseProps & BaseUserId
): Promise<User>;

Parameters

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

Returns

Returns a representation of a User.

Referenced Types

Examples

Fetching a customer profile.

import { sdk } from '~/sdk';

const user = await sdk.commerce.getOrgUser();

Fetching a customer profile and selecting response fields.

import { sdk } from '~/sdk';

const user = await sdk.commerce.getOrgUser({ fields: 'uid,firstName' });

On this page