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

Cart

Create and change the cart, and read the delivery options and dates for it.

subbly.cart is both the data and the methods. It carries every cart field straight on the object โ€” subbly.cart.id, subbly.cart.items, subbly.cart.total โ€” and the methods below change it. Each of those methods copies the response onto the same object and resolves with it, so the value you await and subbly.cart are one and the same. There is only ever one cart per SDK instance, and fields the response leaves out keep their old values.

Amounts are whole numbers in the minor unit of the cart currency; see Amounts and dates.

Most methods take an optional params.expand list; the values it accepts are under Expand parameters.

subbly.cart.create(payload?, params?)

Creates a new cart and stores its ID in the subbly_cart_id cookie for 365 days. It replaces whatever cart the SDK already held, so call it once, and use subbly.cart.load to come back to a cart you already have.

The cookie is a plain one on path=/, with no Secure, HttpOnly or SameSite attribute.

Method parameters

payloadoptionalCartCreatePayload

What the new cart starts with. Pass null or leave it out for an empty cart. The TypeScript type is the wider update payload, but the create endpoint reads only the four fields below; set anything else with subbly.cart.update afterwards.

paramsoptionalCartResourceParams

Relations to include.

expandoptionalstring[]

The relations to fill in. The values are listed at the top of this page.

ReturnsPromise<CartModel>

The cart, which is subbly.cart itself.

Create a cart
const cart = await subbly.cart.create()
Create a cart in a currency, with a coupon
const cart = await subbly.cart.create( { currencyCode: 'EUR', couponCode: 'WELCOME10' }, { expand: ['coupon', 'items.product'] }, )

subbly.cart.load(cartId?, params?)

Loads a cart by ID into subbly.cart. Leave the ID out to refresh the cart the SDK already holds.

Unlike create, this does not write the cookie. Subbly.init writes it itself after a successful load.

Method parameters

cartIdoptionalstring

UUID of the cart. Leave it out to reload the cart already held. With no ID and no cart held, the call throws Error('Cart ID is required') at once, without reaching the network.

paramsoptionalCartResourceParams

Relations to include.

expandoptionalstring[]

The relations to fill in. The values are listed at the top of this page.

ReturnsPromise<CartModel>

The cart, which is subbly.cart itself. Its fields are written out under Create a cart.

Load a cart by ID
const cart = await subbly.cart.load('aaea067c-6364-4157-82e9-71b6edfd84a0')
Refresh the cart in hand
await subbly.cart.load(undefined, { expand: ['items.product'] })

subbly.cart.update(payload, params?)

Changes the cart itself rather than its items: who is buying, where it ships, how it ships, which discounts apply, and when a subscription starts. Send only the fields you change.

Most of it works for a guest. Three fields point at records only a signed-in customer has: paymentMethodId, shippingAddressId and billingAddressId.

Method parameters

payloadRequiredCartUpdatePayload

The fields to change. Every one is optional.

paramsoptionalCartResourceParams

Relations to include.

expandoptionalstring[]

The relations to fill in. The values are listed at the top of this page.

ReturnsPromise<CartModel>

The updated cart, which is subbly.cart itself. Its fields are written out under Create a cart.

Set the guest details
await subbly.cart.update({ customer: { email: 'ada@example.com', firstName: 'Ada', lastName: 'Lovelace', tosConsent: true, }, })
Set the delivery address and the method
await subbly.cart.update({ shippingAddress: { firstName: 'Ada', lastName: 'Lovelace', phone: '+442071234567', addressOne: '12 Marylebone Road', addressTwo: null, city: 'London', zip: 'NW1 5JD', countryId: 826, }, shippingMethodId: 91, })
Remove the coupon
await subbly.cart.update({ couponCode: null })

subbly.cart.addItem(payload, params?)

Adds a product, a plan or a bundle to the cart. Adding the same one-time item again raises its quantity instead of making a second line.

The payload has a shape per kind of item. All three share productId, quantity and metadata; the rest depends on what you are adding.

Method parameters

payloadRequiredCartItemAddPayload

The item to add.

paramsoptionalCartResourceParams

