Shopify API – Collect

top

Create a new Collect

Add a product to a collection

POST /admin/collects.xml

Create a new link between an existing product an an existing collection

Request

           
<?xml version="1.0" encoding="UTF-8"?>
<collect>
  <product-id type="integer">921728735</product-id>
  <collection-id type="integer">841564294</collection-id>
</collect>      

Response

           
HTTP/1.1 201 Created
<?xml version="1.0" encoding="UTF-8"?>
<collect>
  <collection-id type="integer">841564294</collection-id>
  <featured type="boolean">false</featured>
  <id type="integer">2086329238</id>
  <position type="integer">2</position>
  <product-id type="integer">921728735</product-id>
</collect>
top

Remove a Collect from the database

Remove a product from a collection

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

Destroy the link between a product an a collection

Response

           
HTTP/1.1 200 OK
top

Receive a list of all Collects

List all collects or only those for specific products or collections

GET /admin/collects.xml

List all collects for your shop

Response

           
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<collects type="array">
  <collect>
    <collection-id type="integer">841564294</collection-id>
    <featured type="boolean">false</featured>
    <id type="integer">841564294</id>
    <position type="integer">1</position>
    <product-id type="integer">1706652214</product-id>
  </collect>
</collects>
GET /admin/collects.xml?collection_id=841564294

List only collects for a certain collection

Response

           
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<collects type="array">
  <collect>
    <collection-id type="integer">841564294</collection-id>
    <featured type="boolean">false</featured>
    <id type="integer">841564294</id>
    <position type="integer">1</position>
    <product-id type="integer">1706652214</product-id>
  </collect>
</collects>
GET /admin/collects.xml?product_id=1706652214

List only collects for a certain product

Response

           
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<collects type="array">
  <collect>
    <collection-id type="integer">841564294</collection-id>
    <featured type="boolean">false</featured>
    <id type="integer">841564294</id>
    <position type="integer">1</position>
    <product-id type="integer">1706652214</product-id>
  </collect>
</collects>
top

Receive a count of all Collects

Get a count of all collects or only those for specific products or collections

GET /admin/collects/count.xml

Count all collects for your shop

Response

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

Count only collects for a certain collection

Response

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

Count only collects for a certain product

Response

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

Receive a single Collect

Get the collect with a certain id, or for a given product AND collection

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

Return a collect with a certain id

Response

           
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<collect>
  <collection-id type="integer">841564294</collection-id>
  <featured type="boolean">false</featured>
  <id type="integer">841564294</id>
  <position type="integer">1</position>
  <product-id type="integer">1706652214</product-id>
</collect>
GET /admin/collects.xml?collection_id=841564294&product_id=1706652214

Return an existing collect for a given product_id and collection_id

Response

           
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<collects type="array">
  <collect>
    <collection-id type="integer">841564294</collection-id>
    <featured type="boolean">false</featured>
    <id type="integer">841564294</id>
    <position type="integer">1</position>
    <product-id type="integer">1706652214</product-id>
  </collect>
</collects>
Last updated at Oct 2009 Oct:10 AM.