Skip to content

API Documentation: Objects: Collection

kpthill edited this page Dec 3, 2012 · 4 revisions

Go back to read introductory information and usage guidelines about the API.

Object name

custom_collection

Associated Capabilities

read_products

Object Description

A Custom Collection is a collection of products chosen by the merchant. It often, but not always, represents a category of good sold by the merchant, such as "jeans", "electronics", or "bath products".

The Lexity implementation of this API is intended to be familiar to Shopify developers, and so the fields that a product may contain are the same as those currently offered by the Shopify API. Because we do not store all of the data that Shopify does, some of these fields may be null. The provided fields are:

Field Description Notes
body_html The displayable description of the collection.
handle Always null. Not yet supported.
id The platform-specific unique product id, as a string.
published_at Always null. Not yet supported.
sort_order Always null. Not yet supported.
template_suffix Always null. Not yet supported.
title The name of the collection.
updated_at The date the collection was last updated. Format: ISO 8601
image Always null. Not yet supported.

Support for these fields may vary among the different platforms we support.

Query Parameters Available for this Object:

Field Description Notes
product_id Show all collections containing the product with the given product_id.
title Show all collections with the given title.
limit Limit of number of objects in the response. Defaults to 50, maximum allowed value is 250.
page For paginated responses, the page to show. Defaults to 1.
since_id Only show objects with product_id greater than this value. Works by string comparison, even if the strings hold integers.
updated_at_min Show objects updated after this date. Format: YYYY-MM-DD
updated_at_max Show objects updated before this date. Format: YYYY-MM-DD
fields Comma-separated string with the fields you want returned in the response body. Returns all fields by default.

Available API Interactions

Get all collections

Request

GET {base_url}/custom_collections.json

Request data

(empty)

Example response

HTTP/1.1 200 OK


{
    "custom_collections": [{
        "updated_at": "2010-05-14T02:02:36Z",
        "sort_order": null,
        "title": "Frontpage",
        "body_html": "",
        "id": "1602302",
        "template_suffix": null,
        "handle": null,
        "published_at": null
    }, {
        "updated_at": "2010-05-14T02:02:36Z",
        "sort_order": null,
        "title": "Free Shipping",
        "body_html": "",
        "id": "1805462",
        "template_suffix": null,
        "handle": null,
        "published_at": null
    }]
}


Get a collection by id

Request

GET {base_url}/custom_collections/{collection_id}.json

Request data

(empty)

Example response

HTTP/1.1 200 OK

{
    "custom_collection": {
        "updated_at": "2010-05-14T02:02:36Z",
        "sort_order": null,
        "title": "Frontpage",
        "body_html": "",
        "id": "1602302",
        "template_suffix": null,
        "handle": null,
        "published_at": null
    }
}

Count products

Request

GET {base_url}/products/count.json

Request data

(empty)

Example response

HTTP/1.1 200 OK

{
  "count": 2
}