> ## Documentation Index
> Fetch the complete documentation index at: https://developer.fabric.inc/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Multiple Collections

> Collection is an alternative way to organize products compared to the original Category system; they're created based on merchant's requirements. This endpoint is used to create a new collection **Note**: You can create up to 25 collections in a single call.



## OpenAPI

````yaml category.openapi post /collections/batch
openapi: 3.0.0
info:
  title: Products - Categories API
  description: >-
    Categories (also called hierarchies or nodes) form a hierarchical tree
    structure to organize items and services into intuitive groups. Organizing
    items this way simplifies item discovery on your e-commerce platform
    (website or app). **Categories** is the original tree of Product List with
    nested levels of categories. Each item is placed where it belongs within a
    category. For example, `Computers` is a parent category with `Laptops` and
    `Desktops` as children categories, and `MacBook Pro` is an item within
    `Laptops`. This organization can be represented as Computers -> Laptops ->
    MacBook Pro. **Collections** serve as alternative organizations of Category
    system, which is the original, single source for all items and categories.
    Their main purpose is distribution management by displaying items on your
    e-commerce platform based on browsing structures you need to achieve various
    merchandising objectives, such as organizational requirements,
    multi-regional assortments, multi-channel assortments, and collections. For
    example, a company that sells, repairs, and supports computers and related
    items and services will have a Category system with a complete list of SKUs.
    Because Category system isn't granular enough to be used on Storefront,
    multiple Collections are created to target specific shopper segment
    experiences. For laptop consumers, you might have one collection that lists
    all the laptops and PCs. For large businesses, you will have another
    collection that lists all commercial laptops, PCs, printers, and servers.
    Both of the collections will act as filters of the Category, tailored to the
    purpose of a merchandising strategy.
  version: 3.0.0
  x-audience: external-public
  contact:
    email: support@fabric.inc
    name: Product team
  license:
    name: fabric API License
    url: https://fabric.inc/api-license
  termsOfService: https://fabric.inc/terms-of-use
servers:
  - url: https://api.fabric.inc/v3
    description: Production URL
security:
  - authorization: []
tags:
  - name: Categories
    description: >-
      Categories are organized into a hierarchical tree structure based on
      common attributes, allowing logical grouping of items. The Categories
      endpoints enables CRUD operations, such as creating, locating, and
      managing categories.
  - name: Collections
    description: >-
      As the **Categories** system may not be sufficiently granular to
      accommodate all Storefront use cases, **Collections** provide an
      alternative means of organizing products on the Storefront. Collections
      create a representational categorization of products, and are primarily
      used by merchants for short-term marketing campaigns. For instance, a
      collection could be created for a New Year sale that highlights discounted
      furniture products.
  - name: Navigation Paths
    description: >-
      Paths indicate the navigation of the current category or collection to its
      root category or collection. These navigation paths are helpful in
      determining the exact position of a category or collection within the
      hierarchical tree structure.
  - name: Bulk action for categories and collections
    description: These endpoints support creating and updating categories and collections.
externalDocs:
  description: Find out more about Products (previously called PIM)
  url: https://developer.fabric.inc/docs/products-overview
paths:
  /collections/batch:
    post:
      tags:
        - Bulk action for categories and collections
      summary: Create Multiple Collections
      description: >-
        Collection is an alternative way to organize products compared to the
        original Category system; they're created based on merchant's
        requirements. This endpoint is used to create a new collection **Note**:
        You can create up to 25 collections in a single call.
      operationId: createCollections
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
      requestBody:
        description: Details to create a collection
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/collections'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bulkCreationResponse'
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/x-fabric-request-id-header'
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/notAuthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '409':
          $ref: '#/components/responses/conflict'
        '413':
          $ref: '#/components/responses/payloadLimitExceededError'
        '500':
          $ref: '#/components/responses/internalServerError'