Relations to include.

expandoptionalstring[]

The relations to fill in. The values are listed at the top of this page.

ReturnsPromise<CartModel>

The updated cart, which is subbly.cart itself. Its fields are written out under Create a cart. The call rejects with code: 'out_of_stock' when the product ran out.

Add a one-time product
await subbly.cart.addItem({ productId: 3301, quantity: 2 })
Add a subscription with survey answers
await subbly.cart.addItem({ productId: 8801, options: [ { questionId: 11, answers: [{ id: 41 }] }, { questionId: 12, answers: [{ content: 'No nuts, please' }] }, ], })
Add a bundle
await subbly.cart.addItem({ productId: 8801, quantity: 1, bundle: { items: [ { productId: 3301, quantity: 2 }, { productId: 3307, quantity: 1 }, ], preferences: [{ attributeId: 9, values: [31] }], }, })

subbly.cart.updateItem(cartItemId, payload, params?)

Changes one line in the cart: the quantity, the survey answers, the gift details or the bundle contents. To change which product a line is for, remove it and add the new one.

Method parameters

cartItemIdRequiredstring

UUID of the line, from cart.items[].id.

payloadRequiredCartResourceUpdateItemPayload

What to change. Every field is optional, and the shape follows the kind of item the line holds.

paramsoptionalCartResourceParams

Relations to include.

expandoptionalstring[]

The relations to fill in. The values are listed at the top of this page.

ReturnsPromise<CartModel>

The updated cart, which is subbly.cart itself. Its fields are written out under Create a cart.

Change the quantity
const [line] = subbly.cart.items await subbly.cart.updateItem(line.id, { quantity: 3 })

subbly.cart.removeItem(cartItemId, params?)

Removes one line from the cart.

Method parameters

cartItemIdRequiredstring

UUID of the line, from cart.items[].id.

paramsoptionalCartResourceParams

Relations to include.

expandoptionalstring[]

The relations to fill in. The values are listed at the top of this page.

ReturnsPromise<CartModel>

The updated cart, which is subbly.cart itself. Its fields are written out under Create a cart.

Remove an item
const [line] = subbly.cart.items await subbly.cart.removeItem(line.id)

subbly.cart.getStartDates()

Gets the dates on which the subscription in the cart can start. Send the one the customer picks to subbly.cart.update as startsAt.

It uses the cart the SDK holds, so load or create a cart first.

ReturnsPromise<CartResourceStartDatesResponse>

The dates allowed. The API fills one of the two fields and sets the other to null: a fixed list of dates, or an open range. Handle both.

Get the start dates
const { availableDates, range } = await subbly.cart.getStartDates() const startsAt = availableDates?.length ? availableDates[0] : range?.[0] await subbly.cart.update({ startsAt })

subbly.cart.getGiftingDates()

Gets the dates on which a gift subscription in the cart can start. Send the one the customer picks to subbly.cart.update as giftInfo.startsAt.

ReturnsPromise<CartResourceGiftingDatesResponse>

The dates allowed, in the same shape subbly.cart.getStartDates returns.

Get the gifting dates
const { availableDates, range } = await subbly.cart.getGiftingDates() const startsAt = availableDates?.length ? availableDates[0] : range?.[0] await subbly.cart.update({ giftInfo: { startsAt, numberOfOrders: 3, message: 'Happy birthday', recipientEmail: 'grace@example.com', }, })

subbly.cart.getShippingMethods(params)

Gets the delivery options available for the cart at a destination. Send the ID of the one the customer picks to subbly.cart.update as shippingMethodId.

Only countryId and zip are needed. Pass the rest when a carrier quotes on the full address.

Method parameters

paramsRequiredCartShippingMethodsParams

Where the order is going.

ReturnsPromise<ShippingMethodDelivery[]>

The delivery options. Read type first: it is shipping_option for a carrier delivery and local_delivery for the shop's own, and it decides which of the fields below are set.

Get the shipping methods
const methods = await subbly.cart.getShippingMethods({ countryId: 826, zip: 'NW1 5JD', expand: ['carrier'], }) await subbly.cart.update({ shippingMethodId: methods[0].id })

