Order API
Collection2
Represents a collection of products in the ecommerce system.
Any grouping of products can (and probably should) be considered a collection. These include:
- Explicitly defined collections
- Categories and subcategories
- Automatically computed collections
Properties
id
stringrequiredID of the product collection in the ecommerce system
In case of Shopify, this is just a number without
gid://shopify/Collection/
prefix. If your system gives similar fixed prefixes to products, we recommend that you strip them as well.Example:
"SUMMER2023"
Example:
"BESTSELLERS"
slug
stringoptionalsecondary, URL-friendly identifier of the collection in the ecommerce system
This is a highly optional field only relevant to a minority of ecommerce systems, those that sometimes need to identify collections by slug.
title
stringrequired when creating/updatingA user-visible name of the collection
Should be specified in all cases, except when you're merely referencing an existing collection by ID (in which case you'll only specify a single field,
id
).Example:
"Summer Collection"
Example:
"Best Sellers"
product_ids
array of stringoptionalProduct IDs belonging to this collection.
Lists all products that belong to this collection by their external IDs. Products that don't exist will be created with minimal data.
This field preserves existing product associations with other collections - it only updates the membership for this specific collection.
This is the preferred way to specify product-collection associations when you already have product data.
Example:
["P123","P124","P125"]
Products belonging to this collection with their full data.
You can either pass product IDs only (i.e. an array of objects with a single
id
property) to reference existing products, or full product objects to create/update the products as well.This field is useful when you want to create/update products and assign them to collections in a single call.
Example:
[{"id":"P200","title":"Top Seller #1"},{"id":"P201","title":"Top Seller #2"},{"id":"P202"}]
deleted
booleanoptionalSet to true to delete this collection in our system
Bubblehouse does not have deletion APIs for most objects; instead, pass
deleted: true
when updating an object. Note that we won't delete the data immediately, in case there are other objects referencing this one.
Examples
Collection with Product IDs
{ "id": "SUMMER2023", "title": "Summer Collection", "product_ids": [ "P123", "P124", "P125" ] }
Collection with Products
{ "id": "BESTSELLERS", "title": "Best Sellers", "products": [ { "id": "P200", "title": "Top Seller #1" }, { "id": "P201", "title": "Top Seller #2" }, { "id": "P202" } ] }