Skip to content

Update customer sign-in settings

PATCH
/stores/{storeRef}/settings/auth
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

storeRef
required
string

The store’s ref, as returned by GET /stores.

Media typeapplication/json
object
password_enabled

Email + password sign-in

boolean
google_enabled

Google sign-in

boolean
otp_enabled

One-time email code sign-in

boolean
require_email_verification

Require a verified email address before first login

boolean
session_ttl_days
number
>= 1 <= 365

Example

30
password_min_length

The minimum number of characters a shopper’s password must have. Must be at least 8.

number
>= 8 <= 128

Example

8
password_require_number
boolean
password_require_symbol
boolean
password_require_uppercase
boolean
Media typeapplication/json
object
password_enabled
required

Whether shoppers can sign in with email and password.

boolean
google_enabled
required

Whether shoppers can sign in with Google.

boolean
otp_enabled
required

Whether shoppers can sign in with a one-time code sent by email.

boolean
require_email_verification
required

Whether a shopper must verify their email address before first sign-in.

boolean
session_ttl_days
required

How many days a shopper stays signed in.

number
access_token_ttl_minutes
required

How many minutes a shopper’s access token stays valid. Read-only: it cannot be changed through this API.

number
password_min_length
required

Minimum password length.

number
password_require_number
required

Whether a password must contain a digit.

boolean
password_require_symbol
required

Whether a password must contain a symbol.

boolean
password_require_uppercase
required

Whether a password must contain an upper-case letter.

boolean

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.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key is missing, invalid, revoked or expired.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

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.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}