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

# Create Product Collection

> Create a new Product Collection for a specific location



## OpenAPI

````yaml /api-reference/products/openapi.json post /products/collections
openapi: 3.0.0
info:
  title: Products API
  description: Documentation for products API
  version: '1.0'
  contact: {}
servers:
  - url: https://services.leadconnectorhq.com
security: []
tags:
  - name: Products
    description: Documentation for products API
  - name: Prices
    description: Documentation for products API
  - name: Store
    description: Documentation for products API
  - name: Collections
    description: Documentation for products API
  - name: Reviews
    description: Documentation for products API
paths:
  /products/collections:
    post:
      tags:
        - Collections
      summary: Create Product Collection
      description: Create a new Product Collection for a specific location
      operationId: create-product-collection
      parameters:
        - name: Version
          in: header
          description: API Version
          required: true
          schema:
            type: string
            enum:
              - '2021-07-28'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateProductCollectionsDto'
      responses:
        '201':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCollectionResponseDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestDTO'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedDTO'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableDTO'
      security:
        - Location-Access:
            - products/collection.write
components:
  schemas:
    CreateProductCollectionsDto:
      type: object
      properties:
        altId:
          type: string
          description: Location Id
          example: 6578278e879ad2646715ba9c
        altType:
          type: string
          description: The type of alt. For now it is only LOCATION
          enum:
            - location
          example: LOCATION
        collectionId:
          type: string
          description: Unique Identifier of the Product Collection, Mongo Id
          example: 66057f9d28536eae584ec047
        name:
          type: string
          description: Name of the Product Collection
          example: Best Sellers
        slug:
          type: string
          description: Slug of the Product Collection which helps in navigation
          example: best-sellers
        image:
          type: string
          description: >-
            The URL of the image that is going to be displayed as the collection
            Thumbnail
          example: http://example.com/watermark.png
        type:
          type: string
          description: Type of collection - manual or smart
          enum:
            - manual
            - smart
          example: manual
        rules:
          $ref: '#/components/schemas/CollectionRulesDto'
        productIds:
          description: >-
            Array of product IDs for manual collections (required if type is
            manual)
          example:
            - 655b33a82209e60b6adb87a5
            - 655b33a82209e60b6adb87a6
          type: array
          items:
            type: string
        seo:
          $ref: '#/components/schemas/CollectionSEODto'
        ruleHash:
          type: string
          description: Hash of the rules for change detection (auto-generated)
          example: abc123def456
        ruleVersion:
          type: number
          description: Version of the rules for smart collections (auto-generated)
          example: 1
        stats:
          type: object
          description: Statistics about the collection (auto-generated)
      required:
        - altId
        - altType
        - name
        - slug
    CreateCollectionResponseDto:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/CollectionSchema'
      required:
        - data
    BadRequestDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 400
        message:
          type: string
          example: Bad Request
      required:
        - statusCode
        - message
    UnauthorizedDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 401
        message:
          type: string
          example: 'Invalid token: access token is invalid'
        error:
          type: string
          example: Unauthorized
      required:
        - statusCode
        - message
        - error
    UnprocessableDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 422
        message:
          type: array
          items:
            type: string
          example:
            - Unprocessable Entity
        error:
          type: string
          example: Unprocessable Entity
      required:
        - statusCode
        - message
        - error
    CollectionRulesDto:
      type: object
      properties:
        logic:
          type: string
          description: Logic operator for combining conditions
          enum:
            - AND
            - OR
          example: AND
        conditions:
          description: Array of conditions to evaluate
          items:
            type: array
          type: array
      required:
        - logic
        - conditions
    CollectionSEODto:
      type: object
      properties:
        title:
          type: string
          description: The title which will be displayed as an SEO format
          example: Best Sellers
        description:
          type: string
          description: The description which would be displayed in preview purposes
          example: Collections where all the best products are available
    CollectionSchema:
      type: object
      properties:
        _id:
          type: string
          description: The unique identifier for the collection
          example: 655b33a82209e60b6adb87a5
        altId:
          type: string
          description: Location Id to which the collection is associated
          example: Z4Bxl8J4SaPEPLq9IQ8g
        name:
          type: string
          description: Name of the collection
          example: Best Sellers
        slug:
          type: string
          description: >-
            Slug of the collection with which navigation is established. Special
            Characters and spacing is not allowed and should be unique
          example: best-sellers
        type:
          type: string
          description: Type of collection - manual or smart
          enum:
            - manual
            - smart
          example: manual
        image:
          type: string
          description: >-
            The URL of the image that is going to be displayed as the collection
            Thumbnail
          example: http://example.com/watermark.png
        seo:
          $ref: '#/components/schemas/CollectionSEODto'
        rules:
          type: object
          description: Rules for smart collections
        ruleVersion:
          type: number
          description: Version of the rules for smart collections
          example: 1
        ruleHash:
          type: string
          description: Hash of the rules for change detection
          example: abc123def456
        stats:
          type: object
          description: Statistics about the collection
        createdAt:
          type: string
          description: Date at which the collection was created
          example: '2024-02-22T09:27:19.728Z'
      required:
        - _id
        - altId
        - name
        - slug
        - type
        - createdAt

````