openapi: 3.0.0
x-mint:
  mcp:
    enabled: true
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
externalDocs:
  description: Find out more about Products (previously called PIM)
  url: https://developer.fabric.inc/docs/products-overview
servers:
  - url: https://api.fabric.inc/v3
    description: Production URL
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.
paths:
  /categories/batch:
    post:
      tags:
        - Bulk action for categories and collections
      summary: Create Multiple Categories
      description: >-
        Items are organized within categories, which form the original
        hierarchical tree structure with multiple levels of nested categories.
         This endpoint is used to add new categories within this structure.
         **Note**:   1. Upon onboarding a new merchant to fabric
        **Product Catalog**, a root category is automatically generated. <br />
        2. This endpoint doesn't support adding of parent and its children
        categories at the same time. <br /> 3. You can add up to 25 categories.
      operationId: createCategories
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/createCategories'
      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'
  /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'
  /categories:
    post:
      tags:
        - Categories
      summary: Create Category
      description: >-
        Items are organized within categories, which form the original
        hierarchical tree structure with multiple levels of nested categories.
         This endpoint is used to create a new category within this
         structure. **Note**: 1. Upon onboarding a new merchant to fabric
        **Product Catalog**, a root category is automatically generated. <br />
        2. This endpoint doesn't support adding of children categories. Use the
        Update category endpoint - `PUT /categories/{id}` endpoint to add child
        categories.
      operationId: createCategory
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/createCategory'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/createCategoryResponse'
          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'
    put:
      tags:
        - Bulk action for categories and collections
      summary: Update Multiple Categories
      description: >-
        With this endpoint, you can update up to 25 categories and add new child
        categories. You can update the name of the category as required, update
        the parent category, change category attributes for improved product
        discovery, and modify product attributes to efficient product filtering.
      operationId: updateCategories
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
      requestBody:
        description: Category details to be updated
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/updateCategories'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bulkUpdateResponse'
          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'
        '413':
          $ref: '#/components/responses/payloadLimitExceededError'
        '500':
          $ref: '#/components/responses/internalServerError'
    delete:
      tags:
        - Bulk action for categories and collections
      summary: Delete Multiple Categories
      description: With this endpoint, you can delete up to 25 categories.
      operationId: deleteCategories
      parameters:
        - $ref: '#/components/parameters/categoryIds'
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bulkDeleteResponse'
          headers:
            x-fabric-request-id:
              description: Request ID for tracking
              schema:
                type: string
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/notAuthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '413':
          $ref: '#/components/responses/payloadLimitExceededError'
        '500':
          $ref: '#/components/responses/internalServerError'
  /categories/{id}:
    get:
      tags:
        - Categories
      summary: Get a Single Category
      description: >-
        The Category system is the original tree hierarchy used to organize and
        categorize products. This endpoint gets the details of a specific
        category by its ID. The response includes basic info (ID, name,
        localized name (if applicable), list of category attributes, product
        attributes, associated product IDs, associated child categories, and
        more.
      operationId: getCategoryById
      parameters:
        - $ref: '#/components/parameters/categoryId'
        - $ref: '#/components/parameters/locales'
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/categoryResponse'
          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'
        '404':
          $ref: '#/components/responses/notFoundError'
        '413':
          $ref: '#/components/responses/payloadLimitExceededError'
        '500':
          $ref: '#/components/responses/internalServerError'
    put:
      tags:
        - Categories
      summary: Update Category
      description: >-
        Child categories can't be added while creating a new category (using the
        `POST /categories` endpoint). This endpoint is used to add a child
        category to a parent category. In addition, when there are changes in
        product offerings, this endpoint is used to change the  item and
        category attributes as well as rename the category. This endpoint
        completely replaces the existing details.
      operationId: updateCategory
      parameters:
        - $ref: '#/components/parameters/categoryId'
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
      requestBody:
        description: Category details to be updated
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/updateCategory'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/updateCategoryResponse'
          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'
        '404':
          $ref: '#/components/responses/notFoundError'
        '413':
          $ref: '#/components/responses/payloadLimitExceededError'
        '500':
          $ref: '#/components/responses/internalServerError'
    patch:
      tags:
        - Categories
      summary: Partially Update Category
      description: >-
        In contrast to the Update Category endpoint - `PUT /categories/{id}`,
        which fully overwrites the category details, this endpoint allows for
        selective modification of specific details, such as fixing any typos
        present in category names as well as facilitating addition or removal of
        category attributes or product attributes.
      operationId: partialUpdateCategory
      parameters:
        - $ref: '#/components/parameters/categoryId'
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
      requestBody:
        description: Category details that needs to be updated
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/patchCategory'
            examples:
              updateCategoryName:
                summary: Update category name
                value:
                  data:
                    - op: replace
                      path: /name
                      value: Color
              addCategoryAttribute:
                summary: Add a category attribute
                value:
                  data:
                    - op: add
                      path: /categoryAttributes/-
                      value:
                        id: 6628ab4c90fdd1d5aa920659
                        value: blue
              replaceCategoryAttributeValue:
                summary: Update category attribute value
                value:
                  data:
                    - op: add
                      path: /categoryAttributes/0/value
                      value: Red
              removeCategoryAttribute:
                summary: Remove category attribute
                value:
                  data:
                    - op: remove
                      path: /categoryAttributes/0
              addProductAttribute:
                summary: Add product attribute
                value:
                  data:
                    - op: add
                      path: /productAttributes/-
                      value:
                        id: 6454e9d445276428de74c54f
                        isMandatory: false
              replaceProductAttribute:
                summary: Replace product attribute
                value:
                  data:
                    op: replace
                    path: /productAttributes/0
                    value:
                      id: 6454e9d445276428de74c54f
                      isMandatory: true
              removeProductAttributeFilter:
                summary: Remove product attribute
                value:
                  data:
                    - op: remove
                      path: /productAttributes/0
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/updateCategoryResponse'
          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'
        '404':
          $ref: '#/components/responses/notFoundError'
        '413':
          $ref: '#/components/responses/payloadLimitExceededError'
        '500':
          $ref: '#/components/responses/internalServerError'
    delete:
      tags:
        - Categories
      summary: Delete Category
      description: >-
        If there is a change in product offerings , one or more categories may
        become unnecessary. This endpoint is used to delete a category by its
        ID.
      operationId: deleteCategory
      parameters:
        - $ref: '#/components/parameters/categoryId'
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
      responses:
        '200':
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/x-fabric-request-id-header'
          description: OK
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/notAuthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/notFoundError'
        '500':
          $ref: '#/components/responses/internalServerError'
  /categories/{id}/products:
    get:
      tags:
        - Categories
      summary: Get Products by Category
      description: >-
        To ensure correct items are grouped together within a category, it's
        important to review them in the context of each category. This endpoint
        gets a paginated list of products. For each product, you can view its
        attribute details, localized properties, variant IDs as well as the
        `categoryId`. You can refine your search results by specifying `offset`,
        and `limit`. When they're no specified, you'll get up to 10 results.
      operationId: getProductsByCategory
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
        - $ref: '#/components/parameters/categoryId'
        - in: query
          name: offset
          description: >-
            Number of records to skip before returning records. For example,
            `offset=20, limit=10` returns records 21-30.
          schema:
            type: integer
            format: int32
            example: 0
          required: false
        - in: query
          name: limit
          description: Maximum number of records per page
          schema:
            type: integer
            format: int32
            example: 10
          required: false
        - $ref: '#/components/parameters/locales'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/categoryProductsResponse'
          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'
        '404':
          $ref: '#/components/responses/notFoundError'
        '413':
          $ref: '#/components/responses/payloadLimitExceededError'
        '500':
          $ref: '#/components/responses/internalServerError'
  /categories/{id}/attribute-groups:
    get:
      tags:
        - Categories
      summary: Get Attribute Groups of a Category
      description: >-
        Attribute groups are a collection of attributes that can be assigned to
        an item or a category. For example, an `Electronics` category may have
        `Dimensions` as one of the attribute groups, with `length`, `width`, and
        `height` as individual attributes. This endpoint gets all attribute
        groups for the given category. For each attribute group, you can view
        its basic details such as ID, name, and priority as well as attribute
        details including validation rules, localized versions, and more
      operationId: getAttributeGroupsByCategory
      parameters:
        - $ref: '#/components/parameters/categoryId'
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/attributeGroupsByCategoryResponse'
          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'
        '404':
          $ref: '#/components/responses/notFoundError'
        '413':
          $ref: '#/components/responses/payloadLimitExceededError'
        '500':
          $ref: '#/components/responses/internalServerError'
  /categories/search:
    post:
      tags:
        - Categories
      summary: Find Categories
      description: >-
        This endpoint is used to search and find specific categories based on
        the search criteria given in the request body. This endpoint is also
        used to find the root category that's automatically created when the
        merchant is onboarded to fabric **Product Catalog**.
      operationId: searchCategory
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
      requestBody:
        $ref: '#/components/requestBodies/searchCategoryRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/searchCategoryResponse'
          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'
        '413':
          $ref: '#/components/responses/payloadLimitExceededError'
        '500':
          $ref: '#/components/responses/internalServerError'
  /collections:
    post:
      tags:
        - Collections
      summary: Create Collection
      description: >-
        Collection is an alternative way to organize products compared to the
        Category system, which is the original organization of items. Because
        the Category system isn't granular enough to meet all the requirements
        of Storefronts, collections are used to organize products as per the
        merchant's requirements. This endpoint is used to create a new
        collection within the alternative organization so that it can be adapted
        to support various use-cases of Storefronts.
      operationId: createCollection
      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/collection'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/collectionResponse'
          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'
        '413':
          $ref: '#/components/responses/payloadLimitExceededError'
        '500':
          $ref: '#/components/responses/internalServerError'
    put:
      tags:
        - Bulk action for categories and collections
      summary: Update Collections Up to 25
      description: >-
        With this endpoint, you can update up to 25 collections. You can also
        update collection details, such as add sub-collections, exclude
        sub-collections, add validation rules for attributes, or reorder
        collections. **Note**:<br />1. This endpoint replaces the existing
        details.<br />2. To avoid losing all details, for minor updates, use the
        `partially update collection` endpoint - `PATCH /collections/{id}`
      operationId: updateCollections
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
      requestBody:
        description: Details to update collection
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/updateCollections'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bulkUpdateResponse'
          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'
        '404':
          $ref: '#/components/responses/notFoundError'
        '413':
          $ref: '#/components/responses/payloadLimitExceededError'
        '500':
          $ref: '#/components/responses/internalServerError'
    delete:
      tags:
        - Bulk action for categories and collections
      summary: Delete Collections Up to 25
      description: With this endpoint, you can delete up to 25 collections.
      operationId: deleteCollections
      parameters:
        - $ref: '#/components/parameters/collectionIds'
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bulkDeleteResponse'
          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'
        '413':
          $ref: '#/components/responses/payloadLimitExceededError'
        '500':
          $ref: '#/components/responses/internalServerError'
  /collections/{id}:
    get:
      tags:
        - Collections
      summary: Get a Single Collection
      description: >-
        Collections are used to organize and categorize products on your
        e-commerce platform (website and app), making it easier for shoppers to
        browse and find products. This endpoint gets category details such as
        basic info (ID, name, localized name, status, etc.), attributes details,
        categories included, categories excluded, associated child categories,
        and more.
      operationId: getCollectionById
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
        - $ref: '#/components/parameters/collectionId'
        - $ref: '#/components/parameters/locales'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/collectionResponse'
          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'
        '404':
          $ref: '#/components/responses/notFoundError'
        '413':
          $ref: '#/components/responses/payloadLimitExceededError'
        '500':
          $ref: '#/components/responses/internalServerError'
    put:
      tags:
        - Collections
      summary: Update Collection
      description: >-
        With this endpoint, you can update details of a single collection, such
        as add or remove sub-collections, add validation rules for attributes,
        reorder collections, and more. **Note**: <br /> 1. This endpoint
        replaces the existing details. <br /> 2. To avoid impacting the entire
        data, for minor updates, use the Partially update collection endpoint
        instead - `PATCH /collections/{id}`.
      operationId: updateCollection
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
        - $ref: '#/components/parameters/collectionId'
      requestBody:
        description: Details to update collection
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/updateCollection'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/collectionResponse'
          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'
        '404':
          $ref: '#/components/responses/notFoundError'
        '413':
          $ref: '#/components/responses/payloadLimitExceededError'
        '500':
          $ref: '#/components/responses/internalServerError'
    patch:
      tags:
        - Collections
      summary: Partially Update Collection
      description: >-
        In contrast to the Update Collection endpoint - `PUT /collections/{id}`,
        which fully overwrites the collection details, this endpoint allows for
        selective modification of specific details such as fixing any typos
        present in the collection name as well as facilitating addition or
        removal of attributes
      operationId: partialUpdateCollection
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
        - $ref: '#/components/parameters/collectionId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              description: >-
                Collection details to be updated, including the name.
                Additionally, you can add, replace, or remove attributes of a
                collection or products associated with it.
              additionalProperties: false
              required:
                - data
              properties:
                data:
                  type: array
                  minItems: 1
                  items:
                    required:
                      - op
                      - path
                    properties:
                      op:
                        $ref: '#/components/schemas/patchOperation'
                      path:
                        type: string
                        description: Navigation path
                        example: /attributes/0/name
                      value:
                        anyOf:
                          - $ref: '#/components/schemas/booleanSchema'
                          - $ref: '#/components/schemas/stringSchema'
                          - $ref: '#/components/schemas/integerSchema'
                          - $ref: '#/components/schemas/doubleSchema'
                          - $ref: '#/components/schemas/arrayOfStrings'
                          - $ref: '#/components/schemas/categoryAttributesArray'
                          - $ref: '#/components/schemas/categoryAttribute'
                          - $ref: '#/components/schemas/productAttributeFiltersArray'
                          - $ref: '#/components/schemas/productAttributeFilter'
                        example: Color
            examples:
              updateCollectionName:
                summary: Update collection name
                value:
                  data:
                    - op: replace
                      path: /name
                      value: Color
              addCategoryAttribute:
                summary: Add a category attribute
                value:
                  data:
                    - op: add
                      path: /attributes/-
                      value:
                        id: 6628ab4c90fdd1d5aa920659
                        value: blue
              replaceCategoryAttributeValue:
                summary: Update category attribute value
                value:
                  data:
                    - op: add
                      path: /attributes/0/value
                      value: Red
              removeCategoryAttribute:
                summary: Remove category attribute
                value:
                  data:
                    - op: remove
                      path: /attributes/0
              addProductAttributeFilter:
                summary: Add product attribute filter
                value:
                  data:
                    - op: add
                      path: /productAttributeFilters/-
                      value:
                        condition: IN
                        id: 6454e9d445276428de74c54f
                        value:
                          - XP
                          - HP
              replaceProductAttributeFilter:
                summary: Replace product attribute filter
                value:
                  data:
                    - op: replace
                      path: /productAttributeFilters/0
                      value:
                        condition: EQUALS
                        id: 6454e9d445276428de74c54f
                        value: HP
              replaceProductAttributeFilterValue:
                summary: Replace product attribute filter
                value:
                  data:
                    op: replace
                    path: /productAttributeFilters/0/value
                    value:
                      - LG
              removeProductAttributeFilter:
                summary: Remove product attribute filter
                value:
                  data:
                    - op: remove
                      path: /productAttributeFilters/0
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/collectionResponse'
          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'
        '404':
          $ref: '#/components/responses/notFoundError'
        '413':
          $ref: '#/components/responses/payloadLimitExceededError'
        '500':
          $ref: '#/components/responses/internalServerError'
    delete:
      tags:
        - Collections
      summary: Delete Collection
      description: >-
        If there is a change in product offerings, one or more collections may
        become unnecessary. This endpoint is used to delete a collection by ID.
      operationId: deleteCollection
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
        - $ref: '#/components/parameters/collectionId'
      responses:
        '200':
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/x-fabric-request-id-header'
          description: OK
        '400':
          $ref: '#/components/responses/badRequest'
        '401':
          $ref: '#/components/responses/notAuthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/notFoundError'
        '500':
          $ref: '#/components/responses/internalServerError'
  /collections/{id}/children:
    put:
      tags:
        - Collections
      summary: Update Children of Collection
      description: >-
        This endpoint is primarily used to change display order of children
        collection.
      operationId: updateChildrenByCollection
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
        - $ref: '#/components/parameters/collectionId'
      requestBody:
        description: Request body for rearranging children collections
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/updateChildrenCollection'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/collectionResponse'
          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'
        '404':
          $ref: '#/components/responses/notFoundError'
        '413':
          $ref: '#/components/responses/payloadLimitExceededError'
        '500':
          $ref: '#/components/responses/internalServerError'
  /collections/{id}/products:
    get:
      tags:
        - Collections
      summary: Get Products Under Collection
      description: >-
        To ensure the right set of products are organized within a collection,
        it's important to review products in each collection. This endpoint gets
        a paginated list of products in a collection.  **Note**: You can refine
        your search by specifying `offset` and `limit`. When they're not
        specified, you'll get up to 10 products by default.
      operationId: getProductsByCollection
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
        - $ref: '#/components/parameters/collectionId'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/locales'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getCollectionProductsResponse'
          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'
        '404':
          $ref: '#/components/responses/notFoundError'
        '413':
          $ref: '#/components/responses/payloadLimitExceededError'
        '500':
          $ref: '#/components/responses/internalServerError'
  /collections/search:
    post:
      tags:
        - Collections
      summary: Find Collections
      description: >-
        This endpoint enables you to find collections by the search criteria you
        specify in the request body. You can also  `sort` the results.
      operationId: searchCollections
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
      requestBody:
        $ref: '#/components/requestBodies/searchCollectionRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/searchCollectionResponse'
          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'
        '413':
          $ref: '#/components/responses/payloadLimitExceededError'
        '500':
          $ref: '#/components/responses/internalServerError'
  /collections/actions/copy-category:
    post:
      tags:
        - Collections
      summary: Copy Category to Collections
      description: >-
        This endpoint is used to replicate category tree hierarchy to
        collections.
      operationId: copyCategories
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
      requestBody:
        $ref: '#/components/requestBodies/copyCategoryRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/copyCategoryResponse'
          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'
        '413':
          $ref: '#/components/responses/payloadLimitExceededError'
        '500':
          $ref: '#/components/responses/internalServerError'
  /categories-path:
    get:
      tags:
        - Navigation Paths
      summary: Get Navigation Path for Categories
      description: >-
        In **Product Catalog**, items are organized in a hierarchy tree
        structure of parent and children categories. This endpoint gets the
        navigation path starting from the root (level 0) until the given
        category IDs.
      operationId: getCategoriesPath
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
        - $ref: '#/components/parameters/locales'
        - $ref: '#/components/parameters/categoryIds'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/categoryPathResponse'
          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'
        '413':
          $ref: '#/components/responses/payloadLimitExceededError'
        '500':
          $ref: '#/components/responses/internalServerError'
  /collections-path:
    get:
      tags:
        - Navigation Paths
      summary: Get Navigation Path for Collections
      description: >-
        On the Storefront, products are organized in hierarchical tree structure
        of parent and children collections. This endpoint gets the navigation
        path starting from the root (level 0) until the given collections.
      operationId: getCollectionsPath
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
        - $ref: '#/components/parameters/locales'
        - $ref: '#/components/parameters/collectionIds'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/collectionsPathResponse'
          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'
        '413':
          $ref: '#/components/responses/payloadLimitExceededError'
        '500':
          $ref: '#/components/responses/internalServerError'
