Update customer sign-in settings
const url = 'https://apibase.ecomweb.app/api/v1/stores/example/settings/auth';const options = { method: 'PATCH', headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'}, body: '{"password_enabled":true,"google_enabled":true,"otp_enabled":true,"require_email_verification":true,"session_ttl_days":30,"password_min_length":8,"password_require_number":true,"password_require_symbol":true,"password_require_uppercase":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://apibase.ecomweb.app/api/v1/stores/example/settings/auth \ --header 'Content-Type: application/json' \ --header 'x-api-key: <x-api-key>' \ --data '{ "password_enabled": true, "google_enabled": true, "otp_enabled": true, "require_email_verification": true, "session_ttl_days": 30, "password_min_length": 8, "password_require_number": true, "password_require_symbol": true, "password_require_uppercase": true }'Changes the settings you send and leaves the rest as they are. At least one sign-in method must stay enabled, otherwise the call fails with 400 AUTH_METHOD_DISABLED. Turning a method off stops shoppers from using it to sign in. Changes apply to the storefront within moments.
Required scopes: write:settings
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The store’s ref, as returned by GET /stores.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Email + password sign-in
Google sign-in
One-time email code sign-in
Require a verified email address before first login
Example
30The minimum number of characters a shopper’s password must have. Must be at least 8.
Example
8Responses
Section titled “Responses”object
Whether shoppers can sign in with email and password.
Whether shoppers can sign in with Google.
Whether shoppers can sign in with a one-time code sent by email.
Whether a shopper must verify their email address before first sign-in.
How many days a shopper stays signed in.
How many minutes a shopper’s access token stays valid. Read-only: it cannot be changed through this API.
Minimum password length.
Whether a password must contain a digit.
Whether a password must contain a symbol.
Whether a password must contain an upper-case letter.
Example generated
{ "password_enabled": true, "google_enabled": true, "otp_enabled": true, "require_email_verification": true, "session_ttl_days": 1, "access_token_ttl_minutes": 1, "password_min_length": 1, "password_require_number": true, "password_require_symbol": true, "password_require_uppercase": true}The request is malformed or failed validation.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The key is missing, invalid, revoked or expired.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}