📍 Bolt Help / Core Products / Accounts / Direct API / Select a New Payment Method for a Shopper's Account
Select a New Payment Method for a Shopper's Account
Learn how to enable shoppers to select from saved payment methods or add a new one while managing their account through your storefront.

Bolt’s embedded component library includes a component that enables shoppers to update their payment method from their merchant storefront account.

The component syncs with the shopper’s Bolt account to retrieve previously saved payment methods and addresses, and it can populate a newly added payment method or address back to their Bolt account.

Before You Start

These instructions assume that you:

Step 1: Install Script

Add the following script to the page where a shopper can manage their payment methods:

Embed.js

<script
    id="bolt-embed" 
    type="module" 
    src="{BASE_URL}/embed.module.js"
    data-publishable-key="{your-bolt-publishable-key}" 
    async
></script>
<script
    id="bolt-embed" 
    type="text/javascript" 
    src="{BASE_URL}/embed.js"
    data-publishable-key="{your-bolt-publishable-key}" 
    async
></script>
<script
    id="bolt-embed" 
    type="text/javascript" 
    src="{BASE_URL}/embed.js"
    data-publishable-key="{your-bolt-publishable-key}" 
></script>

Base URL

The Base URL ({BASE_URL}) should be one of the following, depending on the phase of your implementation process:

  • Production: connect.bolt.com
  • Sandbox: connect-sandbox.bolt.com

The value should replace {BASE_URL} in the script to create a full file string: connect.bolt.com/embed.module.js.

Publishable Key

Your Bolt Publishable Key ({your-bolt-publishable-key})can be found in the Merchant Dashboard. Go to the Developers tab, then scroll to Keys and find “Publishable Key.”

Step 2: Create an Instance of Bolt

const bolt = Bolt("<<my_publishable_key>>");

Step 3: Create Payment Selector Component

const selector = bolt.create("payment_selector");

Step 4: Update Payment Method for User



The appropriate page configuration depends on if you use Bolt SSO.

Merchants Using Bolt SSO

Click to expand.

Merchants Without Bolt SSO

Click to expand.



This component returns tokenized card information. You’ll need to handle how to apply this update to the user’s account.

Filter by Section
Filter by Topic