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

Bundles

Read bundles, their items and groups, and price the items a customer picked.

Every method here takes an optional headers argument to price one call in another currency, and every amount is a whole number in the minor unit; see Currency and Amounts and dates.

A typical flow: load the bundle for its plans and rules, loadItems for what the customer can pick, quote to show the price, then subbly.cart.addItem to buy it.

subbly.bundles.list(params, headers?)

Gets a paginated list of the shop's bundles.

Method parameters

paramsRequiredBundleListParams

Paging and filters. Pass {} for the defaults โ€” the argument is required by position even though every field inside it is optional.

headersoptionalBundleRequestHeaders

Extra request headers.

ReturnsPromise<BundleListResponse>

One page of bundles.

List the bundles
const { data, pagination } = await subbly.bundles.list({})
List the configurable bundles with their plans
const { data } = await subbly.bundles.list({ perPage: 24, configurable: true, expand: ['plans.plan', 'plans.variant'], })

subbly.bundles.load(bundleId, params?, headers?)

Gets one bundle with its plans, prices, discounts, rulesets, filters and preferences โ€” everything the picker needs except the items themselves.

Method parameters

bundleIdRequirednumber

ID of the bundle.

paramsoptionalBundleResourceParams

Relations to include.

headersoptionalBundleRequestHeaders

Extra request headers.

x-currencyoptionalstring

Currency for the prices in the response.

ReturnsPromise<Bundle>

The bundle.

Load a bundle
const bundle = await subbly.bundles.load(512, { expand: ['plans.plan', 'plans.plan.parent'], })

subbly.bundles.loadItems(bundleId, params?, headers?)

Gets a paginated, filterable list of the products a customer can pick for the bundle. Send the picks to quote and to subbly.cart.addItem as { productId, quantity }.

Method parameters

bundleIdRequirednumber

ID of the bundle.

paramsoptionalBundleItemsParams

Paging, filters and relations.

headersoptionalBundleRequestHeaders

Extra request headers.

x-currencyoptionalstring

Currency for the prices in the response.

ReturnsPromise<BundleItemsResponse>

One page of bundle items.

Load the bundle items
const { data } = await subbly.bundles.loadItems(512, { perPage: 50, expand: ['product'], })
Filter the items by an attribute
const { data } = await subbly.bundles.loadItems(512, { filters: [{ attributeId: 9, values: [31, 32] }], })

subbly.bundles.loadGroups(bundleId, params?, headers?)

Gets the item groups of a bundle. A group gathers the variants of one product and sets its own minimum and maximum quantity, so a customer can be asked for, say, two coffees and one tea.

Method parameters

bundleIdRequirednumber

ID of the bundle.

paramsoptionalBundleGroupsParams

Paging and relations.

headersoptionalBundleRequestHeaders

Extra request headers.

x-currencyoptionalstring

Currency for the prices in the response.

ReturnsPromise<BundleGroupsResponse>

One page of groups.

Load the bundle groups
const { data } = await subbly.bundles.loadGroups(512, { expand: ['items.product'], })

subbly.bundles.quote(bundleId, payload, params?, headers?)

Prices a bundle for the exact items and preferences a customer picked, before it goes in the cart. Use it to show a running total in the picker.

Method parameters

bundleIdRequirednumber

ID of the bundle.

payloadRequiredBundleQuotePayload

What the customer picked. items and preferences are both required; send an empty array when the bundle has no preferences.

paramsoptionalBundleQuoteParams

Relations to include.

headersoptionalBundleRequestHeaders

Extra request headers.

x-currencyoptionalstring

Currency for the prices in the response.

ReturnsPromise<BundleQuote>

The priced bundle, with a line for every picked item.

Quote a bundle
const quote = await subbly.bundles.quote(512, { productId: 8801, quantity: 1, items: [ { productId: 3301, quantity: 2 }, { productId: 3307, quantity: 1 }, ], preferences: [], })
Last modified on September 15, 2026
pageoptionalnumber

Page to fetch, counting from 1.

perPageoptionalnumber

How many bundles per page.

tagsoptionalstring[]

Keep only bundles carrying these tags.

slugsoptionalstring[]

Keep only bundles with these slugs.

idsoptionalnumber[]

Keep only these bundle IDs.

digitaloptionalboolean

true keeps only digital bundles, false only physical ones.

configurableoptionalboolean

true keeps only bundles the customer configures, false only fixed ones.

expandoptionalstring[]

Relations to include: plans.variant, plans.variant.parent, plans.plan, plans.plan.parent and metadata.

x-currencyoptionalstring

Currency for the prices in the response, such as EUR.

dataBundle[]

The bundles on this page.

paginationPagination

Where this page sits in the list.

currentPagenumber