subbly.cart.getLocalPickups()

Gets the pick-up points available for the cart. Send the ID of the one the customer picks to subbly.cart.update as shippingMethodId, along with pickupInfo for who collects the order.

ReturnsPromise<ShippingMethodPickup[]>

The pick-up points. The array is empty when the shop offers none.

Get the pick-up points
const points = await subbly.cart.getLocalPickups() await subbly.cart.update({ shippingMethodId: points[0].id, pickupInfo: { firstName: 'Ada', lastName: 'Lovelace', phone: '+442071234567', }, })

subbly.cart.attachCustomer(params?)

Assigns the cart to the signed-in customer. It sets attached to true and customerId to their ID, and clears the guest details in customer. Call it after the customer signs in and before you charge the cart.

It needs a signed-in customer.

Method parameters

paramsoptionalCartResourceParams

Relations to include.

expandoptionalstring[]

The relations to fill in. The values are listed at the top of this page.

ReturnsPromise<CartModel>

The attached cart, which is subbly.cart itself. Its fields are written out under Create a cart.

Attach the customer after a log-in
await subbly.auth.login({ email, password }) await subbly.cart.attachCustomer({ expand: ['items.product'] })
Last modified on September 15, 2026
currencyCodeoptionalstring

Currency of the cart, such as EUR. Defaults to the shop currency.

couponCodeoptionalstring | null

Coupon code to apply straight away.

giftCardCodeoptionalstring | null

Gift card code to apply straight away.

referralIdoptionalnumber | null

ID of the referral that led to this cart.

idstring

UUID of the cart. Pass it to subbly.checkout.purchase and to the funnel methods.

shopIdnumber

ID of the shop the cart belongs to.

statusstring

initialized, abandoned, expired, completed or restored. A completed cart cannot be changed.

attachedboolean

true once a signed-in customer owns the cart. subbly.cart.attachCustomer sets it.

createdAtstring

When the cart was created.

updatedAtstring

When the cart last changed.

currencyCodestring

Currency of the cart, such as USD. Change it with subbly.cart.update({ currencyCode }).

baseCurrencyCodestring

Base currency of the shop.

subTotalnumber

Sum of the lines before discount and tax.

discountTotalnumber

Total taken off by coupons, offers, referrals and gift cards.

taxTotalnumber

Total tax.

taxRatenumber

Cart-level tax rate. Single lines may use their own rate.

customsFeenumber

Customs charge on this order.

futureCustomsFeenumber

Customs charge on each later renewal.

adjustmentnumber

A manual correction. It may be negative.

totalnumber

Grand total, across what is charged now and what is charged later. Read summaryItems[].chargeNow to split the two.

balanceChangeobject

How much store credit the cart uses.

itemsCartItem[]

The lines the customer added. They hold no money fields; the prices live in summaryItems.

summaryItemsCartSummaryItem[]

The priced lines. Every item produces one or more of these, and shipping adds one of its own. Match them back with itemId.

discountsobject[]

The cart-level discounts.

customerIdnumber | null

ID of the customer who owns the cart. Set only after subbly.cart.attachCustomer.

customerobject | null

Guest details written straight onto the cart. null once a customer is attached. This is not a SubblyCustomer: id, userId and createdAt are always null.

couponCodestring | null

The coupon code on the cart.

couponCoupon | null

The coupon itself. The API sends it only when you ask for the coupon expand.

giftCardCodestring | null

The gift card code on the cart.

giftCardGiftCard | null

The gift card itself. The API sends it only when you ask for the gift_card expand.

referralIdnumber | null

ID of the referral that led to this cart.

giftInfoobject

Gift settings. Always an object; every member is null when the cart is not a gift.

startsAtstring | null

When the subscription starts. Pick a date from subbly.cart.getStartDates().

shippingAddressIdnumber | null

ID of the saved address or pick-up info used for delivery.

shippingAddressCustomerAddress | CustomerPickupInfo | null

The delivery address. The API sends it only when you ask for the shipping_address expand. A pick-up info arrives instead when the cart ships to a pick-up point; its fields are on the Pick-up info page.

