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

Metafields

Read the metafield definitions of the shop.

subbly.metafield.list(params)

Gets a page of the metafield definitions of the shop. Metafields are the custom fields a shop adds to a customer, a subscription or a product. Read them to build your own form, then write the answers back as metadata on the cart or on a subscription.

The namespace is singular: subbly.metafield, not subbly.metafields.

Method parameters

paramsRequiredMetafieldListParams

Which definitions to return. The argument is required by position, so pass an empty object for the defaults.

ReturnsPromise<MetafieldListResponse>

One page of definitions.

List the metafields
const { data, pagination } = await subbly.metafield.list({ page: 1, perPage: 20 })
Load one definition by slug
const { data } = await subbly.metafield.list({ slugs: ['coffee-strength'] }) const [strength] = data
Last modified on September 15, 2026
idsoptionalnumber[]

Keep only these metafield IDs.

slugsoptionalstring[]

Keep only these slugs.

pageoptionalnumber

Page to return, counted from 1.

perPageoptionalnumber

How many definitions per page.

presetoptionalboolean

true keeps only preset fields, which hold a fixed list of choices. false keeps only free-text fields.

expandoptionalstring[]

Relations to include in the response.

dataMetafield[]

The definitions on this page.

idnumber

ID of the metafield.

metadataIdnumber

ID of the definition this value belongs to.

namestring

Name of the metafield in the Subbly admin.

slugstring

Machine name of the metafield. Use it to find a field by hand.

descriptionstring | null

Help text for the field.

dataTypeMetafieldType

The kind of value the field holds. One of single_line_string, multi_line_text, rich_text, integer, decimal, datetime, date, time, volume, weight, boolean, color, rating, url, money or json.

accessLevel'private' | 'storefront'

Who can read the field. Only storefront fields reach the browser.

saveBehavior'customer' | 'subscription'

Whether the value is saved on the customer or on the subscription.

editableboolean

Whether the customer may change the value.

multipleboolean

Whether the field takes more than one value.

presetboolean

true when the customer picks from values. false when the customer types the value.

variantboolean

Whether the value changes from variant to variant.

unitstring | null

Unit of the value, such as kg.

valuesMetafieldValue[]

The values of the field. A preset field lists the choices; a free-text field lists what the customer wrote.

paginationPagination

Where this page sits in the full 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
idnumber

ID of the value. Send this as id when you write a preset metafield.

valueIdnumber

ID of the saved value record.

valuestring | null

The value itself, as text.

metadataobject | null

Presentation of the choice.

imageUrlstring | null

Image for the choice.

colorstring | null

Colour for the choice, as a CSS colour.