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

Product Collection

Private Product Collection API endpoints

Endpoints
  • GET/products/collections
  • POST/products/collections
  • GET/products/collections/{collection_id}
  • PUT/products/collections/{collection_id}
  • POST/products/collections/{collection_id}/publish
  • POST/products/collections/{collection_id}/unpublish
  • POST/products/collections/{collection_id}/archive
  • GET/products/collections/{collection_id}/items
  • POST/products/collections/{collection_id}/items

Get list of product collections

GET /products/collections

Query parameters

pageoptionalinteger

Page number for pagination

per_pageoptionalinteger

Items per page

ids[]optionalinteger[]

Filter by collection IDs

slugs[]optionalstring[]

Filter by collection slugs

publishedoptionalboolean

Filter by published status

typeoptionalstring | null

Filter by collection type

sort[field]optionalstring

Field to sort by. Required whenever any sort[...] key is sent; passing sort[direction] without sort[field] returns 422.

Possible values: id, name.

sort[direction]optionalstring

Sort direction; defaults to asc.

Possible values: asc, desc.

Defaults to "asc".

Returnsobject

Product collections list response

curl https://api.subbly.co/private/v1/products/collections \ -H 'X-API-KEY: <api-key>'
Response
{ "pagination": { "current_page": 1, "last_page": 2, "from": 1, "to": 1, "total": 20 }, "data": [ { "id": 1, "shop_id": 1, "name": "Summer Collection", "slug": "summer-collection", "type": "subscription", "published": true, "archived": false, "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ] }

Create a product collection

POST /products/collections

Request body

nameRequiredstring
slugRequiredstring

Must be unique among the shop's product collections. A slug already in use returns 422.

typeoptionalstring | null
itemsoptionalobject | null

ReturnsProductCollection

Product collection created

curl -X POST https://api.subbly.co/private/v1/products/collections \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "name": "name", "slug": "slug", "type": "type", "items": { "create": [ { "variant_id": 1, "position": 0 } ] } }'
Response
{ "id": 1, "shop_id": 1, "name": "Summer Collection", "slug": "summer-collection", "type": "subscription", "published": true, "archived": false, "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" }

Get product collection by ID

GET /products/collections/{collection_id}

Path parameters

collection_idRequiredinteger

Collection ID

ReturnsProductCollection

Product collection response

Error responses

400object

The collection is archived.

curl https://api.subbly.co/private/v1/products/collections/{collection_id} \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 1, "shop_id": 1, "name": "Summer Collection", "slug": "summer-collection", "type": "subscription", "published": true, "archived": false, "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" }

Update a product collection

PUT /products/collections/{collection_id}

Path parameters

collection_idRequiredinteger

Collection ID

Request body

nameoptionalstring
slugoptionalstring

Must be unique among the shop's product collections, ignoring this collection itself. A slug used by another collection returns 422.

ReturnsProductCollection

Product collection updated

Error responses

400object

The collection is archived.

curl -X PUT https://api.subbly.co/private/v1/products/collections/{collection_id} \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "name": "name", "slug": "slug" }'
Response
{ "id": 1, "shop_id": 1, "name": "Summer Collection", "slug": "summer-collection", "type": "subscription", "published": true, "archived": false, "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" }

Publish a product collection

POST /products/collections/{collection_id}/publish

Path parameters

collection_idRequiredinteger

Collection ID

ReturnsProductCollection

Product collection published

Error responses

400object

The collection has no items, or the collection is archived.

curl -X POST https://api.subbly.co/private/v1/products/collections/{collection_id}/publish \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 1, "shop_id": 1, "name": "Summer Collection", "slug": "summer-collection", "type": "subscription", "published": true, "archived": false, "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" }

Unpublish a product collection

POST /products/collections/{collection_id}/unpublish

Path parameters

collection_idRequiredinteger

Collection ID

ReturnsProductCollection

Product collection unpublished

Error responses

400object

The collection is archived.

curl -X POST https://api.subbly.co/private/v1/products/collections/{collection_id}/unpublish \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 1, "shop_id": 1, "name": "Summer Collection", "slug": "summer-collection", "type": "subscription", "published": true, "archived": false, "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" }

Archive a product collection

POST /products/collections/{collection_id}/archive

Path parameters

collection_idRequiredinteger

Collection ID

ReturnsProductCollection

Product collection archived

Error responses

400object

The collection is archived, so archiving is not idempotent.

curl -X POST https://api.subbly.co/private/v1/products/collections/{collection_id}/archive \ -H 'X-API-KEY: <api-key>'
Response
{ "id": 1, "shop_id": 1, "name": "Summer Collection", "slug": "summer-collection", "type": "subscription", "published": true, "archived": false, "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" }

Get list of collection groups with items

GET /products/collections/{collection_id}/items

Lists the collection's groups, each with its items. Returns 400 entity_archived if the collection is archived.

Path parameters

collection_idRequiredinteger

Collection ID

Query parameters

pageoptionalinteger

Page number for pagination

Defaults to 1.

per_pageoptionalinteger

Groups per page; each group carries all of its items.

Defaults to 10.

expand[]optionalstring[]

List of relations to expand. product expands the group's parent product. items is always returned; use items.variant to expand each item's variant.

Returnsobject

Collection groups list response

curl https://api.subbly.co/private/v1/products/collections/{collection_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, "collection_id": 1, "product_id": 5, "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": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [ { "id": 1, "value": "new" }, { "id": 2, "value": "featured" } ], "published": true, "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00", "gift_card": false, "gift_card_expiration": null, "funnel_id": 1, "tax_product_code": "tax_product_code", "variants_count": 3, "variants": [ {} ], "options": [ {} ] }, "items": [ { "id": 1, "variant_id": 10, "product_id": 5, "position": 0, "variant": {}, "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ] }

Sync collection items

POST /products/collections/{collection_id}/items

Create, update, and delete collection items in a single request. Operations run in the order delete, update, create. Returns 400 entity_archived if the collection is archived, and collection_empty if the request would leave a published collection with no items. All three arrays are optional; an empty body is a no-op that returns the current groups. Entries whose id is not part of this collection, and create entries whose variant_id does not resolve to a product, are skipped silently and the request still returns 200. Compare the returned groups against what you sent to confirm.

Path parameters

collection_idRequiredinteger

Collection ID

Request body

createoptionalobject[]
updateoptionalobject[]
deleteoptionalobject[]
idRequiredinteger

Returnsobject

Collection groups with synced items. Always returns the first page of groups (up to 100) with items expanded. The expand parameter is not supported on this operation, so product is never expanded here; call GET /products/collections/{collection_id}/items to expand it.

curl -X POST https://api.subbly.co/private/v1/products/collections/{collection_id}/items \ -H 'X-API-KEY: <api-key>' \ -H 'Content-Type: application/json' \ -d '{ "create": [ { "variant_id": 1, "group_id": 1, "position": 0 } ], "update": [ { "id": 1, "position": 0, "group_id": 1 } ], "delete": [ { "id": 1 } ] }'
Response
{ "pagination": { "current_page": 1, "last_page": 2, "from": 1, "to": 1, "total": 20 }, "data": [ { "id": 1, "collection_id": 1, "product_id": 5, "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": [ {} ], "tags": [ "new", "featured" ], "tags_meta": [ { "id": 1, "value": "new" }, { "id": 2, "value": "featured" } ], "published": true, "metadata": [ {} ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00", "gift_card": false, "gift_card_expiration": null, "funnel_id": 1, "tax_product_code": "tax_product_code", "variants_count": 3, "variants": [ {} ], "options": [ {} ] }, "items": [ { "id": 1, "variant_id": 10, "product_id": 5, "position": 0, "variant": {}, "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ], "created_at": "2022-04-01 00:00:00", "updated_at": "2022-04-01 00:00:00" } ] }
paginationobject
dataProductCollection[]
createoptionalobject[]
idinteger
shop_idinteger
namestring
slugstring
typestring | null
publishedboolean
archivedboolean
created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idinteger
shop_idinteger
namestring
slugstring
typestring | null
publishedboolean
archivedboolean
created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idinteger
shop_idinteger
namestring
slugstring
typestring | null
publishedboolean
archivedboolean
created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idinteger
shop_idinteger
namestring
slugstring
typestring | null
publishedboolean
archivedboolean
created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idinteger
shop_idinteger
namestring
slugstring
typestring | null
publishedboolean
archivedboolean
created_atstring

Format: date-time.

updated_atstring

Format: date-time.

idinteger
shop_idinteger
namestring
slugstring
typestring | null
publishedboolean
archivedboolean
created_atstring

Format: date-time.

updated_atstring

Format: date-time.

paginationobject
dataProductCollectionGroup[]
variant_idRequiredinteger
group_idoptionalinteger | null

Accepted but ignored on create. New items are always placed in the group for the variant's parent product, creating that group if needed. Use update[].group_id to move an existing item.

positionoptionalinteger | null

Sort position. When omitted or null, defaults to the entry's zero-based index within this create array.

idRequiredinteger
positionoptionalinteger | null
group_idoptionalinteger | null
paginationobject
dataProductCollectionGroup[]