You are reading the documentation for v7.x and earlier, which is no longer the latest version. Switch to v8.x
updateUser
Method updating a customer profile in SAP Commerce Cloud.
This method sends a POST request to the updateUser endpoint of the Alokai Middleware. In turn, it exchanges data with the updateUser endpoint exposed by the SAP OCC API Users Controller.
This method works only in an authenticated user session (i.e. when the vsf-sap-token cookie is present in the browser). It only updates the fields provided in the user param.
Bear in mind the SAP OCC API updateUser endpoint does not allow for updating customer uid (login) and so does not this method.
You might also want to see the updateAndGetUser method.
Signature
export declare function updateUser<Props extends UpdateUserProps = UpdateUserProps>(
props: Props,
options?: MethodOptions
): Promise<void>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
props | Required | 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
This method does not return anything.
Referenced Types
Examples
Updating a customer profile.
import { UpdateUserProps } from '@vsf-enterprise/sapcc-types';
import { sdk } from '~/sdk';
const props: UpdateUserProps = {
user: {
firstName: 'John',
lastName: 'Doe'
}
}
await sdk.commerce.updateUser(props);