Collections

Collections are used to group and display products on your website and pos.

The collection object

{
 "id": "dfdd3929-5a24-4340-b9e1-eedfe25e8a63",
 "title": "Wine",
 "type": "Manual",
 "content": "Collection of all wines",
 "webStatus": "Available",
 "adminStatus": "Available",
 "slug": "wine",
  "featureImage":
  "https://images.commerce7.com/images/collection/gold_library_wines-1526928166546.png",
 "createdAt": "2018-05-18T16:53:47.913Z",
 "updatedAt": "2018-05-18T16:53:47.913Z",
 "seo": {
  "title": "Wine",
  "description": "Collection of all wines"
 }
}

Create a collection

POST: /collection

{
 "title": "Gold Library Wines",
 "content": "Library wines reserved for gold club members",
 "type": "Manual",
 "webStatus": "Available",
 "adminStatus": "Available",
}

RESPONSE: responds with a collection object.

Retrieve a collection

GET: /collection/:id

RESPONSE: responds with a collection object.

Update a collection

PUT: /collection/:id

{
 "title": "Gold Library Wines",
 "content": "<p>Library wines reserved for gold club members.</p>",
 "slug": "gold-library-wines",
 "webStatus": "Available",
 "adminStatus": "Available",
 "seo": {
  "title": "Gold Library Wines",
  "description": "Library wines reserved for gold club members."
 }
}

RESPONSE: responds with a collection object.

Delete a collection

DELETE: /collection/:id

RESPONSE: responds with a blank object and 204 status.

List all collections

GET: /collection

OPTIONS: optional query parameters include: q and isPublished. Query params may look like collection?webStatus=Available

RESPONSE: responds with an array of collection objects and a total count.

{
 "collections": [{
  "id": "30d4f4b1-eb3a-4dae-87f2-1289bd61bda6",
  "title": "Gold Library Wines",
  "content": "<p>Library wines reserved for gold club members.</p>",
  "type": "Manual",
  "webStatus": "Available",
  "adminStatus": "Available",
  "slug": "gold-library-wines",
  "createdAt": "2018-05-21T18:41:34.703Z",
  "updatedAt": "2018-05-21T18:42:52.653Z",
  "seo": {
   "title": "Gold Library Wines",
   "description": "Library wines reserved for gold club members."
  }
 }, {
  "id": "dfdd3929-5a24-4340-b9e1-eedfe25e8a63",
  "title": "Wine",
  "content": "All Wines",
  "type": "Manual",
  "webStatus": "Available",
   "adminStatus": "Available",
  "slug": "wine",
  "createdAt": "2018-05-18T16:53:47.913Z",
  "updatedAt": "2018-05-18T16:53:47.913Z",
  "seo": {
   "title": "Wine",
   "description": "All Wines"
  }
 }],
 "total": 2
}