billingAddressIdnumber | null

ID of the saved billing address.

billingAddressCustomerAddress | null

The billing address. The API sends it only when you ask for the billing_address expand. Same fields as shippingAddress.

shippingMethodIdnumber | null

ID of the delivery option chosen.

shippingMethodShippingMethod | null

The delivery option itself. The API sends it only when you ask for the shipping_method expand. Read type to tell a carrier delivery, a local delivery and a pick-up point apart.

shippingCarrierIdnumber | null

ID of the carrier chosen.

shippingCarrierobject | null

The carrier chosen, with id, name and serviceCodes. The API sends it only when you ask for the shipping_carrier expand.

shippingCarrierServicestring | null

The carrier service chosen, from serviceCodes.

paymentMethodIdnumber | null

ID of the payment method to charge. Only a signed-in customer has one.

paymentMethodPaymentMethod | null

The payment method itself. The API sends it only when you ask for the payment_method expand, and only for a signed-in customer.

metadataMetafield[] | null

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

onboardingTemplateIdnumber | null

ID of the onboarding template applied to the cart.

Javascript
Javascript
Javascript
Javascript
customeroptionalobject | null

Guest details on the cart. Use it before the customer signs in.

shippingAddressoptionalobject | null

A delivery address written straight onto the cart, for a guest with no saved addresses.

billingAddressoptionalobject | null

A billing address written straight onto the cart. Same fields as shippingAddress.

pickupInfooptionalobject | null

Who collects the order at a pick-up point.

currencyCodeoptionalstring

Currency of the cart. This is the only way to change it.

couponCodeoptionalstring | null

Coupon code to apply. Send null to take the coupon off.

giftCardCodeoptionalstring | null

Gift card code to apply. Send null to take the gift card off.

referralIdoptionalnumber | null

ID of the referral that led to this cart.

giftInfooptionalobject | null

Gift settings for the cart.

startsAtoptionalstring | null

When the subscription starts, from subbly.cart.getStartDates().

shippingMethodIdoptionalnumber | null

ID of the delivery option, from subbly.cart.getShippingMethods or subbly.cart.getLocalPickups.

shippingCarrierIdoptionalnumber | null

ID of the carrier, from the carrier of a shipping option.

shippingCarrierServiceoptionalstring | null

Carrier service code, from carrier.serviceCodes.

shippingAddressIdoptionalnumber | null

ID of a saved address or pick-up info of the signed-in customer.

billingAddressIdoptionalnumber | null

ID of a saved address of the signed-in customer.

paymentMethodIdoptionalnumber | null

ID of a saved payment method, from subbly.wallet.list.

onboardingTemplateIdoptionalnumber | null

ID of the onboarding template to apply.

metadataoptionalMetadataObject[] | null

Metafield values to save on the cart.

Javascript
Javascript
Javascript
productIdRequirednumber

What to add: a variant ID for a one-time product, a plan ID for a subscription.

quantityoptionalnumber

How many. Defaults to 1.

metadataoptionalMetadataObject[] | null

Metafield values to save on the line.

idRequirednumber

ID of the metafield.

valuesRequiredobject[]

The values to save. Send { id } with a value ID when the metafield is preset, and { value } with the text when it is free-text.

addonoptionalboolean

true adds the item alongside a subscription already in the cart.

addonDurationoptionalnumber

How long the add-on rides along: 1 for one charge, 0 for every charge.

giftCardoptionalobject | null

Who a gift card goes to.

customerEmailoptionalstring | null

Email of the recipient.

customerNameoptionalstring | null

Name of the recipient.

messageoptionalstring | null

Message for the recipient.

optionsoptionalobject[] | null

The customer's answers to the plan's survey, one entry per question.

bundleoptionalobject

What goes inside the bundle.

optionsoptionalobject[] | null

Survey answers, when the bundle plan also has a survey. Same shape as for a subscription.

Javascript
Javascript
Javascript
quantityoptionalnumber

How many.

addonoptionalboolean

true keeps the item alongside a subscription in the cart.

addonDurationoptionalnumber

