SubblySubbly
Log inGet started
  • Get started
  • Developer resources
Private API reference
Docs
Information
    Base URLAuthenticationPaginationErrors
Customer
    Get list of customersCreate a customerGet customer by IDUpdate a customerDelete a customerCredit a customer's store credit balanceCreate a customer noteUpdate a customer noteDelete a customer noteCreate a customer addressUpdate a customer addressDelete a customer addressGet list of customer pickup infoCreate customer pickup infoUpdate customer pickup infoDelete customer pickup infoCreate a customer payment methodDelete a customer payment method
Subscription
    Get list of subscriptionsCreate a subscriptionGet subscription by IDCancel a subscriptionUndo cancellationCreate a subscription itemShow a subscription itemUpdate a subscription itemRemove a subscription itemUpdate a subscription item's preferencesUpdate a subscription item's bundleApply a discount to a subscriptionRemove a subscription discount
Invoice
    Get list of invoicesGet invoice by IDSchedule the next payment for invoiceVoid an invoiceForgive an invoiceMark an invoice as paid
Order
    Get list of ordersGet order by IDUpdate an orderShip an orderCancel an orderMark an order as pendingArchive an orderMark an order as a future shipmentSync order shipping items
Payment Method
    Get payment method by ID
Transaction
    Get list of transactionsGet transaction by ID
Cancellation
    Get shop cancellation reasons
Product
    Get list of productsGet product by IDGet variant by IDUpdate variantGet plan by IDUpdate planCreate subscription productUpdate subscription productPublish subscription productUnpublish subscription productArchive subscription productSync subscription product metadataCreate one-time productUpdate one-time productPublish one-time productUnpublish one-time productArchive one-time productSync one-time product metadataCreate variantArchive variantBatch create/update/archive variantsCreate planArchive plan
Survey
    Get survey by IDGet list of surveys
Bundle
    Get list of bundlesCreate a new bundleGet bundle by IDUpdate a bundleGet list of bundle itemsCreate a bundle itemBatch create bundle itemsGet bundle item by IDUpdate a bundle itemDelete a bundle itemGet list of bundle groupsPublish a bundleUnpublish a bundleArchive a bundleSync bundle metadataCreate a bundle planGet bundle plan by IDUpdate a bundle planArchive a bundle plan
Tag
    Get list of tags
Metafield
    Get shop's metafieldsCreate a new metadataUpdate the metadata
Funnel
    Get list of funnelsGet funnel by ID
Option
    Get list of options
Country
    Get list of countries
Inventory
    Get list of inventory itemsCreate a new inventory itemGet inventory item by IDUpdate an inventory itemArchive an inventory itemGet list of inventory groupsCreate a new inventory groupGet inventory group by IDUpdate an inventory group
Coupon
    Get list of couponsCreate a couponGet coupon by IDUpdate a couponArchive a coupon
Product Collection
    Get list of product collectionsCreate a product collectionGet product collection by IDUpdate a product collectionPublish a product collectionUnpublish a product collectionArchive a product collectionGet list of collection groups with itemsSync collection items

Metafield

Private Metafield API endpoints

Endpoints
  • GET/metafields
  • POST/metafields
  • PATCH/metafields/{metafield_slug}

Get shop's metafields

GET /metafields

Retrieves a paginated list of shop's metadata.

Query parameters

pageoptionalinteger

Page number for pagination

per_pageoptionalinteger

Entities per page

idsoptionalinteger[]

Filter by metadata by IDs. Values must be unique.

slugsoptionalstring[]

Filter by metadata by slugs. Values must be unique.

presetoptionalboolean

Filter by metadata preset

variantoptionalboolean

Filter by metadata variant type

sort[field]optionalstring

Field to sort by. Required whenever any sort key is sent.

Possible values: id, name.

sort[direction]optionalstring

Sort direction; defaults to asc.

Possible values: asc, desc.

Defaults to "asc".

Returnsobject

Successful response

