SubblySubbly
Log inGet started
  • Get started
  • Developer resources
Subbly.js SDK reference
Docs
Information
    CookiesAmounts and datesCurrencyExpand parametersErrors
Setup
    Start the SDKSet the currencySet the languageVersionConfiguration
Addresses
    List the addressesAdd an addressDelete an address
Authentication
    Authentication stateCheck the authenticationLog in with a passwordRegister a customerCheck if an email is registeredSend a one-time passwordLog in with a one-time passwordLog in with single sign-onLog outGet the access token
Bundles
    List the bundlesLoad a bundleLoad the bundle itemsLoad the bundle groupsQuote a bundle
Cart
    Create a cartLoad a cartUpdate the cartAdd an itemUpdate an itemRemove an itemGet the start datesGet the gifting datesGet the shipping methodsGet the pick-up pointsAttach the customer
Checkout
    Purchase the cart
Countries
    List the countries
Customers
    Get the customer profileUpdate the customerGet the referral link
Funnels
    Get a pre-purchase offerAccept a pre-purchase offerSkip a pre-purchase offerReset the pre-purchase offersGet a mid-purchase offerAccept a mid-purchase offerSkip a mid-purchase offerGet a post-purchase offerAccept a post-purchase offerSkip a post-purchase offer
Leads
    Capture a lead
Metafields
    List the metafields
Payment intents
    Get a payment intentConfirm a payment intent
Pick-up info
    List the pick-up infosAdd a pick-up infoDelete a pick-up info
Products
    List the productsLoad a productLoad a variantLoad a plan
Shop
    Load the shop
Stock notifications
    Get a back-in-stock alert
Subscriptions
    List the subscriptionsLoad a subscriptionUpdate a subscriptionUpdate the survey preferencesUpdate the bundleLoad a subscription itemUpdate a subscription itemUpdate an item bundleUpdate the item survey preferences
Surveys
    Load a survey
Wallet
    List the payment methodsStart a payment setupAdd a payment methodStart a 3-D Secure setup

Leads

Save an email address as a lead before checkout.

subbly.lead.subscribe(payload)

Saves an email address as a lead. Use it to catch an address early, such as on a newsletter box or the first step of a survey, before the customer reaches checkout.

Method parameters

payloadRequiredLeadSubscribePayload

The lead to save.

ReturnsPromise<LeadSubscribeResponse>

The lead record Subbly saved.

Capture a lead
const lead = await subbly.lead.subscribe({ email: 'me@example.com', firstName: 'Ada', metadata: { source: 'footer-form' } })
Last modified on September 15, 2026
emailRequiredstring

Email address of the lead.

firstNameoptionalstring | null

Given name of the lead.

lastNameoptionalstring | null

Family name of the lead.

metadataoptionalRecord<string, any>

Your own data to keep with the lead, such as the page it came from.

idnumber

ID of the lead.

emailstring

The email address saved.

firstNamestring | null

Given name of the lead.

lastNamestring | null

Family name of the lead.

ipAddressstring

IP address Subbly saw on the request.

userAgentstring

Browser Subbly saw on the request.

Javascript