The page you are on, counting from 1.

fromnumber

Index of the first row on this page.

tonumber

Index of the last row on this page.

lastPagenumber

The number of pages.

totalnumber

The number of rows across every page.

Javascript
Javascript
expandoptionalstring[]

plans.variant, plans.variant.parent, plans.plan, plans.plan.parent and metadata.

idnumber

ID of the bundle.

namestring

Name of the bundle.

slugstring

URL-safe name. Filter on it with the slugs parameter of subbly.bundles.list.

descriptionstring | null

Description of the bundle.

deliveryInfostring | null

Delivery note the shop shows with the bundle.

digitalboolean

true when nothing is shipped.

searchableboolean

true when the bundle may appear in a listing.

configurableboolean

true when the customer picks the items. false means the contents are fixed.

hiddenItemsboolean

true when the shop hides the item list from the customer.

showRulesetNameboolean

true when the picker should show the ruleset name.

appearanceTypestring

How to lay the picker out: one_step, two_step, without_ruleset or after_checkout.

selectionTypestring

What the customer picks: variant, product or single_product.

rulesetTypestring

What a ruleset counts: total for money, quantity for items.

priceTypestring | null

How the bundle is priced: per_item or total. null when the plans set the price.

discountTypestring | null

How the bundle discount works: per_item, total or percentage.

quantitySelectorsnumber[] | null

The bundle quantities the customer may choose from.

imagesobject[]

Bundle images, each with id, url, order, createdAt and updatedAt.

plansBundlePlan[]

The ways to buy the bundle: a subscription plan or a one-time variant.

pricesobject[]

What the bundle costs at each size.

discountsobject[]

What comes off at each size.

rulesetsobject[]

The rules for how much the customer must pick.

filtersobject[]

The attribute filters for the item picker. Send the chosen ones as filters in subbly.bundles.loadItems.

preferencesobject[]

The preferences the customer answers for the bundle. Send the answers as preferences in subbly.bundles.quote and subbly.cart.addItem.

metadataMetafield[] | null

Metafield values on the bundle. The API sends them only when you ask for the metadata expand. The shape is on the Metafields page.

createdAtstring

When the bundle was created.

updatedAtstring

When the bundle last changed.

Javascript
pageoptionalnumber

Page to fetch, counting from 1.

perPageoptionalnumber

How many items per page.

filtersoptionalobject[]

Attribute filters, built from bundle.filters.

attributeIdRequirednumber

ID of the attribute, from bundle.filters[].attributeId.

valuesRequirednumber[]

IDs of the chosen values, from bundle.filters[].values[].id.

productIdsoptionalnumber[]

Keep only these variant IDs.

queryoptionalstring

Free-text search over the item names.

expandoptionalstring[]

product and product.parent.

dataBundleItem[]

The items on this page.

idnumber

ID of the bundle item.

productIdnumber

ID of the variant behind the item. Send it in the items of subbly.bundles.quote and subbly.cart.addItem.

productProductVariant

The variant itself. The API sends it only when you ask for the product expand. Its fields are on the Products page.

quantitynumber

How many of the variant one pick of this item gives.

extraPricenumber

What this item adds to the bundle price, in the minor unit of the currency.

positionnumber

Sort order in the picker.

stockCountnumber | null

How many are left. null means unlimited.

settingsobject[]

One entry per ruleset, holding the limit for this item under that ruleset.

idnumber

ID of the setting.

rulesetIdnumber

ID of the ruleset it applies to.

maxQuantitynumber

Most the customer may pick of this item.

createdAtstring

When the setting was created.

updatedAtstring

When the setting last changed.

createdAtstring

When the item was added to the bundle.

updatedAtstring

When the item last changed.

paginationPagination

Where this page sits in the list.

currentPagenumber

The page you are on, counting from 1.

fromnumber

Index of the first row on this page.

tonumber

Index of the last row on this page.

lastPagenumber

The number of pages.

totalnumber

The number of rows across every page.

Javascript
Javascript
pageoptionalnumber

Page to fetch, counting from 1.

perPageoptionalnumber

How many groups per page.

expandoptionalstring[]

product, items.product and items.product.parent.

dataBundleGroup[]

The groups on this page.

idnumber

ID of the group.

productIdnumber

ID of the product the group stands for.

productProductOneTime

The product itself. The API sends it only when you ask for the product expand. Its fields are on the Products page.

minQuantitynumber

Fewest items the customer must pick from this group.

maxQuantitynumber

Most items the customer may pick from this group.

itemsBundleItem[]

The items in the group. The API sends them only when you ask for the items.product expand.

idnumber

ID of the bundle item.

productIdnumber

ID of the variant behind the item. Send it in the items of subbly.bundles.quote and subbly.cart.addItem.

