📍 Bolt Help / Core Products / Embedded Accounts / Enable Bolt Account Detection

Enable Bolt Account Detection

Check whether the shopper has an existing Bolt Account for the inputted shopper information, such as email address. Embedded Checkout displays upon recognizing a shopper with a Bolt account.

Embedded Checkout can detect shoppers when they enter either an email address or a phone number associated with their account. At minimum, Bolt recommends that you configure an email address input field.

Check for a Bolt Account

To check whether a shopper has an existing Bolt Account, you can either use Bolt’s front-end detect account component or the Detect Account API.

Detect Account Component

Call the account detection function to check whether a Bolt account exists for a shopper:

let hasAccountResponse = await authorizeComponent.hasAccount({email: $email});  
// hasAccountResponse returns a boolean value that indicates whether a  Bolt account exists for this email

Detect Account Endpoint

Send a GET request to https://api.bolt.com/v1/account/exists to check whether a Bolt account exists for a user. We recommend making this call from the browser.

async function accountExists(email) {
	const response = await fetch("https://api-sandbox.bolt.com/v1/account/exists?email=" +
		encodeURIComponent(email));
	const responseAsJson = await response.json();
	return responseAsJson.has_bolt_account;
}

Success Response

{
    "has_bolt_account": true,
    ...
}

Error Response

{ 
	"result": { 
    	"success": false 
	}, 
	"errors": [{ 
      	"code": 1005, 
      	"message": "Authentication error. Invalid merchant key." 
	}] 
} 

Next Step in Shopper Flow

  • On Success + True: Authorize the shopper, retrieve shopper data, then open the Bolt Checkout modal using the embed.js script previously installed.
  • On Success + False: Send the shopper to your guest checkout experience.
  • On Failure: Send the shopper to your guest checkout experience.

Next Step in Implementation

After you enable Bolt Account Detection, you will implement the Authorization Modal. This is a Front End Embedded Component that enables shoppers with a Bolt account to log in via the One-Time Password modal.

📖On This Page
Filter by Section
Filter by Topic