Collections
Hand-picked (custom) and automated (smart) collections of products.
Endpoints#
- GET
/collections.jsonList collections - GET
/collections/count.jsonCount collections - GET
/collections/{id}.jsonGet a collection - POST
/collections.jsonCreate a collection - PUT
/collections/{id}.jsonUpdate a collection - DELETE
/collections/{id}.jsonDelete a collection - GET
/collections/{id}/products.jsonList a collection's products
Paths are relative to https://store.weftgrid.com/api/admin/2026-10. The examples read the token from $STORELOOM_TOKEN and ids from variables like $ORDER_ID.
The collection object#
What the endpoints below return for one collection, and the payload of the collections/create, collections/update webhooks.
{
"id": "cm2coll01",
"title": "Under $30",
"handle": "under-30",
"body_html": "<p>Small gifts and everyday treats.</p>",
"image": {
"src": "https://storeloom.example/seed/candle-amber.svg"
},
"collection_type": "smart",
"rules": [
{
"column": "variant_price",
"relation": "less_than",
"condition": "30.00"
}
],
"disjunctive": false,
"sort_order": "price_asc",
"products_count": 6,
"seo_title": null,
"seo_description": null,
"template_suffix": null,
"created_at": "2026-10-01T09:00:00.000Z",
"updated_at": "2026-10-20T14:12:00.000Z"
}List collections#
/collections.jsonread_productsBoth kinds: custom (hand-picked products, kept in order) and smart (products that match rules). products_count counts products in every status.
| Parameter | Description |
|---|---|
limit | Results per page, 1–250 (default 50). |
page_info | Cursor from the Link header for the next or previous page. |
since_id | Only results after this id. |
ids | Comma-separated ids. |
collection_type | custom (hand-picked) or smart (automated by rules). |
title | Collections whose title contains this text. |
handle | Comma-separated handles. |
product_id | Collections this product is in, including smart collections it matches. |
created_at_min / created_at_max, updated_at_min / updated_at_max | ISO 8601 bounds. |
fields | Comma-separated fields to return, e.g. id,title,products_count. |
curl "https://store.weftgrid.com/api/admin/2026-10/collections.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{ "collections": [ … ] }Count collections#
/collections/count.jsonread_products| Parameter | Description |
|---|---|
collection_type, title, product_id, created_at_*, updated_at_* | Same filters as the list. |
curl "https://store.weftgrid.com/api/admin/2026-10/collections/count.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{ "count": 5 }Get a collection#
/collections/{id}.jsonread_productscurl "https://store.weftgrid.com/api/admin/2026-10/collections/$COLLECTION_ID.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{
"collection": {
"id": "cm2coll01",
"title": "Under $30",
"handle": "under-30",
"body_html": "<p>Small gifts and everyday treats.</p>",
"image": { "src": "https://storeloom.example/seed/candle-amber.svg" },
"collection_type": "smart",
"rules": [{ "column": "variant_price", "relation": "less_than", "condition": "30.00" }],
"disjunctive": false,
"sort_order": "price_asc",
"products_count": 6,
"seo_title": null,
"seo_description": null,
"template_suffix": null,
"created_at": "2026-10-01T09:00:00.000Z",
"updated_at": "2026-10-20T14:12:00.000Z"
}
}Create a collection#
/collections.jsonwrite_productscollection_type is custom (default) or smart (also implied when rules are sent). Custom collections take product_ids, in display order. Rules: column is one of title, type, vendor, tag, variant_price, variant_compare_at_price, variant_inventory, variant_weight (grams) or variant_title; relation is equals, not_equals, greater_than, less_than (numbers and prices), starts_with, ends_with, contains or not_contains (text). Price conditions are decimal strings like "30.00". disjunctive: true matches any rule instead of all. sort_order: manual (custom only), alpha_asc, alpha_desc, price_asc, price_desc, created_desc or created_asc.
{
"collection": {
"title": "Linen",
"body_html": "<p>Washed European linen.</p>",
"collection_type": "smart",
"rules": [{ "column": "tag", "relation": "equals", "condition": "linen" }],
"sort_order": "alpha_asc",
"image": { "src": "https://example.com/linen.jpg" }
}
}curl -X POST "https://store.weftgrid.com/api/admin/2026-10/collections.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"collection": {
"title": "Linen",
"body_html": "<p>Washed European linen.</p>",
"collection_type": "smart",
"rules": [{ "column": "tag", "relation": "equals", "condition": "linen" }],
"sort_order": "alpha_asc",
"image": { "src": "https://example.com/linen.jpg" }
}
}'Example responseShowHide
{
"collection": {
"id": "cm2coll01",
"title": "Under $30",
"handle": "under-30",
"body_html": "<p>Small gifts and everyday treats.</p>",
"image": { "src": "https://storeloom.example/seed/candle-amber.svg" },
"collection_type": "smart",
"rules": [{ "column": "variant_price", "relation": "less_than", "condition": "30.00" }],
"disjunctive": false,
"sort_order": "price_asc",
"products_count": 6,
"seo_title": null,
"seo_description": null,
"template_suffix": null,
"created_at": "2026-10-01T09:00:00.000Z",
"updated_at": "2026-10-20T14:12:00.000Z"
}
}Update a collection#
/collections/{id}.jsonwrite_productsFields you leave out keep their values. product_ids (custom collections) replaces the products and their order; rules (smart collections) replaces the rules. The collection type can't change.
{ "collection": { "title": "Best sellers", "product_ids": ["cm2product03", "cm2product01"], "sort_order": "manual" } }curl -X PUT "https://store.weftgrid.com/api/admin/2026-10/collections/$COLLECTION_ID.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "collection": { "title": "Best sellers", "product_ids": ["cm2product03", "cm2product01"], "sort_order": "manual" } }'Example responseShowHide
{
"collection": {
"id": "cm2coll01",
"title": "Under $30",
"handle": "under-30",
"body_html": "<p>Small gifts and everyday treats.</p>",
"image": { "src": "https://storeloom.example/seed/candle-amber.svg" },
"collection_type": "smart",
"rules": [{ "column": "variant_price", "relation": "less_than", "condition": "30.00" }],
"disjunctive": false,
"sort_order": "price_asc",
"products_count": 6,
"seo_title": null,
"seo_description": null,
"template_suffix": null,
"created_at": "2026-10-01T09:00:00.000Z",
"updated_at": "2026-10-20T14:12:00.000Z"
}
}Delete a collection#
/collections/{id}.jsonwrite_productsIts products stay in the store. The collection's metafields are deleted with it.
curl -X DELETE "https://store.weftgrid.com/api/admin/2026-10/collections/$COLLECTION_ID.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{}List a collection's products#
/collections/{id}/products.jsonread_productsProducts in the collection's sort order (for smart collections, the products matching its rules right now), in every status. Paginate with limit and the page_info cursor from the Link header.
| Parameter | Description |
|---|---|
limit | Results per page, 1–250 (default 50). |
page_info | Cursor from the Link header. |
fields | Comma-separated product fields to return. |
curl "https://store.weftgrid.com/api/admin/2026-10/collections/$COLLECTION_ID/products.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{ "products": [{ "id": "cm2product01", "title": "Linen shirt", "variants": [ … ], … }] }