updateAddress
Updates a saved address of the signed-in customer by address id.
This method communicates with the updateAddress endpoint of the Vue Storefront API Middleware. In turn, it receives data from the updateCustomerAddress or the Update customer address endpoints exposed by SCAPI / OCAPI depending on the middleware configuration.
Signature
export declare function updateAddress(
props: CustomerUpdateAddressParams
): Promise<import("commerce-sdk/dist/customer/customer").ShopperCustomers.CustomerAddress>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
props | Required | CustomerUpdateAddressParams | 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 Customer Address.
Referenced Types
CustomerUpdateAddressParamsShopperCustomers.CustomerAddress
Examples
Updates an existing saved customer address.
import { sdk } from '~/sdk.config.ts';
const category = await sdk.commerce.updateAddress({
addressId: 'Home',
countryCode: 'US',
});