POST
/
collections
curl --request POST \
  --url https://api.fabric.inc/v3/collections \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "parentCollectionId": "600f1f77bcf86cd799439011",
  "name": "Color",
  "localizedProperties": {
    "en-US": {
      "name": "Color"
    },
    "en-IN": {
      "name": "Colour"
    }
  },
  "isLocalizable": true,
  "isRoot": true,
  "isLeaf": false,
  "attributes": [
    {
      "id": "78184766610c0e32a86d8757",
      "value": "blue"
    }
  ],
  "categoryIdsIncluded": [
    "917329dfd5288b0011332300, 637329dfd5288b0011332387"
  ],
  "categoryIdsExcluded": [
    "637329dfd5288b0011332300",
    "74184766610c0e32a86d8758"
  ],
  "productAttributeFilters": [
    {
      "attributeId": "78184766610c0e32a86d8757",
      "condition": "EQUALS",
      "value": 2
    }
  ]
}'
{
  "id": "55184766610c0e32a86d8759",
  "name": "Color",
  "localizedProperties": {
    "en-US": {
      "name": "Color"
    },
    "en-IN": {
      "name": "Colour"
    }
  },
  "isLocalizable": true,
  "isRoot": true,
  "isActive": false,
  "attributes": [
    {
      "id": "64184766610c0e32a86d8758",
      "name": "color",
      "localizedProperties": {
        "en-US": {
          "name": "Color"
        },
        "en-IN": {
          "name": "Colour"
        }
      },
      "isLocalizable": true,
      "isInherited": true,
      "type": "TEXT",
      "validation": {
        "dateFormat": "MM-DD-YYYY"
      },
      "value": "blue"
    }
  ],
  "categoriesIncluded": [
    {
      "id": "64184766610c0e32a86d8758",
      "name": "Chairs",
      "localizedProperties": {
        "en-US": {
          "name": "Color"
        },
        "en-IN": {
          "name": "Colour"
        }
      },
      "isLocalizable": true
    }
  ],
  "categoriesExcluded": [
    {
      "id": "64184766610c0e32a86d8758",
      "name": "Chairs",
      "localizedProperties": {
        "en-US": {
          "name": "Color"
        },
        "en-IN": {
          "name": "Colour"
        }
      },
      "isLocalizable": true
    }
  ],
  "productAttributeFilters": [
    {
      "attributeId": "53184766610c0e32a86d875",
      "name": "Mobile name",
      "localizedProperties": {
        "en-US": {
          "name": "Color"
        },
        "en-IN": {
          "name": "Colour"
        }
      },
      "isLocalizable": true,
      "condition": "EQUALS",
      "value": 2
    }
  ],
  "children": [
    {
      "id": "78184766610c0e32a86d8757",
      "name": "Chairs",
      "localizedProperties": {
        "en-US": {
          "name": "Color"
        },
        "en-IN": {
          "name": "Colour"
        }
      },
      "isLocalizable": true,
      "isLeaf": false
    }
  ],
  "updatedBy": "test@eamil.com",
  "updatedAt": "2023-04-20T10:24:36.162Z",
  "createdAt": "2021-04-20T10:24:36.162Z"
}

Authorizations

Authorization
string
header
required

S2S access token (JWT) from fabric Identity service (during Login)

Headers

x-fabric-tenant-id
string

A header used by fabric to identify the tenant making the request. You must include tenant id in the authentication header for an API request to access any of fabric’s endpoints. You can retrieve the tenant id , which is also called account id, from Copilot. This header is required.

Example:

"517fa9dfd42d8b00g1o3k312"

x-fabric-request-id
string

Unique request ID

Example:

"263e731c-45c8-11ed-b878-0242ac120002"

Body

application/json
Details to create a collection

Collection details

parentCollectionId
string

24-character system-generated parent collection ID

Example:

"600f1f77bcf86cd799439011"

name
string

Non-localized collection name

Example:

"Color"

localizedProperties
object

localized properties of collection

Example:
{
  "en-US": { "name": "Color" },
  "en-IN": { "name": "Colour" }
}
isLocalizable
boolean

true: Collection name is translated into different languages or localized for different regions <br /> false: Collection name isn't localized. Note: Refer to localizedProperties to get relevant details based on locale

Example:

true

isRoot
boolean

true: This collection is the root branch <br /> false: This collection isn't the root branch

Example:

true

isLeaf
boolean

true: This is the last collection of the branch with no further children collections <br /> false: This isn't the last collection of the branch and has children collections

Example:

false

attributes
object[]

Collection attributes

categoryIdsIncluded
string[]

List of included category IDs

categoryIdsExcluded
string[]
deprecated

List of excluded category IDs

Example:
[
  "637329dfd5288b0011332300",
  "74184766610c0e32a86d8758"
]
productAttributeFilters
object[]

Details of attribute filters applied. In the Create collection endpoint, it's also used to create collection based on attribute values. For example, create collection for mobile phones, where price is greater than 25000

Response

200
application/json
OK

Collection details

id
string

24-character system-generated collection ID

Example:

"55184766610c0e32a86d8759"

name
string

Non-localized collection name

Example:

"Color"

localizedProperties
object

Localized properties of collection

Example:
{
  "en-US": { "name": "Color" },
  "en-IN": { "name": "Colour" }
}
isLocalizable
boolean

true: Collection name is translated into different languages or localized for different regions <br /> false: Collection name isn't localized Note: Refer to localizedProperties to get relevant details based on locale

Example:

true

isRoot
boolean

true: Collection is root category.<br /> false: Collection isn't a root category.

Example:

true

isActive
boolean

true: Collection is active <br /> false: Collection is inactive

Example:

false

attributes
object[]

Collection attributes

Attribute details

categoriesIncluded
object[]

List of categories included

Category details

categoriesExcluded
object[]

List of categories excluded

Category details

productAttributeFilters
object[]

Attribute filters applied to the category

Filter criteria

children
object[]

Immediate children of the specified collection

updatedBy
string

Email of user who last updated the category

Example:

"test@eamil.com"

updatedAt
string

Time of last updated to category (UTC)

Example:

"2023-04-20T10:24:36.162Z"

createdAt
string

Time of category creation (UTC)

Example:

"2021-04-20T10:24:36.162Z"

Was this page helpful?