1 for one charge, 0 for every charge.

giftCardoptionalobject | null

Who a gift card goes to, with customerEmail, customerName and message.

optionsoptionalobject[] | null

The survey answers, one entry per question. Send the full set; it replaces what was there.

questionIdRequirednumber

ID of the question being answered.

answersRequiredobject[]

The answers to that question. The shape follows the question type: { content: string } for a text or email question, { id: number } for a select, multiple, offer or plan question, and { id: number, quantity: number } for a quantity question.

bundleoptionalobject

The new bundle contents, with items and preferences exactly as in subbly.cart.addItem.

optionsoptionalobject[] | null

Survey answers, when the bundle plan also has a survey.

Javascript
Javascript
availableDatesstring[] | null

The exact dates allowed, as ISO dates. null when the shop gives an open range instead.

range[string, string] | null

The earliest and the latest date allowed, as ISO dates. null when the shop lists exact dates instead.

Javascript
availableDatesstring[] | null

The exact dates allowed, as ISO dates. null when the shop gives an open range instead.

range[string, string] | null

The earliest and the latest date allowed, as ISO dates. null when the shop lists exact dates instead.

Javascript
countryIdRequirednumber

ID of the country, from subbly.countries.list(). The field is countryId, not country.

zipRequiredstring

Postal or ZIP code of the destination.

regionIdoptionalnumber

ID of the region, from the country's regions[].id.

firstNameoptionalstring

Given name of the recipient.

lastNameoptionalstring

Family name of the recipient.

phoneoptionalstring

Phone number of the recipient.

addressOneoptionalstring

First address line.

addressTwooptionalstring | null

Second address line.

cityoptionalstring

City.

expandoptionalstring[]

Relations to include: method and carrier.

idnumber

ID of the shipping method. Pass it to subbly.cart.update as shippingMethodId.

typestring

shipping_option for a carrier delivery, local_delivery for the shop's own delivery. Read it first: the other fields follow from it.

shippingFeenumber

What this delivery costs now, in the minor unit of the cart currency.

futureShippingFeenumber

What it costs on each later renewal.

prohibitedProductsnumber[]

IDs of products this method cannot carry. When the cart holds one of them, hide the method.

methodobject

The carrier option.

namestring

Name to show the customer, such as Standard.

durationstring | null

How long delivery takes, in the shop's own words.

typestring

How the price is worked out: flat_price, product, price, weight or dynamic.

customsFeenumber

Customs charge added now, in the minor unit of the cart currency.

futureCustomsFeenumber

Customs charge added on each later renewal.

carrierobject | null

The carrier. The API sends it only when you ask for the carrier expand.

idnumber

ID of the carrier. Pass it as shippingCarrierId.

namestring

Carrier name.

serviceCodesstring[]

The services the carrier offers. Pass one as shippingCarrierService.

carrierIdnumber | null

ID of the carrier.

servicestring | null

The carrier service already chosen.

methodobject

The local delivery option.

Javascript
idnumber

ID of the pick-up method. Pass it to subbly.cart.update as shippingMethodId.

typestring

Always local_pickup.

shippingFeenumber

What the pick-up costs now, in the minor unit of the cart currency.

futureShippingFeenumber

What it costs on each later renewal.

prohibitedProductsnumber[]

IDs of products this pick-up point cannot hold.

methodPickupPoint

The pick-up point itself.

idnumber

ID of the pick-up point.

namestring

Name of the point.

typestring

pickup for a point the shop runs, mondial_relay for a Mondial Relay locker.

pricenumber

Price of this point, in the minor unit of the cart currency.

workingHoursstring

Opening hours, in the shop's own words.

commentstring

A note from the shop.

addressOnestring

First address line.

addressTwostring | null

Second address line.

citystring

City.

regionstring

Region name.

zipstring

Postal or ZIP code.

countrystring

Country name.

countryCodeoptionalstring

Two-letter ISO country code.

phonestring

Phone number of the point.

Javascript
Javascript
amountnumber

Amount taken from the balance.

currencyCodestring

Currency of that amount.

idstring