curl https://api.subbly.co/private/v1/metafields \ -H 'X-API-KEY: <api-key>'
Response
{ "pagination": { "current_page": 1, "last_page": 2, "from": 1, "to": 1, "total": 20 }, "data": [ { "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ { "id": 1, "value": "value" } ] } ] }

Create a new metadata

POST /metafields

Request body

nameRequiredstring

Metadata name. Must not slugify to a value ending in subbly-variant; that suffix is reserved.

descriptionoptionalstring | null

Freeโ€form description

multipleoptionalboolean

Allow multiple values. May only be true when data_type is one of single_line_string, integer, decimal, datetime, date, time, volume, weight, color, url. Otherwise the request is rejected.

data_typeRequiredstring

Data type for the metadata

Possible values: single_line_string, multi_line_text, rich_text, integer, decimal, datetime, date, time, volume, weight, boolean, color, rating, url, money, json.

access_levelRequiredstring

Who can see/use this metadata

Possible values: storefront, private.

presetoptionalboolean

Values come from a preset list. May only be true when data_type is one of single_line_string, color, time, integer, rating, decimal, money, volume, weight, date, datetime. Otherwise the request is rejected.

unitoptionalstring

Unit label. Required when data_type is volume or weight; prohibited (422) for every other data_type.

save_behavioroptionalstring

Save behavior for the metadata. Defaults to subscription.

Possible values: customer, subscription.

editableoptionalboolean

Whether the metadata value is editable by the customer. Defaults to true.

valuesoptionalobject[] | null

List of allowed values (when preset is true)

ReturnsMetadata

Metadata created successfully

curl -X POST https://api.subbly.co/private/v1/metafields \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "name": "name", "description": "description", "multiple": true, "data_type": "single_line_string", "access_level": "storefront", "preset": true, "unit": "unit", "save_behavior": "customer", "editable": true, "values": [ { "value": "value" } ] }'
Response
{ "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ { "id": 1, "value": "value" } ] }

Update the metadata

PATCH /metafields/{metafield_slug}

Partially updates the metadata and its values by metadata slug. Variant metafields cannot be updated; the request is rejected with 403.

Path parameters

metafield_slugRequiredstring

The unique slug of the metadata to update

Request body

Fields to update on the metadata

nameoptionalstring

New name of the metadata. Must not slugify to a value ending in subbly-variant; that suffix is reserved.

descriptionoptionalstring | null

Detailed description

access_leveloptionalstring

Access scope for the metadata

Possible values: storefront, private.

unitoptionalstring

Unit of measurement. Required on every update request when the metafield's data_type is volume or weight (resend the current value if unchanged); prohibited for all other data types.

save_behavioroptionalstring

Save behavior for the metadata.

Possible values: customer, subscription.

editableoptionalboolean

Whether the metadata value is editable by the customer.

valuesoptionalobject | null

Operations on preset values

ReturnsMetadata

Metadata updated successfully

Error responses

403any

The metafield belongs to another shop, or is a variant metafield and therefore not updatable.

curl -X PATCH https://api.subbly.co/private/v1/metafields/{metafield_slug} \ -H 'Content-Type: application/json' \ -d '{ "name": "name", "description": "description", "access_level": "storefront", "unit": "unit", "save_behavior": "customer", "editable": true, "values": { "create": [ { "value": "value" } ], "update": [ { "id": 1, "value": "value" } ], "delete": [ { "id": 1 } ] } }'
Response
{ "id": 1, "name": "Color", "slug": "color-red", "description": "description", "unit": "kg", "data_type": "single_line_string", "preset": true, "multiple": true, "access_level": "storefront", "save_behavior": "customer", "editable": true, "values": [ { "id": 1, "value": "value" } ] }
paginationobject
dataMetadata[]
valueRequiredstring | number | boolean | object

The value to add. Format depends on data_type:

  • single_line_string, color, time: String (max 255 characters)
  • multi_line_text, rich_text: String (any length)
  • url: Valid URL string
  • integer, rating: Integer value (as string, e.g., "42")
  • boolean: Boolean value (1/0)
  • decimal, money, volume, weight: Numeric value (integer or decimal)
  • date: String in format "Y-m-d" (e.g., "2024-03-15")
  • datetime: String in format "Y-m-d H:i:s" (e.g., "2024-03-15 14:30:00")
  • json: Valid JSON string
idinteger
namestring

Metadata name.

slugstring

Metadata slug.

descriptionstring | null

Description of the metadata.

unitstring | null
data_typestring

Possible values: single_line_string, multi_line_text, rich_text, integer, decimal, datetime, date, time, volume, weight, boolean, color, rating, url, money, json.

presetboolean
multipleboolean
access_levelstring

Possible values: storefront, private.

save_behaviorstring

Possible values: customer, subscription.

editableboolean
valuesMetadataValue[] | null

Preset values. null for metafields where preset is false in the list response; always an array, possibly empty, in the create and update responses.

createoptionalobject[]

New values to add

updateoptionalobject[]

Existing values to update

deleteoptionalobject[]

IDs of values to remove

idinteger
namestring

Metadata name.

slugstring

Metadata slug.

descriptionstring | null

Description of the metadata.

unitstring | null
data_typestring

Possible values: single_line_string, multi_line_text, rich_text, integer, decimal, datetime, date, time, volume, weight, boolean, color, rating, url, money, json.

presetboolean
multipleboolean
access_levelstring

Possible values: storefront, private.

save_behaviorstring

Possible values: customer, subscription.

editableboolean
valuesMetadataValue[] | null

Preset values. null for metafields where preset is false in the list response; always an array, possibly empty, in the create and update responses.