components:
  securitySchemes:
    authorization:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: S2S access token (JWT) from fabric Identity service (during Login)
  requestBodies:
    searchCategoryRequest:
      description: Request body for attribute creation
      content:
        application/json:
          schema:
            type: object
            required:
              - match
            additionalProperties: false
            properties:
              sort:
                type: string
                description: >-
                  Sorting criteria. Supported values are `createdAt`,
                  `updatedAt`, and `name`. `-` refers to descending and `+`
                  refers to ascending order
                example: +name,-createdAt
              match:
                description: Specification for matching attributes
                type: object
                minProperties: 1
                properties:
                  id:
                    $ref: '#/components/schemas/simpleStringSearchOperation'
                  name:
                    allOf:
                      - $ref: '#/components/schemas/stringSearchOperation'
                    type: object
                    description: >-
                      Searches for attributes that matches the query. Append
                      locale and name with a `#` as a value
                    properties:
                      locale:
                        type: array
                        description: >-
                          If `isLocalizable` is true, searches for the requested
                          name in the list of locales provided here. If
                          `isLocalizable` is false, searches for the
                          non-localized names.
                        items:
                          type: string
                          description: Locale
                          example: en_US
                  isLocalizable:
                    $ref: '#/components/schemas/booleanSearchOperation'
                  isRoot:
                    $ref: '#/components/schemas/booleanSearchOperation'
                  isLeaf:
                    $ref: '#/components/schemas/booleanSearchOperation'
                  attribute:
                    type: array
                    items:
                      $ref: '#/components/schemas/attributeSearchOperation'
                  productAttributeIds:
                    $ref: '#/components/schemas/simpleStringSearchOperation'
                  hasProductAttributeMandatory:
                    deprecated: true
                    $ref: '#/components/schemas/booleanSearchOperation'
                  updatedBy:
                    $ref: '#/components/schemas/simpleStringSearchOperation'
                  createdAt:
                    $ref: '#/components/schemas/datetimeSearchOperation'
                  updatedAt:
                    $ref: '#/components/schemas/datetimeSearchOperation'
              offset:
                description: >-
                  Number of records to skip before returning records. For
                  example, `offset=20, limit=10` returns records 21-30.
                type: integer
                format: int32
                default: 0
                example: 2
              limit:
                description: Maximum number of records per page
                type: integer
                format: int32
                default: 10
                example: 10
    searchCollectionRequest:
      description: Request body for search
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            required:
              - match
            properties:
              sort:
                type: string
                description: >-
                  Sorting criteria. Sorting is supported only on createdAt,
                  updatedAt. `-` refers to descending while `+` refers to
                  ascending order
                example: +createdAt,-updatedAt
              match:
                description: Specification for matching attributes
                type: object
                minProperties: 1
                properties:
                  id:
                    $ref: '#/components/schemas/simpleStringSearchOperation'
                  name:
                    allOf:
                      - $ref: '#/components/schemas/stringSearchOperation'
                    type: object
                    description: >-
                      Searches for attributes that matches the query. Append
                      locale and name with a `#` as a value
                    properties:
                      locale:
                        type: array
                        description: >-
                          If `isLocalizable` is true, searches for the requested
                          name in the list of locales provided here. If
                          `isLocalizable` is false, searches for the
                          non-localized names.
                        items:
                          type: string
                          description: Locale
                          example: en_US
                  isLocalizable:
                    $ref: '#/components/schemas/booleanSearchOperation'
                  isRoot:
                    $ref: '#/components/schemas/booleanSearchOperation'
                  isLeaf:
                    $ref: '#/components/schemas/booleanSearchOperation'
                  attribute:
                    type: array
                    items:
                      $ref: '#/components/schemas/attributeSearchOperation'
                  categoryIdsIncluded:
                    $ref: '#/components/schemas/simpleStringSearchOperation'
                  categoryIdsExcluded:
                    deprecated: true
                    $ref: '#/components/schemas/simpleStringSearchOperation'
                  productAttributeIdsFilter:
                    $ref: '#/components/schemas/simpleStringSearchOperation'
                  updatedBy:
                    $ref: '#/components/schemas/simpleStringSearchOperation'
                  createdAt:
                    $ref: '#/components/schemas/datetimeSearchOperation'
                  updatedAt:
                    $ref: '#/components/schemas/datetimeSearchOperation'
              offset:
                description: >-
                  Number of records to skip before returning records. For
                  example, `offset=20, limit=10` returns records 21-30.
                type: integer
                format: int32
                default: 0
                example: 2
              limit:
                description: Maximum number of records per page
                type: integer
                format: int32
                default: 10
                example: 10
    copyCategoryRequest:
      description: Request body for copy
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            required:
              - parentCollectionId
              - categoryId
            properties:
              parentCollectionId:
                type: string
                description: 24-character system-generated parent category ID
                example: 64184766610c0e32a86d8758
              categoryId:
                type: string
                description: 24-character system-generated category ID
                example: 917329dfd5288b0011332300
  responses:
    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
    notFoundError:
      description: The entity requested for isn't found
      headers:
        x-fabric-request-id:
          $ref: '#/components/headers/x-fabric-request-id-header'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/genericError'
          example:
            type: NOT_FOUND
            message: Resource not found
    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
    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'
    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
    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
    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
  parameters:
    categoryIds:
      in: query
      name: ids
      allowReserved: true
      schema:
        type: string
        example: 64184766610c0e32a86d8758
        description: Navigation path for the category IDs, starting from the root category.
      required: false
    categoryId:
      in: path
      name: id
      description: 24-character system-generated category ID
      schema:
        type: string
      required: true
      example: 56328bf0b5f328bf0b5f328b
    collectionIds:
      in: query
      name: ids
      allowReserved: true
      schema:
        type: string
        example: 64184766610c0e32a86d8758
        description: >-
          Navigation path for the collection IDs, starting from the root
          category.
      required: false
    collectionId:
      in: path
      name: id
      description: System-generated 24-character collection ID
      schema:
        type: string
      required: true
      example: 54328bf0b5f328bf0b5f3280
    locales:
      in: query
      name: locales
      allowReserved: true
      schema:
        type: string
        example: fr-CA, en-US
        description: >-
          Comma-separated locale codes of category. The service throws a 400
          error if locale isn't supported. Standard locales can be found at
          https://www.rfc-editor.org/rfc/rfc5646. The recommended way to get the
          locale is by invoking multi-channel service
      required: false
    offset:
      in: query
      name: offset
      description: >-
        Number of records to skip before returning records. For example,
        `offset=20, limit=10` returns records 21-30.
      schema:
        type: integer
        format: int32
        default: 0
        example: 0
      required: false
    limit:
      in: query
      name: limit
      description: Maximum number of records per page
      schema:
        type: integer
        format: int32
        default: 10
        example: 10
      required: false
    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
  headers:
    x-fabric-request-id-header:
      description: Unique request ID
      schema:
        type: string
        example: 263e731c-45c8-11ed-b878-0242ac120002
  schemas:
    attributeValueInfo:
      anyOf:
        - $ref: '#/components/schemas/localizedStringSearchOperation'
        - $ref: '#/components/schemas/booleanSearchOperation'
        - $ref: '#/components/schemas/numberSearchOperation'
    attributeSearchOperation:
      type: object
      description: >-
        Attributes are searched in combination of `id` and `value`. Search can
        be performed on an array of attribute ID and attribute value pair.
      properties:
        id:
          type: string
          description: 24-character system-generated attribute ID
          example: 60184766610c0e32a86d8758
        value:
          type: array
          description: Attribute value
          items:
            $ref: '#/components/schemas/attributeValueInfo'
    patchOperation:
      description: Patch operation
      type: string
      enum:
        - add
        - replace
        - remove
      example: replace
    booleanSchema:
      type: boolean
      nullable: true
      description: Sample boolean schema
      example: true
    stringSchema:
      type: string
      nullable: true
      description: Sample string schema
      example: blue
    dateSchema:
      type: string
      format: date
      nullable: true
      description: Sample date schema
      example: 2022-12-31T00:00:00.000Z
    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
    patchCategory:
      type: object
      description: >-
        Partial update of category such as replacing category name or adding,
        replacing, or removing category attributes or product attributes from a
        category.
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: array
          minItems: 1
          items:
            required:
              - op
              - path
            properties:
              op:
                $ref: '#/components/schemas/patchOperation'
              path:
                type: string
                description: Navigation path to update category fields
                example: /categoryAttributes/0/name
              value:
                description: New value for operation
                anyOf:
                  - $ref: '#/components/schemas/booleanSchema'
                  - $ref: '#/components/schemas/stringSchema'
                  - $ref: '#/components/schemas/doubleSchema'
                  - $ref: '#/components/schemas/integerSchema'
                  - $ref: '#/components/schemas/categoryAttributesArray'
                  - $ref: '#/components/schemas/categoryAttribute'
                  - $ref: '#/components/schemas/productAttributesArray'
                  - $ref: '#/components/schemas/productAttribute'
                example: Color
    attribute:
      type: object
      description: Attribute details
      properties:
        id:
          type: string
          example: 64184766610c0e32a86d8758
          description: 24-character system-generated attribute ID
        name:
          type: string
          example: color
          description: Non-localized attribute name
        localizedProperties:
          $ref: '#/components/schemas/localizedProperties'
        isLocalizable:
          type: boolean
          example: true
          description: >-
            true: Attribute name can be translated into different languages or
            localized for different regions. <br /> false: Attribute name can't
            be localized. **Note**: Refer to `localizedProperties` to get
            relevant attributes based on locale.
        isInherited:
          type: boolean
          example: true
          description: >-
            true: Attribute is inherited from its parent. <br /> false:
            Attribute isn't inherited from parent
        type:
          type: string
          example: TEXT
          description: Attribute type
        validation:
          $ref: '#/components/schemas/dateTypeAttributeValidation'
        value:
          description: Attribute value
          anyOf:
            - $ref: '#/components/schemas/booleanSchema'
            - $ref: '#/components/schemas/stringSchema'
            - $ref: '#/components/schemas/doubleSchema'
            - $ref: '#/components/schemas/integerSchema'
            - $ref: '#/components/schemas/dateSchema'
          example: blue
    dateTypeAttributeValidation:
      type: object
      description: Attribute validation - date
      properties:
        dateFormat:
          type: string
          example: MM-DD-YYYY
          description: Date format. <br /> Applicable when attributeType is `DATETIME`.
    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
    entityDetails:
      type: array
      items:
        type: object
        description: Category details
        properties:
          id:
            type: string
            example: 64184766610c0e32a86d8758
            description: 24-character system-generated category ID
          name:
            type: string
            example: Chairs
            description: Non-localized category name
          localizedProperties:
            allOf:
              - description: Localized properties
              - $ref: '#/components/schemas/localizedProperties'
          isLocalizable:
            type: boolean
            example: true
            description: >-
              true: Category name is translated into different languages or
              localized for different regions <br /> false: Category name isn't
              localized **Note**: Refer to `localizedProperties` to get relevant
              details based on locale
    createCategories:
      type: object
      description: Bulk creation of categories
      properties:
        categories:
          type: array
          items:
            $ref: '#/components/schemas/createCategory'
    createCategory:
      type: object
      description: Details to create category
      additionalProperties: false
      properties:
        parentCategoryId:
          type: string
          description: 24-character system-generated ID of parent category
          example: 507f1f77bcf86cd799439011
        name:
          type: string
          example: Color
          description: Non-localized category name
        localizedProperties:
          description: Localized properties
          allOf:
            - $ref: '#/components/schemas/localizedProperties'
        isLocalizable:
          type: boolean
          example: true
          description: >-
            true: Category name is translated into different languages or
            localized for different regions. <br /> false: Category name isn't
            localized. **Note**: Refer to `localizedProperties` to get relevant
            details based on locale.
        categoryAttributes:
          type: array
          description: Details of attributes assigned to a category
          items:
            type: object
            properties:
              id:
                type: string
                example: 607f1f77bcf86cd799439011
                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
        productAttributes:
          type: array
          description: >-
            List attributes applicable for all products in the specified
            category
          items:
            type: object
            properties:
              id:
                type: string
                description: 24-character system-generated attribute ID
                example: 557f1f77bcf86cd799439015
              isMandatory:
                type: boolean
                description: >-
                  true: Attribute is mandatory <br /> false: Attribute is
                  optional
                example: true
    updateCategories:
      type: object
      description: Bulk Category creation
      additionalProperties: false
      properties:
        categories:
          type: array
          items:
            type: object
            allOf:
              - type: object
                properties:
                  id:
                    type: string
                    description: 24-character system-generated attribute ID
                    example: 557f1f77bcf86cd799439015
              - $ref: '#/components/schemas/updateCategory'
    updateCategory:
      type: object
      description: Category details to be updated
      additionalProperties: false
      properties:
        name:
          type: string
          example: Color
          description: Non-localized category name
        localizedProperties:
          description: Localized properties
          allOf:
            - $ref: '#/components/schemas/localizedProperties'
        isLocalizable:
          type: boolean
          example: true
          description: >-
            true: Category name is translated into different languages or
            localized for different regions <br /> false: Category name isn't
            localized. **Note**: Refer to `localizedProperties` to get relevant
            details based on locale
        categoryAttributes:
          $ref: '#/components/schemas/categoryAttributesArray'
        productAttributes:
          $ref: '#/components/schemas/productAttributesArray'
    categoryAttributesArray:
      type: array
      items:
        $ref: '#/components/schemas/categoryAttribute'
    categoryAttribute:
      type: object
      properties:
        id:
          type: string
          example: 55184766610c0e32a86d8759
          description: 24-character system-generated attribute ID
        value:
          description: Attribute value
          anyOf:
            - $ref: '#/components/schemas/booleanSchema'
            - $ref: '#/components/schemas/stringSchema'
            - $ref: '#/components/schemas/dateSchema'
            - $ref: '#/components/schemas/doubleSchema'
            - $ref: '#/components/schemas/integerSchema'
          example: blue
    productAttributesArray:
      type: array
      items:
        $ref: '#/components/schemas/productAttribute'
    productAttribute:
      type: object
      properties:
        id:
          type: string
          description: 24-character system-generated attribute ID
          example: 55184766610c0e32a86d8759
        isMandatory:
          type: boolean
          description: 'true: attribute is mandatory <br /> false: attribute is optional'
          example: true
    collections:
      type: object
      description: Bulk Collection creation
      properties:
        collections:
          type: array
          items:
            $ref: '#/components/schemas/collection'
    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
                description: 24-character system-generated attribute ID
                example: 78184766610c0e32a86d8757
              condition:
                $ref: '#/components/schemas/attributeFilterCondition'
              value:
                $ref: '#/components/schemas/attributeFilterValue'
    updateChildrenCollection:
      type: object
      description: Details to update children collections
      additionalProperties: false
      required:
        - children
      properties:
        children:
          description: Immediate children of the specified collection
          type: array
          minItems: 1
          items:
            type: object
            required:
              - id
              - order
            properties:
              id:
                type: string
                example: 88184766610c0e32a86d8757
                description: 24-character system-generated ID of child collection
              order:
                type: integer
                format: int32
                example: 2
                description: >-
                  Order in which this child category appears among the sibling
                  categories (of the same parent). **Note**: Order 0 means this
                  child category appears at the beginning of other sibling
                  categories. Unless order is specified, the child category
                  appears at the end
    updateCollections:
      type: object
      description: Bulk Collection creation
      properties:
        collections:
          type: array
          items:
            type: object
            allOf:
              - type: object
                properties:
                  id:
                    type: string
                    example: 88184766610c0e32a86d8757
                    description: 24-character system-generated ID of child collection
              - $ref: '#/components/schemas/updateCollection'
    updateCollection:
      type: object
      description: Details to update collection
      additionalProperties: false
      properties:
        name:
          type: string
          example: Color
          description: Non-localized collection name
        isLocalizable:
          type: boolean
          example: true
          description: >-
            true: Collection name can be translated into different languages or
            localized for different regions. <br /> false: Collection name can't
            be localized. **Note**: Refer to `localizedProperties` to get
            relevant collection name based on locale.
        localizedProperties:
          description: Localized properties of collection
          allOf:
            - $ref: '#/components/schemas/localizedProperties'
        attributes:
          description: List of attributes assigned to the collection
          type: array
          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
          example:
            - 64184766610c0e32a86d8758
            - 917329dfd5288b0011332300
          description: Category IDs included in collection
        categoryIdsExcluded:
          deprecated: true
          type: array
          items:
            type: string
          example:
            - 66184766610c0e32a86d8722
            - 41184766610c0e32a86d8778
          description: Category IDs excluded in collection
        isActive:
          type: boolean
          example: true
          description: 'true: Collection is active <br /> false: Collection is inactive'
        productAttributeFilters:
          $ref: '#/components/schemas/productAttributeFiltersArray'
    productAttributeFiltersArray:
      type: array
      items:
        $ref: '#/components/schemas/productAttributeFilter'
    productAttributeFilter:
      type: object
      properties:
        attributeId:
          type: string
          example: 53184766610c0e32a86d875
          description: 24-character system-generated attribute ID
        condition:
          $ref: '#/components/schemas/attributeFilterCondition'
        value:
          $ref: '#/components/schemas/attributeFilterValue'
    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
    attributeFilterCondition:
      type: string
      description: Filter conditions
      enum:
        - GT
        - LT
        - EQUALS
        - IN
        - NOT_IN
        - CONTAINS
        - NOT_CONTAINS
      example: EQUALS
    productAttributesFilter:
      type: object
      description: Filter criteria
      properties:
        attributeId:
          type: string
          example: 53184766610c0e32a86d875
          description: 24-character system-generated attribute ID
        name:
          type: string
          example: Mobile name
          description: Non-localized attribute name
        localizedProperties:
          description: Localized properties of attribute
          allOf:
            - $ref: '#/components/schemas/localizedProperties'
        isLocalizable:
          type: boolean
          example: true
          description: >-
            true: Attribute name is translated into different languages or
            localized for different regions <br /> false: Attribute name isn't
            localized **Note**: Refer to `localizedProperties` to get relevant
            attributes based on locale.
        condition:
          $ref: '#/components/schemas/attributeFilterCondition'
        value:
          $ref: '#/components/schemas/attributeFilterValue'
    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
    categoryResponse:
      type: object
      description: Category details
      properties:
        id:
          type: string
          description: 24-character system-generated category ID
          example: 53184766610c0e32a86d875
        name:
          type: string
          description: Non-localized category name
          example: Color
        localizedProperties:
          description: Localized properties of category
          allOf:
            - $ref: '#/components/schemas/localizedProperties'
        isLocalizable:
          type: boolean
          example: true
          description: >-
            true: Category name is translated into different languages or
            localized for different regions <br /> false: Category name isn't
            localized **Note**: Refer to `localizedProperties` to get relevant
            details based on locale
        isRoot:
          type: boolean
          example: true
          description: >-
            true: This is a root category <br /> false: This isn't a root
            category
        isLeaf:
          type: boolean
          example: false
          description: >-
            true: This is the last category of the branch with no further
            children categories <br /> false: This isn't the last category of
            the branch and has children categories
        hasProducts:
          type: boolean
          description: >-
            true: This is the leaf category of the branch which has some
            products in it <br /> false: This branch doesn't have any direct
            products assigned to it
          example: true
        categoryAttributes:
          description: Attributes assigned to the specified category
          type: array
          items:
            $ref: '#/components/schemas/attribute'
        productAttributes:
          type: array
          description: Attributes assigned for all products in the specified category.
          items:
            type: object
            properties:
              id:
                type: string
                example: 33184766610c0e32a86d8759
                description: 24-character system-generated attribute ID
              name:
                type: string
                example: Color
                description: Non-localized attribute name
              localizedProperties:
                allOf:
                  - description: Localized properties of attribute
                  - $ref: '#/components/schemas/localizedProperties'
              isLocalizable:
                type: boolean
                example: true
                description: >-
                  true: Attribute name is translated into different languages or
                  localized for different regions <br /> false: Attribute name
                  isn't localized **Note**: Refer to `localizedProperties` to
                  get relevant attributes based on locale
              isInherited:
                type: boolean
                example: true
                description: >-
                  true: Attribute is inherited from its parent. <br /> false:
                  Attribute isn't inherited from parent
              type:
                type: string
                example: TEXT
                description: Attribute type
              isMandatory:
                type: boolean
                description: 'true: Attribute is mandatory <br /> Attribute is optional'
                example: true
        productIds:
          type: array
          items:
            type: string
            description: >-
              System-generated 24-character product IDs associated with a
              category
            example: 64184766610c0e32a86d8758
        children:
          type: array
          description: Immediate children of the specified category
          items:
            type: object
            properties:
              id:
                type: string
                example: 33184766610c0e32a86d8759
                description: 24-character system-generated ID of child category
              name:
                type: string
                example: Color
                description: Non-localized name of child category
              localizedProperties:
                allOf:
                  - description: Localized properties of child category
                  - $ref: '#/components/schemas/localizedProperties'
              isLocalizable:
                type: boolean
                example: true
                description: >-
                  true: Category name is translated into different languages or
                  localized for different regions <br /> false: Category name
                  isn't localized **Note**: Refer to `localizedProperties` to
                  get relevant details based on locale
              isLeaf:
                type: boolean
                description: >-
                  true: This is the last category of the branch with no further
                  children categories <br /> false: This isn't the last category
                  of the branch and has children categories
                example: false
              hasProducts:
                type: boolean
                description: >-
                  true: This is the leaf category of the branch which has some
                  products in it <br /> false: This branch doesn't have any
                  direct products assigned to it
                example: true
        updatedBy:
          type: string
          example: test@eamil.com
          description: Email of user who last update the category
        updatedAt:
          type: string
          example: '2023-04-20T10:24:36.162Z'
          description: Time of last update to category
        createdAt:
          type: string
          example: '2021-04-20T10:24:36.162Z'
          description: Time of category creation
    copyCategoryResponse:
      type: object
      description: Category details
      properties:
        id:
          type: string
          description: 24-character system-generated category ID
          example: 53184766610c0e32a86d875
        name:
          type: string
          description: Non-localized category name
          example: Color
        localizedProperties:
          description: Localized properties of category
          allOf:
            - $ref: '#/components/schemas/localizedProperties'
        isLocalizable:
          type: boolean
          example: true
          description: >-
            true: Category name is translated into different languages or
            localized for different regions <br /> false: Category name isn't
            localized **Note**: Refer to `localizedProperties` to get relevant
            details based on locale
        isRoot:
          type: boolean
          example: true
          description: >-
            true: This is a root category <br /> false: This isn't a root
            category
        isLeaf:
          type: boolean
          example: false
          description: >-
            true: This is the last category of the branch with no further
            children categories <br /> false: This isn't the last category of
            the branch and has children categories
        categoryAttributes:
          description: Attributes assigned to the specified category
          type: array
          items:
            $ref: '#/components/schemas/attribute'
        productAttributes:
          type: array
          description: Attributes assigned for all products in the specified category.
          items:
            type: object
            properties:
              id:
                type: string
                example: 33184766610c0e32a86d8759
                description: 24-character system-generated attribute ID
              name:
                type: string
                example: Color
                description: Non-localized attribute name
              localizedProperties:
                allOf:
                  - description: Localized properties of attribute
                  - $ref: '#/components/schemas/localizedProperties'
              isLocalizable:
                type: boolean
                example: true
                description: >-
                  true: Attribute name is translated into different languages or
                  localized for different regions <br /> false: Attribute name
                  isn't localized **Note**: Refer to `localizedProperties` to
                  get relevant attributes based on locale
              isInherited:
                type: boolean
                example: true
                description: >-
                  true: Attribute is inherited from its parent. <br /> false:
                  Attribute isn't inherited from parent
              type:
                type: string
                example: TEXT
                description: Attribute type
              isMandatory:
                type: boolean
                description: 'true: Attribute is mandatory <br /> Attribute is optional'
                example: true
        productIds:
          type: array
          items:
            type: string
            description: >-
              System-generated 24-character product IDs associated with a
              category
            example: 64184766610c0e32a86d8758
        children:
          type: array
          description: Immediate children of the specified category
          items:
            type: object
            properties:
              id:
                type: string
                example: 33184766610c0e32a86d8759
                description: 24-character system-generated ID of child category
              name:
                type: string
                example: Color
                description: Non-localized name of child category
              localizedProperties:
                allOf:
                  - description: Localized properties of child category
                  - $ref: '#/components/schemas/localizedProperties'
              isLocalizable:
                type: boolean
                example: true
                description: >-
                  true: Category name is translated into different languages or
                  localized for different regions <br /> false: Category name
                  isn't localized **Note**: Refer to `localizedProperties` to
                  get relevant details based on locale
              isLeaf:
                type: boolean
                description: >-
                  true: This is the last category of the branch with no further
                  children categories <br /> false: This isn't the last category
                  of the branch and has children categories
                example: false
        updatedBy:
          type: string
          example: test@eamil.com
          description: Email of user who last update the category
        updatedAt:
          type: string
          example: '2023-04-20T10:24:36.162Z'
          description: Time of last update to category
        createdAt:
          type: string
          example: '2021-04-20T10:24:36.162Z'
          description: Time of category creation
    paginatedResultMeta:
      description: Meta details needed for every paginated response
      type: object
      properties:
        offset:
          type: integer
          format: int32
          default: 0
          example: 5
          description: >-
            Number of records to skip before returning records. For example,
            `offset=20, limit=10` returns records 21-30.
        limit:
          type: integer
          format: int32
          default: 10
          example: 10
          description: Maximum number of records per page
        count:
          type: integer
          format: int32
          example: 100
          description: Total number of records in the response
    searchCategoryResponse:
      description: Search categories response
      allOf:
        - $ref: '#/components/schemas/paginatedResultMeta'
        - type: object
          properties:
            data:
              type: array
              items:
                $ref: '#/components/schemas/categoryResponse'
    searchCollectionResponse:
      description: Search response
      allOf:
        - $ref: '#/components/schemas/paginatedResultMeta'
        - type: object
          properties:
            data:
              type: array
              items:
                $ref: '#/components/schemas/collectionResponse'
    collectionResponse:
      description: Collection details
      type: object
      properties:
        id:
          type: string
          description: 24-character system-generated collection ID
          example: 55184766610c0e32a86d8759
        name:
          type: string
          description: Non-localized collection name
          example: Color
        localizedProperties:
          allOf:
            - description: Localized properties of collection
            - $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: Collection is root category.<br /> false: Collection isn't a
            root category.
        isActive:
          type: boolean
          example: false
          description: 'true: Collection is active <br /> false: Collection is inactive'
        attributes:
          type: array
          description: Collection attributes
          items:
            $ref: '#/components/schemas/attribute'
        categoriesIncluded:
          description: List of categories included
          allOf:
            - $ref: '#/components/schemas/entityDetails'
        categoriesExcluded:
          description: List of categories excluded
          allOf:
            - $ref: '#/components/schemas/entityDetails'
        productAttributeFilters:
          type: array
          description: Attribute filters applied to the category
          items:
            $ref: '#/components/schemas/productAttributesFilter'
        children:
          description: Immediate children of the specified collection
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: 24-character system-generated ID of child collection
                example: 78184766610c0e32a86d8757
              name:
                type: string
                example: Chairs
                description: Non-localized name of child collection
              localizedProperties:
                allOf:
                  - description: Localized properties of child collection
                  - $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
              isLeaf:
                type: boolean
                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
                example: false
        updatedBy:
          type: string
          example: test@eamil.com
          description: Email of user who last updated the category
        updatedAt:
          type: string
          example: '2023-04-20T10:24:36.162Z'
          description: Time of last updated to category (UTC)
        createdAt:
          type: string
          example: '2021-04-20T10:24:36.162Z'
          description: Time of category creation (UTC)
    attributeGroupsByCategoryResponse:
      type: object
      description: Attribute details
      properties:
        data:
          description: Attribute groups
          type: array
          items:
            $ref: '#/components/schemas/attributeGroup'
    attributeGroup:
      type: object
      description: Attribute groups details
      properties:
        id:
          type: string
          description: 24-character system-generated ID of attribute group
          example: 78184766610c0e32a86d8757
        name:
          type: string
          description: Attribute group name
          example: Dimensions
        description:
          type: string
          nullable: true
          description: Brief description of attribute group
          example: Product dimensions
        priority:
          type: integer
          format: int32
          description: Order of appearance of attribute group
          example: 1
        attributes:
          type: array
          description: Attributes associated with the attribute group
          items:
            properties:
              attributeId:
                type: string
                description: 24-character system-generated attribute ID
                example: 617329dfd5288b0011332388
              name:
                type: string
                example: color
                description: Non-localized attribute name
              localizedProperties:
                type: object
                nullable: true
                description: Localized properties of attribute
                additionalProperties:
                  type: object
                  properties:
                    name:
                      type: string
                      example: Color
                      description: Localized attribute name
                example:
                  en-US:
                    name: Color
                  en-IN:
                    name: Colour
              isLocalizable:
                type: boolean
                example: true
                description: >-
                  true: Attribute name is translated into different languages or
                  localized for different regions <br /> false: Attribute name
                  isn't localized **Note**: Refer to `localizedProperties` to
                  get relevant attributes based on locale
              type:
                $ref: '#/components/schemas/attributeType'
              isReadOnly:
                type: boolean
                description: Determines if the attribute group is readonly.
                example: true
              target:
                type: string
                enum:
                  - PRODUCT
                  - CATEGORY
                example: PRODUCT
                description: Attribute target - product attribute or category attribute
              validation:
                $ref: '#/components/schemas/attributeValidation'
    attributeValidation:
      type: object
      description: Attribute validation rules
      properties:
        isMandatory:
          type: boolean
          default: false
          example: true
          description: 'true: Attribute is mandatory <br /> false: Attribute is optional'
        isManualOverwrite:
          type: boolean
          default: false
          example: true
          description: >-
            true: The value isn't computed using `formula` property <br />
            false: Value is computed using `formula` property. **Note**:
            manualOverwrite is applicable only if `formula` property is set
        formula:
          type: string
          example: (async () => await attribute('id') *10)()
          description: >-
            JavaScript will be evaluated and applied on product. <br />
            Applicable only when `attributeType` is TEXT, NUMBER, OPTIONS, or
            DATE.
        customValidationFormula:
          type: string
          example: (async () => await attribute('id') > 1)()
          description: >-
            JavaScript can be used to add custom validations.<br /> Applicable
            only when `attributeType` is TEXT, NUMBER, OPTIONS, DATE.
        dateFormat:
          type: string
          example: MM-DD-YYYY
          description: Date format. <br /> Applicable when `attributeType` is DATETIME.
        isDecimal:
          type: boolean
          default: false
          example: true
          description: >-
            true: Input must be a float <br /> false: Input must be an integer
            <br /> Applicable when `attributeType` is NUMBER
        min:
          type: integer
          format: int32
          example: 100
          description: >-
            Minimum value that can be accepted for the attribute. Applicable
            when `attributeType` is NUMBER.
        max:
          type: integer
          format: int32
          example: 100
          description: >-
            Maximum value that can be accepted for the attribute. Applicable
            when `attributeType` is NUMBER.
        startWith:
          type: integer
          format: int32
          example: 1
          description: >-
            Starting number of a series. <br /> Applicable when `attributeType`
            is SERIAL.
        increment:
          type: integer
          format: int32
          example: 10
          description: >-
            Number incremented in a series. <br /> Applicable only when
            `attributeType` is SERIAL.
        subType:
          type: string
          enum:
            - SINGLE
            - MULTIPLE
            - SMALL_TEXT
            - TEXT_AREA
            - HTML
          example: SINGLE
          description: >-
            Subtype `SINGLE` and `MULTIPLE` are applicable when `attributeType`
            is `OPTIONS`. The rest of the subTypes are applicable for `TEXT`
        acceptedValues:
          type: array
          items:
            type: string
            example: test1
            description: >-
              Non-localized names of accepted value. Applicable when the
              `attributeType` is `OPTIONS` and the corresponding `subType` is
              `MULTIPLE`.
        localizedAcceptedValues:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
              example: a
              description: Localized accepted value
          example:
            en-US:
              - Demo1
              - Demo2
              - Demo3
    attributeType:
      type: string
      enum:
        - TEXT
        - NUMBER
        - DATETIME
        - BOOLEAN
        - OPTIONS
        - SERIAL
      example: TEXT
      description: Attribute type
    categoryProductsResponse:
      description: Details of products associated to the category
      allOf:
        - $ref: '#/components/schemas/paginatedResultMeta'
        - type: object
          properties:
            data:
              type: object
              properties:
                id:
                  description: 24-character system-generated category ID
                  type: string
                  example: 617329dfd5288b0011332388
                products:
                  type: array
                  items:
                    $ref: '#/components/schemas/idBasedProduct'
    getCollectionProductsResponse:
      description: Details of products in a collection
      allOf:
        - $ref: '#/components/schemas/paginatedResultMeta'
        - type: object
          properties:
            data:
              type: object
              properties:
                id:
                  description: 24-character system-generated collection ID
                  type: string
                  example: 617329dfd5288b0011332388
                products:
                  type: array
                  items:
                    $ref: '#/components/schemas/idBasedProduct'
    createCategoryResponse:
      $ref: '#/components/schemas/categoryResponse'
    updateCategoryResponse:
      $ref: '#/components/schemas/categoryResponse'
    categoryPathResponse:
      type: object
      description: Navigation path for the given category
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                example: 33184766610c0e32a86d8759
                description: 24-character system-generated category ID
              name:
                type: string
                example: ABC
                description: Non-localized category name
              localizedProperties:
                $ref: '#/components/schemas/localizedProperties'
              isLocalizable:
                type: boolean
                example: true
                description: >-
                  true: Category name is translated into different languages or
                  localized for different regions <br /> false: Category name
                  isn't localized **Note**: Refer to `localizedProperties` to
                  get relevant details based on locale
              level:
                type: integer
                format: int32
                example: 2
                description: Category level in the hierarchical tree structure
              ancestors:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      example: 78184766610c0e32a86d8757
                      description: 24-character system-generated ID of parent category
                    name:
                      type: string
                      example: XYZ
                      description: Non-localized name of parent category
                    localizedProperties:
                      $ref: '#/components/schemas/localizedProperties'
                    isLocalizable:
                      type: boolean
                      example: true
                      description: >-
                        true: Category name is translated into different
                        languages or localized for different regions <br />
                        false: Category name isn't localized **Note**: Refer to
                        `localizedProperties` to get relevant details based on
                        locale
                    level:
                      type: integer
                      format: int32
                      example: 1
                      description: Category level in the hierarchical tree structure
    collectionsPathResponse:
      type: object
      description: Navigation path for the given collection
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                example: 78184766610c0e32a86d8757
                description: 24-character system-generated collection ID
              name:
                type: string
                example: ABC
                description: Non-localized collection name
              localizedProperties:
                $ref: '#/components/schemas/localizedProperties'
              level:
                type: integer
                format: int32
                example: 2
                description: Collection level
              ancestors:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      example: 53184766610c0e32a86d875
                      description: 24-character system-generated ID of parent collection
                    name:
                      type: string
                      example: XYZ
                      description: Name of parent collection
                    localizedProperties:
                      $ref: '#/components/schemas/localizedProperties'
                    level:
                      type: integer
                      format: int32
                      example: 1
                      description: >-
                        Level of parent collection in the hierarchical tree
                        structure
    datetimeSearchOperation:
      type: object
      description: Date-time search
      anyOf:
        - $ref: '#/components/schemas/datetimeRangeOperation'
        - $ref: '#/components/schemas/datetimeInOperation'
        - $ref: '#/components/schemas/datetimeOperation'
    datetimeInOperation:
      type: object
      description: Date-time search based on IN condition
      required:
        - op
        - value
      properties:
        op:
          type: string
          description: >-
            Operations that can be performed on a date type. That is, equals to,
            less than, greater than, less than or equal to, and greater than or
            equal to
          example: IN
          enum:
            - IN
        value:
          type: array
          items:
            type: string
            description: Time to be searched (UTC)
            example: '2021-04-20T10:24:36.162Z'
    datetimeOperation:
      type: object
      description: Date-time search
      required:
        - op
        - value
      properties:
        op:
          type: string
          description: >-
            Operations that can be performed on a `number` type such as equals
            to, less than (LT), Greater than (GT), Less than or equal to (LTE),
            Greater than or equal to (GTE), etc.
          example: GTE
          enum:
            - EQUALS
            - LTE
            - GTE
            - LT
            - GT
        value:
          type: string
          description: Time to be searched (UTC)
          example: '2022-04-20T10:24:36.162Z'
    datetimeRangeOperation:
      type: object
      description: Date range search
      required:
        - op
        - fromValue
        - toValue
      properties:
        op:
          type: string
          description: Search operation performed on a date range
          example: RANGE
          enum:
            - RANGE
        fromValue:
          type: string
          description: Starting range (UTC)
          example: '2022-04-20T10:24:36.162Z'
        toValue:
          type: string
          description: Ending range (UTC)
          example: '2023-04-20T10:24:36.162Z'
    advancedStringSearchOperation:
      type: object
      description: Advanced string search
      anyOf:
        - $ref: '#/components/schemas/advancedMultiStringSearchOperation'
        - $ref: '#/components/schemas/advancedSingleStringSearchOperation'
    advancedSingleStringSearchOperation:
      type: object
      description: Advanced single-string search
      required:
        - op
        - value
      properties:
        op:
          type: string
          description: Operations that can be performed on a string type
          example: EQUALS
          enum:
            - EQUALS
            - CONTAINS
            - NOT_EQUALS
        value:
          $ref: '#/components/schemas/stringSchema'
    advancedMultiStringSearchOperation:
      type: object
      description: Advanced multi-string search
      required:
        - op
        - value
      properties:
        op:
          type: string
          description: Operations that can be performed on a `string` type
          example: IN
          enum:
            - IN
            - NOT_IN
        value:
          type: array
          items:
            $ref: '#/components/schemas/stringSchema'
    numberSearchOperation:
      type: object
      description: Number search
      anyOf:
        - $ref: '#/components/schemas/singleNumberSearchOperation'
        - $ref: '#/components/schemas/multiNumberSearchOperation'
    singleNumberSearchOperation:
      type: object
      description: Single number search
      required:
        - op
        - value
      properties:
        op:
          type: string
          description: >-
            Operations that can be performed on a `number` type such as equals
            to, less than (LT), Greater than (GT), Less than or equal to (LTE),
            Greater than or equal to (GTE), etc.
          example: GTE
          enum:
            - EQUALS
            - LTE
            - GTE
            - LT
            - GT
        value:
          $ref: '#/components/schemas/doubleSchema'
    multiNumberSearchOperation:
      type: object
      description: Multiple numbers search
      required:
        - op
        - value
      properties:
        op:
          type: string
          description: In operation on a `number` type
          example: IN
          enum:
            - IN
        value:
          type: array
          items:
            $ref: '#/components/schemas/doubleSchema'
    simpleStringSearchOperation:
      type: object
      description: Simple string search
      anyOf:
        - $ref: '#/components/schemas/simpleMultiStringSearchOperation'
        - $ref: '#/components/schemas/simpleSingleStringSearchOperation'
    simpleSingleStringSearchOperation:
      type: object
      description: Simple single-string search
      required:
        - op
        - value
      properties:
        op:
          type: string
          description: Operations that can be performed on a `string` type
          example: EQUALS
          enum:
            - EQUALS
        value:
          $ref: '#/components/schemas/stringSchema'
    simpleMultiStringSearchOperation:
      type: object
      description: Multi-string search
      required:
        - op
        - value
      properties:
        op:
          type: string
          description: Operations that can be performed on a `string` type
          example: IN
          enum:
            - IN
        value:
          type: array
          items:
            $ref: '#/components/schemas/stringSchema'
    stringSearchOperation:
      type: object
      description: String search
      anyOf:
        - $ref: '#/components/schemas/simpleMultiStringSearchOperation'
        - $ref: '#/components/schemas/singleStringSearchOperation'
    singleStringSearchOperation:
      type: object
      description: Single string search
      required:
        - op
        - value
      properties:
        op:
          type: string
          description: Operations that can be performed on a `string` type
          example: EQUALS
          enum:
            - EQUALS
            - CONTAINS
        value:
          $ref: '#/components/schemas/stringSchema'
    booleanSearchOperation:
      type: object
      description: Boolean search
      required:
        - op
        - value
      properties:
        op:
          type: string
          description: Operations that can be performed on a `boolean` type
          example: EQUALS
          enum:
            - EQUALS
        value:
          $ref: '#/components/schemas/booleanSchema'
    localizedStringSearchOperation:
      allOf:
        - $ref: '#/components/schemas/advancedStringSearchOperation'
      type: object
      description: Search criteria based on localized data
      properties:
        locale:
          type: string
          description: >-
            If `isLocalizable` is true, searches for the requested name in the
            list of locales provided here. If `isLocalizable` is false, searches
            for the non-localized names.
          example: en_US
    idBasedProduct:
      type: object
      description: Product details by ID
      properties:
        id:
          type: string
          example: 53184766610c0e32a86d875
          description: 24-character system-generated product ID
        sku:
          $ref: '#/components/schemas/sku'
        isActive:
          type: boolean
          example: true
          description: 'true: Product is active <br /> false: Product is inactive'
        hasDraft:
          $ref: '#/components/schemas/hasDraft'
        hasLive:
          $ref: '#/components/schemas/hasLive'
        status:
          $ref: '#/components/schemas/status'
        attributes:
          type: array
          description: Attributes of a product
          items:
            $ref: '#/components/schemas/productAttributeValue'
        localizedProperties:
          $ref: '#/components/schemas/productProperties'
        variants:
          $ref: '#/components/schemas/variantProducts'
        categoryId:
          type: string
          example: 64184766610c0e32a86d8758
          description: 24-character system-generated category ID
      example:
        id: 5g7329dfd5288b00113323p7
        sku: QWERTTY56DDFFVVV
        type: ITEM
        isActive: true
        hasDraft: true
        hasLive: true
        status: LIVE
        attributes:
          - id: 227329dfd5288b0011332315
            name: Color
            type: string
            isDeleted: false
            value: blue
            isInherited: true
        localizedProperties:
          en-US:
            attributes:
              - id: 637329dfd5288b0011332354
                name: Color
                type: string
                isDeleted: false
                value: blue
                isInherited: true
          en-IN:
            attributes:
              - id: 8f7329dfd5288b0011332334
                name: Colour
                type: string
                isDeleted: false
                value: blue
                isInherited: true
        variants:
          - id: 967329dfd5288b0011332356
        categoryId: 7f7329dfd5288b0011332378
        createdAt: '2021-09-14T22:10:30.618Z'
        updatedAt: '2021-09-14T22:10:30.618Z'
    sku:
      type: string
      example: XP-123345
      description: >-
        Unique product ID that maps to fabric's standard attribute called `SKU`.
        <br /> <b>Note:</b> `sku` shouldn't include `;` or `=`
      pattern: ^[^;=]*$
    variantProducts:
      type: array
      items:
        type: object
        description: Variant details
        properties:
          id:
            type: string
            example: 64184766610c0e32a86d8758
            description: 24-character system-generated variant ID
    productAttributeValue:
      type: object
      description: Details of product attributes
      properties:
        id:
          type: string
          example: 917329dfd5288b0011332300
          description: 24-character system-generated attribute ID
        name:
          type: string
          example: color
          description: Attribute name
        type:
          type: string
          example: string
          description: Attribute type
        isDeleted:
          type: boolean
          example: false
          description: >-
            true: Attributes are inherited from parent product <br /> false:
            Attributes aren't inherited from parent product **Note**: Attributes
            are soft deleted when a product is moved from one category to
            another.
        isInherited:
          type: boolean
          example: true
          description: >-
            true: Attributes are inherited from parent product <br /> false:
            Attributes aren't inherited from parent product
        value:
          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: blue
          description: Attribute value
    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
    hasDraft:
      type: boolean
      example: true
      description: >-
        true: Product has a Draft version <br /> false: Product doesn't have a
        Draft version
    hasLive:
      type: boolean
      example: true
      description: >-
        true: Product has a Live version <br /> false: Product doesn't have a
        Live version
    status:
      type: string
      description: >-
        Represents the current status of product. This value would take
        precedence over `isActive` if both are part of the request.
      enum:
        - DRAFT
        - LIVE
      example: LIVE
    nodeName:
      type: string
      description: Category or collection name
      example: Color
    nodeId:
      type: string
      description: 24-character system-generated category or collection ID
      example: 53184766610c0e32a86d875
    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
    bulkUpdateResponse:
      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:
                    id:
                      $ref: '#/components/schemas/nodeId'
                    name:
                      $ref: '#/components/schemas/nodeName'
                    message:
                      type: array
                      items:
                        description: Error detail
                        type: string
                        example: >-
                          Error while updating attribute:
                          55184766610c0e32a86d8759
    bulkDeleteResponse:
      description: Bulk delete response
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              success:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      $ref: '#/components/schemas/nodeId'
              errors:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      $ref: '#/components/schemas/nodeId'
                    message:
                      type: array
                      items:
                        description: Error detail
                        type: string
                        example: 'Error while deleting node: 55184766610c0e32a86d8759'
    productProperties:
      type: object
      description: Localized names of attributes
      additionalProperties:
        type: object
        properties:
          attributes:
            type: array
            items:
              $ref: '#/components/schemas/productAttributeValue'
      example:
        en-US:
          attributes:
            - id: 917329dfd5288b0011332300
              name: Color
              type: string
              isDeleted: false
              value: blue
              isInherited: true
security:
  - authorization: []