UUID of the line. This is the cartItemId you pass to subbly.cart.updateItem and subbly.cart.removeItem.

typestring

one_time or subscription. It decides what product and options hold.

productIdnumber

ID of the product on this line: a variant ID for a one-time item, a plan ID for a subscription.

productProductVariant | ProductPlan | null

The product itself. The API sends it only when you ask for the items.product expand. A ProductVariant for a one-time line, a ProductPlan for a subscription line; both are written out on the Products page.

productNamestring

Name of the product, as it was when the line was added.

descriptionstring

Line description, such as the variant options.

quantitynumber

How many.

statusstring | null

active, unavailable or out_of_stock. Show a warning for anything but active.

addonboolean

true when the line rides along with a subscription in the cart.

addonDurationnumber | null

How long the add-on lasts: 1 for one charge, 0 for every charge.

amountOffnumber | null

Fixed discount on this line, in the minor unit of the cart currency.

percentOffnumber | null

Percentage discount on this line.

giftCardobject

Who the gift card goes to. Always an object; every member is null when the line is not a gift card.

bundleobject

What the customer picked inside a bundle. Always an object; items is empty when the line is not a bundle.

optionsobject | null

The survey answers for a subscription line. null on a one-time line.

metadataMetafield[] | null

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

originstring | null

Where the line came from: pre_purchase, mid_purchase, post_purchase or coupon. null when the customer added it.

createdAtstring

When the line was added.

updatedAtstring

When the line last changed.

typestring

What the line charges for: one_time, subscription, trial_first, gift_card, setup_fee, survey, shipping or addon. The older tax value is no longer sent.

itemIdstring | null

ID of the CartItem this line prices. null on a shipping line.

productIdnumber | null

ID of the product priced. null on a shipping line.

quantitynumber

How many.

pricenumber

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

subTotalnumber

Price before discount and tax.

totalnumber

What the customer pays for this line.

discountnumber | null

Total discount on the line.

discountsobject[]

The discounts that make up discount.

taxAmountnumber

Tax on the line.

taxRatenumber

Tax rate used for the line.

taxInclusiveboolean

true when price already contains the tax.

chargeNowboolean

true when the line is charged at checkout, false when it is charged on a later renewal.

subscriptionobject | null

Billing and shipping dates. Set on subscription and trial_first lines, null on the rest.

firstPaymentAtstring | null

When the first charge happens.

nextPaymentAtstring | null

When the next charge happens.

firstShipmentAtstring | null

When the first shipment goes out.

numberOfShipmentsnumber | null

How many shipments the plan covers.

bundleobject | null

The priced bundle contents. Set on one_time, addon, gift_card, subscription and trial_first lines, null on the rest.

typestring

coupon, coupon_gift_offer, offer, referral, balance, gift_card or bundle.

descriptionstring

Text to show the customer.

totalnumber

Amount taken off.

chargeNowboolean

true when the discount applies to this charge, false when it applies to a renewal.

firstNamestring | null

Given name.

lastNamestring | null

Family name.

emailstring | null

Email address.

marketingConsentboolean | null

Whether the guest agreed to marketing email.

tosConsentAtstring | null

When the guest accepted the terms.

externalIdstring | null

Your own ID for this guest.

activeSubscriptionsCountnumber

Always 0 for a guest.

idnull

Always null.

userIdnull

Always null.

createdAtnull

Always null.

idnumber

ID of the coupon.

couponIdstring

The public code a customer types, such as WELCOME10.

namestring

Name of the coupon in Subbly Admin.

amountOffnumber | null

Fixed amount taken off, in the minor unit of the currency. null when the coupon is a percentage.

percentOffnumber | null

Percentage taken off. null when the coupon is a fixed amount.

durationstring

How long the discount lasts: once, forever or multiple.

durationInMonthsnumber | null

How many months the discount lasts. Set only when duration is multiple.

behaviorobject

What the coupon changes about checkout.

skipPaymentMethodAllowedboolean

true when the cart total drops to zero and the customer can check out with no payment method.

giftobject | null

A free gift the coupon adds. null when the coupon gives no gift.

addonDurationstring

