You are reading the documentation for v7.x and earlier, which is no longer the latest version. Switch to v8.x
updateUserAddress
Method updating an existing customer address in SAP Commerce Cloud.
This method sends a POST request to the updateAddress endpoint of the Alokai Middleware. In turn, it exchanges data with the updateAddress endpoint exposed by the SAP OCC API Address 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 address param.
Signature
export declare function updateUserAddress<Props extends UpdateAddressProps = UpdateAddressProps>(
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 address.
import { sdk } from '~/sdk';
await sdk.commerce.updateUserAddress({
addressId: '8796879552535',
address: {
line1: 'Line 1'
}
});