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

Wallet

List the saved payment methods of the customer, and add a new one.

subbly.wallet.list(currencyCode)

Gets the payment methods the signed-in customer saved for one currency. A payment method belongs to a gateway, and a gateway belongs to a currency, so a customer who pays in two currencies has two sets. Needs an authenticated customer.

Method parameters

currencyCodeRequiredstring

Currency to list, such as USD. Take it from shop.currencies[].abbreviation.

ReturnsPromise<PaymentMethod[]>

The saved payment methods.

List the payment methods
const paymentMethods = await subbly.wallet.list('USD') await subbly.cart.update({ paymentMethodId: paymentMethods[0].id })

subbly.wallet.setup(payload)

Gets the token a gateway widget needs before it can collect card details. Run it first, hand the token to the gateway's own SDK, then save what the gateway gives back with subbly.wallet.store.

Method parameters

payloadRequiredWalletSetupPayload

The gateway to set up.

ReturnsPromise<WalletSetupResponse>

The token for the gateway widget.

Start a Stripe card setup
const [gateway] = subbly.shop.currencies[0].gateways const { token } = await subbly.wallet.setup({ gatewayId: gateway.id }) const { setupIntent } = await stripe.confirmCardSetup(token, { payment_method: { card: cardElement } })

subbly.wallet.store(payload)

Saves a payment source for the customer from the token the gateway widget returned. The saved method can then be set on the cart or on a subscription. Needs an authenticated customer.

Method parameters

payloadRequiredPaymentMethodStorePayload

The source to save.

ReturnsPromise<PaymentMethod>

The payment method saved.

Save a Stripe card
const paymentMethod = await subbly.wallet.store({ gatewayId: gateway.id, token: setupIntent.id }) await subbly.cart.update({ paymentMethodId: paymentMethod.id })

subbly.wallet.setupIntent(payload)

Gets a Subbly-hosted page where Stripe runs 3-D Secure on a new card. Send the customer to subblyUrl; Stripe returns them to the redirectUrl you gave. Needs an authenticated customer.

Method parameters

payloadRequiredWalletSetupIntentPayload

The gateway to verify with, and where to come back to.

ReturnsPromise<WalletSetupIntentResponse>

Where to send the customer, and how long the link lasts.

Verify a card with 3-D Secure
const { subblyUrl } = await subbly.wallet.setupIntent({ gatewayId: gateway.id, redirectUrl: `https://your-shop.com/checkout/${subbly.cart.id}` }) window.location.assign(subblyUrl)
Last modified on September 15, 2026
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.

Javascript
gatewayIdRequirednumber

ID of the gateway, from shop.currencies[].gateways[].id.

tokenstring

What the token is depends on the gateway. Stripe gives a client secret for stripe.confirmCardSetup. Braintree gives a client token that starts the Braintree SDK. PayPal gives an order ID for createOrder in paypal.Buttons.

Javascript
gatewayIdRequirednumber

The gateway the token came from.

tokenRequiredstring

The token the gateway widget returned. Stripe gives a setup intent ID. Braintree gives a payment method nonce. PayPal gives an order ID. Authorize.net gives the encrypted payment data, Base64-encoded.

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.

Javascript
gatewayIdRequirednumber

ID of the Stripe gateway.

redirectUrlRequiredstring

Page of yours that Stripe sends the customer back to, such as https://your-shop.com/checkout/CART_ID.

idstring

ID of the setup intent.

redirectUrlstring

The page you asked Stripe to return to.

expiresAtstring

When the hosted page stops working.

subblyUrlstring

The Subbly-hosted page to send the customer to.

Javascript
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.

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.