SubblySubbly
Log inGet started
  • Get started
  • Developer resources
Storefront API reference
Docs
Information
    Base URLAuthenticationPaginationErrors
Bootstrap
    Get shop info and settings
Product
    Get list of productsGet product by IDGet variant or pricing by IDGet plan by ID
Bundle
    Get list of bundlesGet bundle by IDQuote bundleGet list of bundle group itemsGet list of bundle itemsGet the list of bundle items associated with multiple bundles
Survey
    Get survey by ID
Cart
    Init cartGet cart by IDUpdate cart by IDGet cart gifting datesGet cart start datesGet shipping methodsGet local pickupsValidate the cartAttach the customer to the cart
Cart Item
    Add cart itemUpdate cart itemDelete cart item
Checkout
    Make purchase from the cart
Auth
    LoginOtp LoginOtp GenerateSocial LoginRegisteredRegister
Customer
    Get the current customerGet the current customer referral infoUpdate customer
Address
    Get list of addressStore addressUpdate addressDelete address
Pickup Info
    Get list of pickup infosStore pickup infoUpdate pickup infoDelete pickup info
Wallet
    Store payment methodGet list of payment methodsStore payment methodDelete payment methodSet default payment method
Subscription
    Get list of subscriptionsShow subscriptionUpdate subscriptionUpdate subscription survey preferences by Subscription IDUpdate subscription bundle data by Subscription IDCancel a subscriptionUndo cancellationUndo a scheduled cancellationRequest a cancellationWithdraw a cancellation requestSkip upcoming renewalsPause the subscriptionResume the subscriptionProlong an active skipReactivate the subscriptionUpdate shipping address and methodUpdate subscription payment methodGet shipping methodsGet local pickupsList upcoming billing datesList allowed skipping datesList allowed resume datesChange the plans of the subscription's itemsList the plans the subscription can move toCreate 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 item
Order
    Get list of ordersGet order by ID
Invoice
    Get list of invoicesGet invoice by ID
Payment Intent
    Confirm payment intentGet payment intent by ID
Funnels
    Get the current pre purchase funnel step by IDRefresh the funnel progressAccept the pre purchase funnel stepReject the pre purchase funnel stepGet the current mid purchase funnel step by IDRefresh the funnel progressAccept the mid purchase funnel stepReject the mid purchase funnel step
Countries
    Get list of countries
Out Of Stock
    Subscribe to the out of stock
Cancellation
    Get shop cancellation reasons
Metafield
    Get shop's metafields
Product Collection
    Get list of product collectionsGet product collection by IDGet list of collection groups with items
Lead
    Store the shop lead

Bundle

Storefront Bundle API endpoints

Endpoints
  • GET/bundles
  • GET/bundles/{bundle_id}
  • POST/bundles/{bundle_id}/quote
  • GET/bundles/{bundle}/groups
  • GET/bundles/{bundle_id}/items
  • GET/bundle/items

Get list of bundles

GET /bundles

An API endpoint to get list of bundles with filtering options.

Query parameters

pageoptionalinteger

Page number for pagination

per_pageoptionalinteger

Entities per page

ids[]optionalinteger[]

Filter by bundle IDs

tags[]optionalstring[]

Filter by tag name

slugs[]optionalstring[]

Filter by bundle slugs

configurableoptionalboolean

Filter by configurable bundles

digitaloptionalboolean

Filter by digital bundles

sort[field]optionalstring

Field to sort by

Possible values: id, name.

sort[direction]optionalstring

Sort direction; defaults to asc.

Possible values: asc, desc.

Defaults to "asc".

Returnsobject

Bundles list response

Error responses

422object

A query parameter fails validation. tags holds a name that is not a tag of the shop; ids, tags or slugs is not an array or repeats a value; an ids entry is not an integer; a slug is longer than 80 characters; digital or configurable is not a boolean; sort is not an array, sort.field is missing or not id or name, or sort.direction is not asc or desc; page is below 1; per_page is outside 1-500; or expand is not an array.