productProductVariant

The variant itself. The API sends it only when you ask for the product expand. Its fields are on the Products page.

quantitynumber

How many of the variant one pick of this item gives.

extraPricenumber

What this item adds to the bundle price, in the minor unit of the currency.

positionnumber

Sort order in the picker.

stockCountnumber | null

How many are left. null means unlimited.

settingsobject[]

One entry per ruleset, holding the limit for this item under that ruleset.

createdAtstring

When the item was added to the bundle.

updatedAtstring

When the item last changed.

createdAtstring

When the group was created.

updatedAtstring

When the group last changed.

paginationPagination

Where this page sits in the list.

Javascript
productIdRequirednumber

The plan or variant the customer chose, from bundle.plans[].plan.id or bundle.plans[].variant.id.

quantityRequirednumber

How many bundles.

itemsRequiredobject[]

The picked items.

productIdRequirednumber

ID of the picked variant, from bundleItem.productId.

quantityRequirednumber

How many of it.

preferencesRequiredobject[]

The answers to the bundle preferences. Send [] when there are none.

attributeIdRequirednumber

ID of the attribute, from bundle.preferences[].attributeId.

valuesRequirednumber[]

IDs of the chosen values.

expandoptionalstring[]

items.product and items.product.parent.

productIdnumber

ID of the plan or variant priced.

productProduct

The plan or variant itself. Its fields are on the Products page.

quantitynumber

How many bundles.

pricenumber

Unit price of the bundle, in the minor unit of the currency.

subTotalnumber

Price before discount and tax.

totalnumber

What the customer pays.

discountnumber

Amount taken off.

taxAmountnumber

Tax on the bundle.

taxRatenumber

Tax rate used.

taxInclusivenumber

Whether price already contains the tax. The type says number here and boolean on the items below; treat it as a flag.

itemsobject[]

One entry per picked item, priced.

productIdnumber

ID of the variant.

productProductVariant

The variant itself.

quantitynumber

How many.

pricenumber

Unit price.

subTotalnumber

Price before discount and tax.

totalnumber

What this item adds.

discountboolean

Amount taken off. The type says boolean here and number on the bundle above; treat it as an amount.

taxAmountnumber

Tax on this item.

taxRatenumber

Tax rate used.

taxInclusiveboolean

true when price already contains the tax.

Javascript
idnumber

ID of the bundle.

namestring

Name of the bundle.

slugstring

URL-safe name. Filter on it with the slugs parameter of subbly.bundles.list.

descriptionstring | null

Description of the bundle.

deliveryInfostring | null

Delivery note the shop shows with the bundle.

digitalboolean

true when nothing is shipped.

searchableboolean

true when the bundle may appear in a listing.

configurableboolean

true when the customer picks the items. false means the contents are fixed.

hiddenItemsboolean

true when the shop hides the item list from the customer.

showRulesetNameboolean

true when the picker should show the ruleset name.

appearanceTypestring

How to lay the picker out: one_step, two_step, without_ruleset or after_checkout.

selectionTypestring

What the customer picks: variant, product or single_product.

rulesetTypestring

What a ruleset counts: total for money, quantity for items.

priceTypestring | null

How the bundle is priced: per_item or total. null when the plans set the price.

discountTypestring | null

How the bundle discount works: per_item, total or percentage.

quantitySelectorsnumber[] | null

The bundle quantities the customer may choose from.

imagesobject[]

Bundle images, each with id, url, order, createdAt and updatedAt.

plansBundlePlan[]

The ways to buy the bundle: a subscription plan or a one-time variant.

pricesobject[]

What the bundle costs at each size.

discountsobject[]

What comes off at each size.

rulesetsobject[]

The rules for how much the customer must pick.

filtersobject[]

The attribute filters for the item picker. Send the chosen ones as filters in subbly.bundles.loadItems.

preferencesobject[]

The preferences the customer answers for the bundle. Send the answers as preferences in subbly.bundles.quote and subbly.cart.addItem.

metadataMetafield[] | null

Metafield values on the bundle. The API sends them only when you ask for the metadata expand. The shape is on the Metafields page.

createdAtstring

When the bundle was created.

updatedAtstring

When the bundle last changed.

idnumber

ID of the bundle plan. Use it to match prices and discounts.

planProductPlan | null

The subscription plan. Set for a subscription bundle. Pass its id as productId when you quote or add the bundle. Its fields are on the Products page.

variantProductVariant | null

The one-time variant. Set for a one-time bundle. Pass its id as productId when you quote or add the bundle.

pricingProductPlan | null

Old name for plan. Read plan instead.

pricesBundlePrice[]

Prices for this plan, per ruleset. Same shape as prices below.

discountsBundleDiscount[]

