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

Stock notifications

Ask Subbly to email a customer when an item is back in stock.

subbly.stock.subscribe(payload)

Asks Subbly to email the customer when a product or a survey answer is back in stock. Watch for stockCount: 0 on a variant, a plan or an answer, and offer the alert there.

The shop must turn alerts on: shop.settings.outOfStockEnabled and shop.limits.outOfStock must both be true.

Method parameters

payloadRequiredStockSubscriptionPayload

What to watch, and where to send the alert.

ReturnsPromise<StockSubscriptionResponse>

The alert record.

Watch a variant
await subbly.stock.subscribe({ email: 'me@example.com', productId: 456, quantity: 1 })
Watch a survey answer
await subbly.stock.subscribe({ email: 'me@example.com', answerId: 789 })
Last modified on September 15, 2026
emailRequiredstring

Address the alert goes to.

productIdConditionally requirednumber

The variant or plan that ran out. Send this or answerId, not both.

answerIdConditionally requirednumber

The survey answer that ran out. Send this or productId, not both.

quantityoptionalnumber

How many units the customer wants.

idnumber

ID of the record.

shopIdnumber

The shop the record belongs to.

productIdnumber

The product being watched.

emailstring

Address the alert goes to.

quantitynumber

How many units the customer wants.

entityIdnumber

ID of the watched product or survey answer.

entityType'product' | 'survey_answer'

What is being watched.

inStockAtstring

When the item came back in stock. Empty until it does.

createdAtstring

When the record was created.

updatedAtstring

When the record last changed.

Javascript
Javascript