curl https://api.subbly.co/storefront/v1/bundles \ -H 'X-API-KEY: <api-key>'
Response
{ "pagination": { "current_page": 1, "last_page": 2, "from": 1, "to": 1, "total": 20 }, "data": [ { "id": 1, "name": "Bundle Name", "slug": "Bundle slug", "digital": false, "delivery_info": "delivery_info", "images": [ { "id": 1, "url": "https://www.example.com/image.jpg", "order": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "configurable": true, "description": "description", "hidden_items": true, "searchable": false, "show_ruleset_name": false, "quantity_selectors": [ 1 ], "selection_type": "variant", "discount_type": "per_item", "price_type": "per_item", "ruleset_type": "total", "appearance_type": "one_step", "rulesets": [ { "id": 1, "name": "Ruleset Name", "products": [ {} ], "min_quantity": 1, "max_quantity": 2, "cta_text": "Add to cart", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "plans": [ { "id": 1, "pricing": {}, "plan": {}, "variant": {}, "pricings": [ {} ], "variants": [ {} ], "prices": [ {} ], "discounts": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "preferences": [ { "id": 1, "attribute_id": 1, "metafield_id": 1, "title": "Do you want only vageterian dishes?", "values": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "filters": [ { "id": 1, "attribute_id": 1, "metafield_id": 1, "title": "Type of dish", "values": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "discounts": [ { "id": 1, "ruleset_id": 1, "plan_id": 1, "ranges": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "change_product_collection_id": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ] }

Get bundle by ID

GET /bundles/{bundle_id}

A detailed description of the bundle

Path parameters

bundle_idRequiredinteger

Bundle ID

ReturnsBundle

Bundle object response

Error responses

400object

The bundle belongs to another shop, is not published, or is archived.

404object

No bundle with this ID exists.

422object

expand is not an array.

curl https://api.subbly.co/storefront/v1/bundles/{bundle_id} \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 1, "name": "Bundle Name", "slug": "Bundle slug", "digital": false, "delivery_info": "delivery_info", "images": [ { "id": 1, "url": "https://www.example.com/image.jpg", "order": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "configurable": true, "description": "description", "hidden_items": true, "searchable": false, "show_ruleset_name": false, "quantity_selectors": [ 1 ], "selection_type": "variant", "discount_type": "per_item", "price_type": "per_item", "ruleset_type": "total", "appearance_type": "one_step", "rulesets": [ { "id": 1, "name": "Ruleset Name", "products": [ {} ], "min_quantity": 1, "max_quantity": 2, "cta_text": "Add to cart", "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "plans": [ { "id": 1, "pricing": {}, "plan": {}, "variant": {}, "pricings": [ {} ], "variants": [ {} ], "prices": [ {} ], "discounts": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "preferences": [ { "id": 1, "attribute_id": 1, "metafield_id": 1, "title": "Do you want only vageterian dishes?", "values": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "filters": [ { "id": 1, "attribute_id": 1, "metafield_id": 1, "title": "Type of dish", "values": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "discounts": [ { "id": 1, "ruleset_id": 1, "plan_id": 1, "ranges": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "change_product_collection_id": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }

Quote bundle

POST /bundles/{bundle_id}/quote

An api call to calculate bundle price.

Path parameters

bundle_idRequiredinteger

Request body

product_idoptionalinteger

Variant or Pricing ID attached to the ruleset

quantityoptionalinteger
itemsoptionalQuoteBundleItemBody[]
preferencesoptionalQuoteBundlePreferenceBody[]

ReturnsBundleQuote

Bundle quote response

Error responses

400object

The bundle belongs to another shop, is not published, or is archived.

404object

No bundle with this ID exists.

422object

The body fails validation. product_id is not a published, non-archived variant or plan of this bundle in the shop; quantity is not an integer, is below 1, or is above 1 for a subscription product when the shop turns off the subscription quantity selector; preferences or items is sent for a bundle that is not configurable ("The preferences field is prohibited."); preferences do not match the bundle preferences ("The preferences is invalid."); items do not form a valid bundle selection ("The items contains the invalid product."); a preference has neither metafield_id nor attribute_id, or has no values array; an item has no product_id or quantity; or expand is not an array.

curl -X POST https://api.subbly.co/storefront/v1/bundles/{bundle_id}/quote \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "product_id": 1, "quantity": 1, "items": [ { "product_id": 1, "quantity": 1 } ], "preferences": [ { "attribute_id": 1, "metafield_id": 1, "values": [ 1 ] } ] }'
Response
{ "product_id": 1, "product": { "id": 1, "parent": {}, "product": {}, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "pricing_name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "frequency_unit": "month", "frequency_count": 1, "plan_hash": "147405d250fb632a0063872d6651e12573245c7747db4e371fe8b231562b64cb", "anchored": true, "stock_count": 100, "trial_price": null, "trial_length": null, "trial_single_order": true, "charge_immediately": true, "ship_immediately": true, "rebilling_start_at": "2022-04-01", "cut_off_at": "2022-04-01", "cut_off_time": "00:00", "setup_fee": null, "pre_order_end_at": "2022-04-01", "shippings": [ {} ], "survey": {}, "metadata": [ {} ], "commitment_billing_count": 0, "charges_limit": 0, "created_at": "2022-04-01T00:00:00.000000Z" }, "quantity": 2, "price": 799, "total": 1458, "sub_total": 1458, "tax_amount": 160, "tax_rate": 0.01, "tax_inclusive": false, "discount": 300, "preferences": [ { "attribute_id": 1, "metafield_id": 1, "values": [ 1 ] } ], "items": [ { "product_id": 1, "product": {}, "quantity": 2, "price": 799, "total": 1458, "sub_total": 1458, "tax_amount": 160, "tax_rate": 0.01, "tax_inclusive": false, "discount": 300 } ] }

Get list of bundle group items

GET /bundles/{bundle}/groups

An API endpoint to get list of bundle group items.

Path parameters

bundleRequiredinteger

Bundle ID

Query parameters

pageoptionalinteger

Page

per_pageoptionalinteger

Entities per page

expandoptionalstring[]

Expand related resources

Returnsobject

Bundle group items list response

Error responses

400object

The bundle belongs to another shop, is not published, or is archived.

404object

No bundle with this ID exists.

422object

page is not an integer or is below 1, per_page is not an integer or is outside 1-100, or expand is not an array.

curl https://api.subbly.co/storefront/v1/bundles/{bundle}/groups \ -H 'X-API-KEY: <api-key>'
Response
{ "pagination": { "current_page": 1, "last_page": 2, "from": 1, "to": 1, "total": 20 }, "data": [ { "id": 1, "product_id": 1, "product": { "id": 1, "bundle_id": 1, "bundle": {}, "bundle_ruleset_id": 1, "bundle_ruleset": {}, "slug": "yellow-t-shirt-with-pokemon-print", "type": "one_time", "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "delivery_info": "Free shipping on orders over $100", "collect_shipping_address": true, "gifting_enabled": true, "digital": false, "images": [ {} ], "metadata": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z", "gift_card": false, "gift_card_expiration": null, "variants": [ {} ], "options": [ {} ] }, "min_quantity": 1, "max_quantity": 5, "items": [ { "id": 1, "product_id": 1, "bundle_id": 1, "product": {}, "variant_id": 1, "variant": {}, "settings": [ {} ], "stock_quantity": 1, "quantity": 1, "extra_price": 1, "position": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ] }

Get list of bundle items

GET /bundles/{bundle_id}/items

An API endpoint to get list of bundle items.

Path parameters

bundle_idRequiredinteger

Bundle ID

Query parameters

pageoptionalinteger

Page

per_pageoptionalinteger

Entities per page

queryoptionalstring | null

Search entities by the query

product_ids[]optionalinteger[]Deprecated

Product IDs (deprecated - use variant_ids instead)

variant_ids[]optionalinteger[]

Filter by variant IDs

filters[]optionalobject

Filter object

Returnsobject

Bundle items list response

Error responses

400object

The bundle belongs to another shop, is not published, or is archived.

404object

No bundle with this ID exists.

422object

A query parameter fails validation. filters is not an array; a filter has neither metafield_id nor attribute_id, or its ID is not a preset single-line text metafield of the shop (errors for both keys appear under filters.N.attribute_id); a filter has no values array, or a value ID is not an integer or does not exist; product_ids or variant_ids is not an array of integers; query is longer than 50 characters; page is below 1; per_page is outside 1-500; or expand is not an array.

curl https://api.subbly.co/storefront/v1/bundles/{bundle_id}/items \ -H 'X-API-KEY: <api-key>'
Response
{ "pagination": { "current_page": 1, "last_page": 2, "from": 1, "to": 1, "total": 20 }, "data": [ { "id": 1, "product_id": 1, "bundle_id": 1, "product": { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "stock_count": 100, "parent": {}, "product": {}, "metadata": [ {} ], "attributes": [ {} ], "options": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "variant_id": 1, "variant": { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "stock_count": 100, "parent": {}, "product": {}, "metadata": [ {} ], "attributes": [ {} ], "options": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "settings": [ { "id": 1, "ruleset_id": 1, "max_quantity": 3, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "stock_quantity": 1, "quantity": 1, "extra_price": 1, "position": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ] }

Get the list of bundle items associated with multiple bundles

GET /bundle/items

An API endpoint to get the list of bundle items associated with multiple bundles.

Query parameters

bundle_ids[]Requiredinteger[]

Bundle IDs

pageoptionalinteger

Page

per_pageoptionalinteger

Entities per page

queryoptionalstring | null

Search entities by the query

product_ids[]optionalinteger[]

Product IDs

filters[]optionalobject

Filter object

Returnsobject

Bundle items list response

Error responses

422object

A query parameter fails validation. bundle_ids is missing or not an array, or an entry is not an integer, repeats, or is not a published, non-archived bundle of the shop; filters is not an array; a filter has neither metafield_id nor attribute_id, or its ID is not a preset single- line text metafield of the shop (errors for both keys appear under filters.N.attribute_id); a filter has no values array, or a value ID is not an integer or does not exist; product_ids is not an array of integers; query is longer than 50 characters; page is below 1; per_page is outside 1-500; or expand is not an array.

curl https://api.subbly.co/storefront/v1/bundle/items \ -H 'X-API-KEY: <api-key>'
Response
{ "pagination": { "current_page": 1, "last_page": 2, "from": 1, "to": 1, "total": 20 }, "data": [ { "id": 1, "product_id": 1, "bundle_id": 1, "product": { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "stock_count": 100, "parent": {}, "product": {}, "metadata": [ {} ], "attributes": [ {} ], "options": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "variant_id": 1, "variant": { "id": 1, "bundle_plan_id": 1, "bundle_plan": {}, "name": "Yellow T-shirt with pokemon print", "description": "Yellow T-shirt with pokemon print", "price": 799, "price_schema": {}, "stock_count": 100, "parent": {}, "product": {}, "metadata": [ {} ], "attributes": [ {} ], "options": [ {} ], "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" }, "settings": [ { "id": 1, "ruleset_id": 1, "max_quantity": 3, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ], "stock_quantity": 1, "quantity": 1, "extra_price": 1, "position": 1, "created_at": "2022-04-01T00:00:00.000000Z", "updated_at": "2022-04-01T00:00:00.000000Z" } ] }
paginationobject
dataBundle[]
idinteger
namestring
slugstring
digitalboolean
delivery_infostring | null
imagesProductImage[]
configurableboolean
descriptionstring | null
hidden_itemsboolean
searchableboolean
show_ruleset_nameboolean
quantity_selectorsinteger[]
selection_typestring | null

Possible values: variant, product, single_product.

discount_typestring | null

Possible values: per_item, total, percentage.

price_typestring | null

Possible values: per_item, total.

ruleset_typestring

Possible values: total, quantity.

appearance_typestring

Possible values: one_step, two_step, without_ruleset, after_checkout.

rulesetsBundleRuleset[]
plansBundlePlan[]
preferencesBundlePreference[]
filtersBundleFilter[]
discountsBundleDiscount[]
change_product_collection_idinteger | null

ID of the product collection used for cross-product plan switching.

created_atstring

Format: date-time.

updated_atstring

Format: date-time.

product_idoptionalinteger

Variant ID

quantityoptionalinteger
attribute_idoptionalintegerDeprecated
metafield_idoptionalinteger
valuesoptionalinteger[]
product_idinteger
productPlan | Variant | null

Expandable link to the variant or pricing.

quantityinteger
priceinteger
totalinteger
sub_totalinteger
tax_amountinteger
tax_ratenumber
tax_inclusiveboolean

Defaults to false.

discountinteger
preferencesBundleQuotePreference[]
itemsBundleQuoteItem[]
paginationobject
dataBundleGroupItem[]
attribute_idoptionalintegerDeprecated
metafield_idoptionalinteger
valuesoptionalinteger[]
paginationobject
dataBundleItem[]
attribute_idoptionalintegerDeprecated
metafield_idoptionalinteger
valuesoptionalinteger[]
paginationobject
dataBundleItem[]