components:
  parameters:
    x-fabric-tenant-id:
      name: x-fabric-tenant-id
      in: header
      description: >-
        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](/v3/platform/settings/account-details/getting-the-account-id).
        This header is required.
      schema:
        type: string
        example: 517fa9dfd42d8b00g1o3k312
    x-fabric-request-id:
      name: x-fabric-request-id
      in: header
      description: Unique request ID
      schema:
        type: string
        example: 263e731c-45c8-11ed-b878-0242ac120002
      required: false
  schemas:
    collections:
      type: object
      description: Bulk Collection creation
      properties:
        collections:
          type: array
          items:
            $ref: '#/components/schemas/collection'
    bulkCreationResponse:
      description: Bulk create response
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              success:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      $ref: '#/components/schemas/nodeId'
                    name:
                      $ref: '#/components/schemas/nodeName'
              errors:
                type: array
                items:
                  type: object
                  properties:
                    name:
                      $ref: '#/components/schemas/nodeName'
                    message:
                      type: array
                      items:
                        description: Error detail
                        type: string
                        example: Category must have valid parentId
    collection:
      description: Collection details
      type: object
      additionalProperties: false
      properties:
        parentCollectionId:
          type: string
          description: 24-character system-generated parent collection ID
          example: 600f1f77bcf86cd799439011
        name:
          description: Non-localized collection name
          type: string
          example: Color
        localizedProperties:
          description: localized properties of collection
          allOf:
            - $ref: '#/components/schemas/localizedProperties'
        isLocalizable:
          type: boolean
          example: true
          description: >-
            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
        isRoot:
          type: boolean
          example: true
          description: >-
            true: This collection is the root branch <br /> false: This
            collection isn't the root branch
        isLeaf:
          type: boolean
          example: false
          description: >-
            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
        attributes:
          type: array
          description: Collection attributes
          items:
            type: object
            properties:
              id:
                type: string
                example: 78184766610c0e32a86d8757
                description: 24-character system-generated attribute ID
              value:
                description: Attribute value
                anyOf:
                  - $ref: '#/components/schemas/booleanSchema'
                  - $ref: '#/components/schemas/stringSchema'
                  - $ref: '#/components/schemas/integerSchema'
                  - $ref: '#/components/schemas/doubleSchema'
                example: blue
        categoryIdsIncluded:
          type: array
          items:
            type: string
            description: List of included category IDs
            example: 917329dfd5288b0011332300, 637329dfd5288b0011332387
        categoryIdsExcluded:
          deprecated: true
          description: List of excluded category IDs
          type: array
          items:
            type: string
          example:
            - 637329dfd5288b0011332300
            - 74184766610c0e32a86d8758
        productAttributeFilters:
          type: array
          description: >-
            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
          items:
            type: object
            properties:
              attributeId:
                type: string
                example: 78184766610c0e32a86d8757
                description: 24-character system-generated attribute ID
              condition:
                $ref: '#/components/schemas/attributeFilterCondition'
              value:
                $ref: '#/components/schemas/attributeFilterValue'
    nodeId:
      type: string
      description: 24-character system-generated category or collection ID
      example: 53184766610c0e32a86d875
    nodeName:
      type: string
      description: Category or collection name
      example: Color
    genericError:
      type: object
      description: Error details
      properties:
        message:
          type: string
          description: Error message
          example: Request was invalid
        type:
          type: string
          description: Error type
          example: Bad request
        errors:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                description: Error type
                example: CLIENT_ERROR
              message:
                type: string
                description: Brief error message
                example: Invalid request
    localizedProperties:
      type: object
      description: Localized details
      additionalProperties:
        type: object
        properties:
          name:
            description: Localized name
            type: string
            example: Color
      example:
        en-US:
          name: Color
        en-IN:
          name: Colour
    booleanSchema:
      type: boolean
      nullable: true
      description: Sample boolean schema
      example: true
    stringSchema:
      type: string
      nullable: true
      description: Sample string schema
      example: blue
    integerSchema:
      type: integer
      nullable: true
      format: int32
      description: Sample integer schema
      example: 1
    doubleSchema:
      type: number
      nullable: true
      format: double
      description: Sample double schema
      example: 1
    attributeFilterCondition:
      type: string
      description: Filter conditions
      enum:
        - GT
        - LT
        - EQUALS
        - IN
        - NOT_IN
        - CONTAINS
        - NOT_CONTAINS
      example: EQUALS
    attributeFilterValue:
      description: Attribute value to match filter condition
      anyOf:
        - $ref: '#/components/schemas/booleanSchema'
        - $ref: '#/components/schemas/stringSchema'
        - $ref: '#/components/schemas/integerSchema'
        - $ref: '#/components/schemas/doubleSchema'
        - $ref: '#/components/schemas/arrayOfStrings'
        - $ref: '#/components/schemas/arrayOfNumbers'
      example: 2
    arrayOfStrings:
      type: array
      items:
        type: string
        example: a
        description: Sample array of strings
    arrayOfNumbers:
      type: array
      items:
        type: number
        format: double
        description: Sample double schema
        example: 1
  headers:
    x-fabric-request-id-header:
      description: Unique request ID
      schema:
        type: string
        example: 263e731c-45c8-11ed-b878-0242ac120002
  responses:
    badRequest:
      description: Request is invalid or malformed
      headers:
        x-fabric-request-id:
          $ref: '#/components/headers/x-fabric-request-id-header'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/genericError'
    notAuthorized:
      description: Unauthorized requester
      headers:
        x-fabric-request-id:
          $ref: '#/components/headers/x-fabric-request-id-header'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/genericError'
          example:
            message: The requester is unauthorized
            type: UNAUTHORIZED_ERROR
    forbidden:
      description: User isn't allowed to perform the action
      headers:
        x-fabric-request-id:
          $ref: '#/components/headers/x-fabric-request-id-header'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/genericError'
          example:
            type: REQUEST_DENIED
            message: User doesn't have the required permission
    conflict:
      description: Conflict
      headers:
        x-fabric-request-id:
          $ref: '#/components/headers/x-fabric-request-id-header'
      content:
        application/json:
          schema:
            type: object
            description: Request conflict error
            properties:
              type:
                description: Error code
                type: string
                example: CONFLICT
              message:
                description: Error description
                type: string
                example: >-
                  Unable to update as there is a conflict with a unique
                  attribute.
              errors:
                type: array
                items:
                  type: object
                  properties:
                    type:
                      type: string
                      description: Error type
                      example: CONFLICT
                    message:
                      type: string
                      description: Error message
                      example: <ID> already exists
    payloadLimitExceededError:
      description: Payload limit exceeded (> 10MB)
      headers:
        x-fabric-request-id:
          $ref: '#/components/headers/x-fabric-request-id-header'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/genericError'
          example:
            type: PAYLOAD_LIMIT_EXCEEDED_ERROR
            message: The payload exceeds maximum configured size
    internalServerError:
      description: Internal server error
      headers:
        x-fabric-request-id:
          $ref: '#/components/headers/x-fabric-request-id-header'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/genericError'
          example:
            type: SERVER_ERROR
            message: Internal Server Error
  securitySchemes:
    authorization:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: S2S access token (JWT) from fabric Identity service (during Login)

````