Passwordless Customer Login
Logging in customers via email link
Your application can send shoppers a one-time link via email that signs them in to their storefront account.
Use cases for this include:
- Reducing friction for customers, allowing them to proceed without needing to reset their passwords
- Providing an alternate method for signing in customers versus using the Customer Login API
Sending the request
Send a POST request to {store_url}/login.php?action=passwordless_login, where {store_url} is the storefront URL of the channel the customer belongs to.
The request body must be a JSON object. The endpoint reads only the raw JSON body; it ignores form-encoded fields and query string parameters other than action. Include the following properties:
email: The customer’s email address. This is where they receive the one-time login link. The address must belong to an existing customer account on the channel you send the request to.redirect_url: The page to send the customer to after they sign in. BigCommerce keeps only the path of this value and discards any scheme, domain, or query string. For example,https://example.com/cart.php?x=1becomes/cart.php. If you omit this property, the customer is redirected to/account.php.
Requests from a page with an active storefront session
If the request carries a storefront session cookie, for example when you send it from a theme script or an embedded checkout, the storefront also validates a CSRF token. Send the value of the SF-CSRF-TOKEN cookie in the X-Sf-Csrf-Token header. A request with a session cookie and a wrong token is redirected to /login.php with a 302 status, and no email is sent. A browser fetch call follows that redirect and resolves with a 200 HTML page, which is easy to mistake for success. Server-to-server requests that send no cookies skip this check.
Response
A 200 response means BigCommerce accepted the request and queued an email. Delivery is asynchronous, so the response does not confirm that the email reached the customer’s inbox. The response body contains:
sent_email: The type of email that was queued.sign_in: BigCommerce queued the one-time login link.reset_password: The customer’s account requires a password reset on next login, so BigCommerce queued the password reset email instead of a sign-in link. No sign-in link is sent in this case.
expiry: Forsign_in, the number of seconds the login link stays valid, normally900. Forreset_password, this value reflects the account’s login lockout timer rather than the reset email, and can be-2,-1, ornull. Do not rely on it for the reset flow.
Status codes
Rate limits
BigCommerce counts sign-in link requests per shopper session. Requests that send no session cookie share a single bucket, so run server-side tests with care.
Email text
The customer receives an email with the following default subject line:
The body of the email contains the following:
The link is single-use and expires 15 minutes after it is issued. Store owners can customize the subject and body in the control panel; see the Sign in Link Request email template for the available template variables.
Troubleshooting
If the POST returns 200 but the customer reports no email, check the following in order:
- The response says
reset_password. The customer received a “Password change request” email, not a sign-in link, because their account has Force password reset on next login enabled. Clear that setting on the customer record, or let the customer complete the reset. - The store is a new trial. Stores less than three weeks old have a store-wide limit on outgoing emails. When the limit is reached, the sign-in link request still returns
200but no email is queued. - The request never reached BigCommerce. A browser request from a page with a storefront session is redirected to the login page when its CSRF token is invalid, or missing on stores with strict validation. Inspect the network response: a successful request returns JSON, not HTML.
- Wrong channel. The account must exist on the channel whose storefront URL you call. A customer created on one storefront channel returns
404from another. - Deliverability. Ask the customer to check their spam folder, and confirm the store’s other transactional emails arrive.