Discounts for this plan, per ruleset. Same shape as discounts below.

createdAtstring

When the plan was added.

updatedAtstring

When the plan last changed.

idnumber

ID of the price.

planIdnumber

ID of the bundle plan it belongs to.

rulesetIdnumber

ID of the ruleset it belongs to.

rangesobject[]

One entry per size. Each carries range, the size, and amount, the price at that size in the minor unit of the currency.

createdAtstring

When the price was created.

idnumber

ID of the discount.

planIdnumber

ID of the bundle plan it belongs to.

rulesetIdnumber

ID of the ruleset it belongs to.

rangesobject[]

One entry per size. Each carries range, the size, and then amountOff or percentOff.

createdAtstring

When the discount was created.

updatedAtstring

When the discount last changed.

idnumber

ID of the ruleset.

namestring

Name of the ruleset.

ctaTextstring | null

Text for the call-to-action button.

minQuantitynumber

Fewest items the customer may pick.

maxQuantitynumber

Most items the customer may pick.

minTotalnumber

Smallest total the picks may reach, in the minor unit of the currency.

maxTotalnumber

Largest total the picks may reach.

productsParentProduct[]

The products this ruleset covers. Their fields are on the Products page.

createdAtstring

When the ruleset was created.

updatedAtstring

When the ruleset last changed.

idnumber

ID of the filter.

namestring

Label to show.

attributeIdnumber

ID of the attribute. Pass it as attributeId.

valuesobject[]

The values to offer, each with id and value. Pass the chosen ids.

createdAtstring

When the filter was created.

updatedAtstring

When the filter last changed.

idnumber

ID of the preference.

titlestring

Question to show.

attributeIdnumber

ID of the attribute. Pass it as attributeId.

valuesobject[]

The answers to offer, each with id and value. Pass the chosen ids.

createdAtstring

When the preference was created.

updatedAtstring

When the preference last changed.

idnumber

ID of the setting.

rulesetIdnumber

ID of the ruleset it applies to.

maxQuantitynumber

Most the customer may pick of this item.

createdAtstring

When the setting was created.

updatedAtstring

When the setting last changed.

currentPagenumber

The page you are on, counting from 1.

fromnumber

Index of the first row on this page.

tonumber

Index of the last row on this page.

lastPagenumber

The number of pages.

totalnumber

The number of rows across every page.

idnumber

ID of the bundle plan. Use it to match prices and discounts.

planProductPlan | null

The subscription plan. Set for a subscription bundle. Pass its id as productId when you quote or add the bundle. Its fields are on the Products page.

variantProductVariant | null

The one-time variant. Set for a one-time bundle. Pass its id as productId when you quote or add the bundle.

pricingProductPlan | null

Old name for plan. Read plan instead.

pricesBundlePrice[]

Prices for this plan, per ruleset. Same shape as prices below.

discountsBundleDiscount[]

Discounts for this plan, per ruleset. Same shape as discounts below.

createdAtstring

When the plan was added.

updatedAtstring

When the plan last changed.

idnumber

ID of the price.

planIdnumber

ID of the bundle plan it belongs to.

rulesetIdnumber

ID of the ruleset it belongs to.

rangesobject[]

One entry per size. Each carries range, the size, and amount, the price at that size in the minor unit of the currency.

createdAtstring

When the price was created.

idnumber

ID of the discount.

planIdnumber

ID of the bundle plan it belongs to.

rulesetIdnumber

ID of the ruleset it belongs to.

rangesobject[]

One entry per size. Each carries range, the size, and then amountOff or percentOff.

createdAtstring

When the discount was created.

updatedAtstring

When the discount last changed.

idnumber

ID of the ruleset.

namestring

Name of the ruleset.

ctaTextstring | null

Text for the call-to-action button.

minQuantitynumber

Fewest items the customer may pick.

maxQuantitynumber

Most items the customer may pick.

minTotalnumber

Smallest total the picks may reach, in the minor unit of the currency.

maxTotalnumber

Largest total the picks may reach.

productsParentProduct[]

The products this ruleset covers. Their fields are on the Products page.

createdAtstring

When the ruleset was created.

updatedAtstring

When the ruleset last changed.

idnumber

ID of the filter.

namestring

Label to show.

attributeIdnumber

ID of the attribute. Pass it as attributeId.

valuesobject[]

The values to offer, each with id and value. Pass the chosen ids.

createdAtstring

When the filter was created.

updatedAtstring

When the filter last changed.

idnumber

ID of the preference.

titlestring

Question to show.

attributeIdnumber

ID of the attribute. Pass it as attributeId.

valuesobject[]

The answers to offer, each with id and value. Pass the chosen ids.

createdAtstring

When the preference was created.

updatedAtstring

When the preference last changed.