Alokai

customerChangePassword

Change customer password.

It sends a request to commercetools GraphQL API to change the customer's password based on the Password Flow.

By default, it uses the customerChangeMyPasswordDefaultQuery GraphQL query

Signature

declare function customerChangePassword(
	context: CommercetoolsIntegrationContext,
	version: string,
	currentPassword: string,
	newPassword: string
): Promise<CustomerChangeMyPasswordResponse>;

Parameters

NameRequiredTypeDescription
contextRequiredCommercetoolsIntegrationContext
versionRequiredstring
currentPasswordRequiredstring
newPasswordRequiredstring

Returns

Returns a representation of the CustomerChangeMyPasswordResponse.

Referenced Types

Examples

This example shows how to change the customer's password:

// Change password
await sdk.commerce.customerChangePassword(user.version, 'current_password', 'new_password');

On this page