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 customerChange a customer's store credit balanceCreate a customer noteUpdate a customer noteDelete a customer note
Address
    Create an addressUpdate an addressDelete an address
Pickup Info
    Get list of pickup infoCreate pickup infoUpdate pickup infoDelete pickup info
Subscription
    Get list of subscriptionsCreate a subscriptionGet subscription by IDUpdate a subscriptionCancel a subscriptionUndo cancellationPause a subscriptionResume a subscriptionSkip renewals until a dateReactivate a cancelled or expired subscriptionSwitch the subscription to another plan by starting overChange the plans of the subscription's itemsUpdate a subscription's shipping address and methodUpdate a subscription's payment methodUpdate a subscription's survey preferencesCreate a subscription itemShow a subscription itemUpdate a subscription itemRemove a subscription itemUpdate a subscription item's preferencesUpdate a subscription item's bundleChange the plan of a subscription itemChange the variant of a one-time itemApply a discount to a subscription itemRemove a subscription item discountApply 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
    Create a payment methodGet payment method by IDDelete a payment method
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

Error responses

422object

A query parameter failed validation: ids or slugs is not an array, an ID is not an integer, a slug is longer than 255 characters, page is below 1, per_page is outside 1 to 100, preset or variant is not a boolean, sort[direction] comes without sort[field], or the sort field or direction is unknown.

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

Error responses

422object

name is missing, not a string, or slugifies to a value that ends in subbly-variant (The name should not end with "subbly-variant".); data_type or access_level is missing or unknown; save_behavior is unknown; multiple or preset is true for a data type that does not support it (The multiple is invalid., The preset is invalid.); unit is missing for volume or weight, or sent for any other data type; values is sent without preset, holds duplicates, or holds a value that does not fit the data type; or a values[].value is missing.

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

400object

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 'X-API-KEY: <api-key>' \ -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.