/collections

Creates a new collection.

Request body attributes

Parameters that you can send in the request body in JSON format, for example:
{"id": 1,"title": "Campaign"}

TitleTypeDescriptionRequired?
titlestringTitleYes
is_draftboolDefines whether collection is draft or publishedNo
descriptionstringCollection descriptionNo
imagesarray of integersArray of uploaded imagesNo
typeintegerType of collection:
0 - manually added products
1 - rules based
Yes
seo_titlestringSEO titleYes
seo_urlstringSEO url (e.g. collections/<:value>)Yes
seo_metastringSEO meta descriptionNo
match_productsarray of integersArray of products that were manually added to this collectionYes, when collection is manual, otherwise NO
rules_match_conditionintegerDefines the way of matching product rules:
0 - match at least one
1 - match all
Yes, when collection is rules-based, otherwise NO
rulesarray of objectsContains array of object defining rulesYes, when collection is rules-based, otherwise NO
rules.typeintegerField name
0 - product title
1 - product vendor
2 - product type
3 - product price
4 - product tag
5 - weight
6 - variant title
Yes, when collection is rules-based, otherwise NO
rules.conditionintegerCondition
0 - is exactly
1 - starts with
2 - ends with
3 - contains
4 - does not contain
5 - is equal to
6 - not equal to
7 - greater than
8 - less than
Yes, when collection is rules-based, otherwise NO
rules.valuestring|integerValueYes, when collection is rules-based, otherwise NO

Response attributes

Attributes that you will receive in response from the endpoint in JSON format, for example:
{"id": 1,"title": "Campaign"}

TitleTypeDescriptionRequired?
titlestringTitleYes
is_draftboolDefines whether collection is draft or publishedNo
descriptionstringCollection descriptionNo
imagesarray of integersArray of uploaded imagesNo
typeintegerType of collection:
0 - manually added products
1 - rules based
Yes
seo_titlestringSEO titleYes
seo_urlstringSEO url (e.g. collections/<:value>)Yes
seo_metastringSEO meta descriptionNo
match_productsarray of integersArray of products that were manually added to this collectionYes, when collection is manual, otherwise NO
rules_match_conditionintegerDefines the way of matching product rules:
0 - match at least one
1 - match all
Yes, when collection is rules-based, otherwise NO
rulesarray of objectsContains array of object defining rulesYes, when collection is rules-based, otherwise NO
rules.typeintegerField name
0 - product title
1 - product vendor
2 - product type
3 - product price
4 - product tag
5 - weight
6 - variant title
Yes, when collection is rules-based, otherwise NO
rules.conditionintegerCondition
0 - is exactly
1 - starts with
2 - ends with
3 - contains
4 - does not contain
5 - is equal to
6 - not equal to
7 - greater than
8 - less than
Yes, when collection is rules-based, otherwise NO
rules.valuestring|integerValueYes, when collection is rules-based, otherwise NO
POST https://mystore.commercehq.com/api/v1/collections/

{
  "type": 1,
  "seo_url": "rules-based",
  "seo_title": "rules based",
  "title": "rules based",
  "description": "whatever",
  "rules_match_condition": 0,
  "rules": [
    {
      "type": 0,
      "condition": 3,
      "value": "cat"
    }
  ],
  "is_draft": false
}
{
  "id": 10,
  "type": 1,
  "seo_url": "rules-based",
  "seo_title": "rules based",
  "title": "rules based",
  "description": "whatever",
  "rules_match_condition": 0,
  "rules": [
    {
      "type": 0,
      "condition": 3,
      "value": "cat"
    }
  ],
  "is_draft": false
}