How long the gift rides along: once or forever.

amountOffnumber | null

Fixed amount taken off the gift, in the minor unit of the currency.

percentOffnumber | null

Percentage taken off the gift.

idnumber

ID of the gift card.

codestring

The code a customer types.

amountnumber

Face value, in the minor unit of the currency.

balancenumber

What is left to spend, in the minor unit of the currency.

messagestring

Message the buyer wrote for the recipient.

statusstring

One of issued, redeemed, partially_used, used, cancelled, expired.

startsAtstring | null

When the gift subscription starts. Pick a date from subbly.cart.getGiftingDates().

numberOfOrdersnumber | null

How many shipments the gift covers.

messagestring | null

Message for the recipient.

recipientEmailstring | null

Email of the recipient.

idnumber

ID of the address.

firstNamestring

Given name of the recipient.

lastNamestring

Family name of the recipient.

companyNamestring | null

Company name, when the shop collects one.

phonestring

Phone number of the recipient.

addressOnestring

First address line.

addressTwostring | null

Second address line.

citystring

City.

regionstring

Region name.

regionIdnumber | null

ID of the region, when the country has a region list.

zipstring

Postal or ZIP code.

countrystring

Country name.

countryIdnumber

ID of the country.

countryCodestring

Two-letter ISO country code.

idnumber

ID of the method.

typestring

shipping_option, local_delivery or local_pickup.

shippingFeenumber

What the delivery costs now.

futureShippingFeenumber

What it costs on each later renewal.

customsFeenumber

Customs charge now. Sent on a shipping_option only.

futureCustomsFeenumber

Customs charge on each later renewal. Sent on a shipping_option only.

methodobject

The option behind the method: a carrier option, a local delivery or a pick-up point. subbly.cart.getShippingMethods and subbly.cart.getLocalPickups below write out all three shapes.

carrierobject | null

The carrier, with id, name and serviceCodes. Sent on a shipping_option only.

carrierIdnumber | null

ID of the carrier.

servicestring | null

The carrier service chosen.

prohibitedProductsnumber[]

IDs of products this method cannot carry.

idnumber

ID of the payment method. Pass it as paymentMethodId.

typestring

One of card, paypal, us_bank_account, bancontact, sofort, ideal, cashapp, link, sepa_debit, acss_debit. Only the matching detail object below is set.

identifierstring

Reference to the method on the payment gateway.

createdAtstring | null

When the customer saved the method.

cardobject | null

Card details. Set when type is card.

usBankAccountobject | null

US bank account details. Set when type is us_bank_account.

acssDebitobject | null

Canadian pre-authorised debit details. Set when type is acss_debit.

bancontactobject | null

Bancontact details. Set when type is bancontact. Fields: name and email, both string.

cashappobject | null

Cash App details. Set when type is cashapp. Fields: name, email, buyerId and cashTag, all string.

idealobject | null

iDEAL details. Set when type is ideal. Fields: bank, bic, name and email, all string.

linkobject | null

Link details. Set when type is link. Fields: name and email, both string.

sepaDebitobject | null

SEPA direct debit details. Set when type is sepa_debit. Fields: name, email, country, ibanLast4, bankCode and branchCode, all string. The TypeScript type spells the last two bank_code and branch_code; the API sends them camel-cased.

sofortobject | null

SOFORT details. Set when type is sofort. Fields: name, email and country, all string.

emailoptionalstring

Email address.

firstNameoptionalstring

Given name.

lastNameoptionalstring

Family name.

marketingConsentoptionalboolean

Whether the guest agreed to marketing email.

tosConsentoptionalboolean

Whether the guest accepted the terms.

externalIdoptionalstring | null

Your own ID for this guest.

firstNameRequiredstring

Given name of the recipient.

lastNameRequiredstring

Family name of the recipient.

phoneoptionalstring

Phone number in international form. The shop needs it unless settings.phoneNumberOptional is on.

companyNameoptionalstring | null

Company name. Collect it only when the shop sets settings.collectCompanyName.

addressOneRequiredstring

First address line.

addressTwoRequiredstring | null

