Browse the API docs

Collections

Hand-picked (custom) and automated (smart) collections of products.

Endpoints#

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.

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"
}

List collections#

GET/collections.jsonread_products

Both kinds: custom (hand-picked products, kept in order) and smart (products that match rules). products_count counts products in every status.

Query parameters
ParameterDescription
limitResults per page, 1–250 (default 50).
page_infoCursor from the Link header for the next or previous page.
since_idOnly results after this id.
idsComma-separated ids.
collection_typecustom (hand-picked) or smart (automated by rules).
titleCollections whose title contains this text.
handleComma-separated handles.
product_idCollections this product is in, including smart collections it matches.
created_at_min / created_at_max, updated_at_min / updated_at_maxISO 8601 bounds.
fieldsComma-separated fields to return, e.g. id,title,products_count.
Request
curl "https://store.weftgrid.com/api/admin/2026-10/collections.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"
Example responseShow
{ "collections": [ … ] }

Count collections#

GET/collections/count.jsonread_products
Query parameters
ParameterDescription
collection_type, title, product_id, created_at_*, updated_at_*Same filters as the list.
Request
curl "https://store.weftgrid.com/api/admin/2026-10/collections/count.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"
Example responseShow
{ "count": 5 }

Get a collection#

GET/collections/{id}.jsonread_products
Request
curl "https://store.weftgrid.com/api/admin/2026-10/collections/$COLLECTION_ID.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"
Example responseShow
{
  "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#

POST/collections.jsonwrite_products

collection_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.

Request body
{
  "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" }
  }
}
Request with curl
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 responseShow
{
  "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#

PUT/collections/{id}.jsonwrite_products

Fields 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.

Request body
{ "collection": { "title": "Best sellers", "product_ids": ["cm2product03", "cm2product01"], "sort_order": "manual" } }
Request with curl
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 responseShow
{
  "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#

DELETE/collections/{id}.jsonwrite_products

Its products stay in the store. The collection's metafields are deleted with it.

Request
curl -X DELETE "https://store.weftgrid.com/api/admin/2026-10/collections/$COLLECTION_ID.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"
Example responseShow
{}

List a collection's products#

GET/collections/{id}/products.jsonread_products

Products 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.

Query parameters
ParameterDescription
limitResults per page, 1–250 (default 50).
page_infoCursor from the Link header.
fieldsComma-separated product fields to return.
Request
curl "https://store.weftgrid.com/api/admin/2026-10/collections/$COLLECTION_ID/products.json" \
  -H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"
Example responseShow
{ "products": [{ "id": "cm2product01", "title": "Linen shirt", "variants": [ … ], … }] }