Shopify API – CustomCollection

top

Receive a list of all CustomCollections

Get a list of all custom collections that contain a given product

Available URL Query parameters:

  • limit — Amount of results (default: 50) (maximum: 250)
  • page — Page to show (default: 1)
  • title — Show custom collections with given title
  • product_id — Show custom collections that includes given product
  • updated_at_min — Show custom collections last updated after date (format: 2008-01-01 03:00)
  • updated_at_max — Show custom collections last updated before date (format: 2008-01-01 03:00)
GET /admin/custom_collections.xml

List all collections

Response

           
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<custom-collections type="array">
  <custom-collection>
    <body>The best selling ipod ever</body>
    <body-html>&lt;p&gt;The best selling ipod ever&lt;/p&gt;</body-html>
    <handle>ipods</handle>
    <id type="integer">841564294</id>
    <published-at type="datetime">2008-02-01T19:00:00-05:00</published-at>
    <sort-order>manual</sort-order>
    <template-suffix nil="true"></template-suffix>
    <title>IPods</title>
    <updated-at type="datetime">2008-02-01T19:00:00-05:00</updated-at>
  </custom-collection>
</custom-collections>
GET /admin/custom_collections.xml?product_id=1706652214

List all custom collections for a certain product_id

Response

           
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<custom-collections type="array">
  <custom-collection>
    <body>The best selling ipod ever</body>
    <body-html>&lt;p&gt;The best selling ipod ever&lt;/p&gt;</body-html>
    <handle>ipods</handle>
    <id type="integer">841564294</id>
    <published-at type="datetime">2008-02-01T19:00:00-05:00</published-at>
    <sort-order>manual</sort-order>
    <template-suffix nil="true"></template-suffix>
    <title>IPods</title>
    <updated-at type="datetime">2008-02-01T19:00:00-05:00</updated-at>
  </custom-collection>
</custom-collections>
top

Receive a count of all CustomCollections

Get a count of all custom collections that contain a given product

Available URL Query parameters:

  • title — Count custom collections with given title
  • product_id — Count custom collections that includes given product
  • updated_at_min — Count custom collections last updated after date (format: 2008-01-01 03:00)
  • updated_at_max — Count custom collections last updated before date (format: 2008-01-01 03:00)
GET /admin/custom_collections/count.xml

Count all collections

Response

           
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<count type="integer">1</count>
GET /admin/custom_collections/count.xml?product_id=1706652214

Count all custom collections for a certain product_id

Response

           
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<count type="integer">1</count>
top

Receive a single CustomCollection

Get a single custom collection

GET /admin/custom_collections/#{id}.xml

Get a specific collection by ID

Response

           
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<custom-collection>
  <body>The best selling ipod ever</body>
  <body-html>&lt;p&gt;The best selling ipod ever&lt;/p&gt;</body-html>
  <handle>ipods</handle>
  <id type="integer">841564294</id>
  <published-at type="datetime">2008-02-01T19:00:00-05:00</published-at>
  <sort-order>manual</sort-order>
  <template-suffix nil="true"></template-suffix>
  <title>IPods</title>
  <updated-at type="datetime">2008-02-01T19:00:00-05:00</updated-at>
</custom-collection>
top

Create a new CustomCollection

Create a new custom collection

POST /admin/custom_collections.xml

Create a collection with title Macbooks

Request

           
<?xml version="1.0" encoding="UTF-8"?>
<custom-collection>
  <title>Macbooks</title>
</custom-collection>      

Response

           
HTTP/1.1 201 Created
<?xml version="1.0" encoding="UTF-8"?>
<custom-collection>
  <body nil="true"></body>
  <body-html nil="true"></body-html>
  <handle>macbooks</handle>
  <id type="integer">1692861631</id>
  <published-at type="datetime">2009-10-20T07:25:52-04:00</published-at>
  <sort-order>alpha-asc</sort-order>
  <template-suffix nil="true"></template-suffix>
  <title>Macbooks</title>
  <updated-at type="datetime">2009-10-20T07:25:52-04:00</updated-at>
</custom-collection>
top

Modify an existing CustomCollection

Update an existing custom collection

PUT /admin/custom_collections/#{id}.xml

Change the description of the IPod collection

Request

           
<?xml version="1.0" encoding="UTF-8"?>
<custom-collection>
  <body-html>&lt;p&gt;The best selling ipod ever&lt;/p&gt;</body-html>
  <handle>ipods</handle>
  <title>IPods</title>
  <body>5000 songs in your pocket</body>
  <template-suffix nil="true"></template-suffix>
  <updated-at type="datetime">2008-02-02T00:00:00Z</updated-at>
  <sort-order>manual</sort-order>
  <id type="integer">841564294</id>
  <published-at type="datetime">2008-02-02T00:00:00Z</published-at>
</custom-collection>      

Response

           
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<custom-collection>
  <body>5000 songs in your pocket</body>
  <body-html>&lt;p&gt;5000 songs in your pocket&lt;/p&gt;</body-html>
  <handle>ipods</handle>
  <id type="integer">841564294</id>
  <published-at type="datetime">2008-02-01T19:00:00-05:00</published-at>
  <sort-order>manual</sort-order>
  <template-suffix nil="true"></template-suffix>
  <title>IPods</title>
  <updated-at type="datetime">2009-10-20T07:25:58-04:00</updated-at>
</custom-collection>
PUT /admin/custom_collections/#{id}.xml

Show a hidden collection by changing the published attribute to true

Request

           
<?xml version="1.0" encoding="UTF-8"?>
<custom-collection>
  <published type="boolean">true</published>
  <id type="integer">841564294</id>
</custom-collection>      

Response

           
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<custom-collection>
  <body>The best selling ipod ever</body>
  <body-html>&lt;p&gt;The best selling ipod ever&lt;/p&gt;</body-html>
  <handle>ipods</handle>
  <id type="integer">841564294</id>
  <published-at type="datetime">2009-10-20T07:25:59-04:00</published-at>
  <sort-order>manual</sort-order>
  <template-suffix nil="true"></template-suffix>
  <title>IPods</title>
  <updated-at type="datetime">2009-10-20T07:25:59-04:00</updated-at>
</custom-collection>
top

Remove a CustomCollection from the database

DELETE /admin/custom_collections/#{id}.xml

Remove ipod custom collection

Response

           
HTTP/1.1 200 OK
Last updated at Oct 2009 Oct:10 AM.