Second address line. Send null when there is none.

cityRequiredstring

City.

zipRequiredstring

Postal or ZIP code.

regionoptionalstring

Region name. Use it for countries with no region list.

regionIdoptionalnumber

ID of the region, from regions[].id of the country.

countryIdRequirednumber

ID of the country, from subbly.countries.list().

firstNameRequiredstring

Given name of the person collecting.

lastNameRequiredstring

Family name of the person collecting.

phoneRequiredstring

Phone number.

pickupPointTypeoptionalstring

mondial_relay when the point comes from Mondial Relay.

pickupPointIdoptionalstring

ID of the point at the provider.

startsAtoptionalstring | null

When the gift starts, from subbly.cart.getGiftingDates().

numberOfOrdersoptionalnumber | null

How many shipments the gift covers.

messageoptionalstring | null

Message for the recipient.

recipientEmailoptionalstring | null

Email of the recipient.

idRequirednumber

ID of the metafield.

valuesRequiredobject[]

The values to save. Send { id } with a value ID when the metafield is preset, and { value } with the text when it is free-text.

questionIdRequirednumber

ID of the question being answered.

answersRequiredobject[]

The answers to that question. The shape follows the question type: { content: string } for a text or email question, { id: number } for a select, multiple, offer or plan question, and { id: number, quantity: number } for a quantity question.

itemsRequiredobject[]

The picked items, each { productId, quantity } from subbly.bundles.loadItems.

preferencesRequiredobject[]

The answers to the bundle preferences, each { attributeId, values }. Send [] when there are none.

namestring

Name to show the customer.

durationstring

How long delivery takes.

commentstring | null

A note from the shop, such as the delivery days.

customerEmailstring | null

Email of the recipient.

customerNamestring | null

Name of the recipient.

messagestring | null

Message for the recipient.

itemsBundleItem[]

The picked bundle items. Each carries id, productId, product, quantity, extraPrice, position, stockCount and settings, written out on the Bundles page.

preferencesobject[]

The bundle preferences the customer chose.

attributeIdnumber

ID of the preference attribute.

valuesnumber[]

IDs of the chosen values.

surveyIdnumber

ID of the survey that was answered.

itemsCountnumber

How many products the answers resolve to.

dataobject[]

One entry per answered question.

questionIdnumber

ID of the question.

answersobject[]

The answers. Each is { content } for a text or email question, { id } for a select, multiple, offer or plan question, or { id, quantity } for a quantity question.

itemsobject[]

The products the answers resolve to. Each carries id, productId and surveyId, all number.

typestring

coupon, coupon_gift_offer, offer, referral, balance, gift_card or bundle.

descriptionstring

Text to show the customer.

totalnumber

Amount taken off.

itemsobject[]

One entry per picked bundle item.

itemIdstring

ID of the bundle item.

productIdnumber

ID of the product.

variantIdnumber

ID of the variant.

quantitynumber

How many inside one bundle.

quantityTotalnumber

How many across every bundle on the line.

pricenumber

Unit price.

subTotalnumber

Price before discount and tax.

totalnumber

What this item adds to the line.

discountnumber | null

Discount on this item.

discountsobject[]

The discounts behind discount, each with type, description and total.

taxAmountnumber

Tax on this item.

taxRatenumber

Tax rate used.

taxInclusiveboolean

true when price already contains the tax.

brandstring

Card brand, such as visa or mastercard.

lastFourstring

Last four digits. The TypeScript type calls this field last4, but the API sends lastFour; read lastFour.

expiryMonthstring

Expiry month, two digits.

expiryYearstring

Expiry year.

typestring

Funding type of the card, such as credit or debit.

accountHolderTypestring

company or individual.

accountTypestring

checking or savings.

bankNamestring

Name of the bank.

namestring

Name on the account.

emailstring

Email on the account.

last4string

Last four digits of the account number.

routingNumberstring

Routing number.

namestring

Name on the account.

emailstring

Email on the account.

bankNamestring

Name of the bank.

lastFourstring

Last four digits of the account number.

institutionNumberstring

Institution number.

transitNumberstring

Transit number.