openapi: 3.0.0
"x-mint": {
    "mcp": {
      "enabled": true
    }
  }
info:
  title: Product Catalog API
  description: "Product Catalog API, a subset of fabric **Product Catalog**, is designed to improve product management. At fabric, the term Product refers to an Item, Variant, and/or Bundle. Items are stand-alone and sold individually. Variants are the different variations of an item. For example, a Laptop that comes in three different sizes (13”, 15”, 17”) and four different colors (red, blue, grey, and white) has 12 variations. Variants are nested under a parent item, allowing the different options to appear for the item on the Storefront. Bundles are collections of two or more products sold exclusively together or as individual products. Product Catalog API enables you to create items, add variants to an item, create a bundle, add items to a bundle, update product attributes, get details of one or more products, delete products, find products, and more."
  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 Product (Previously called PIM)
  url: https://developer.fabric.inc/docs/products-overview

servers:
  - url: https://api.fabric.inc/v3
    description: Production URL

tags:
  - name: Product Operations by ID
    description: "Products operations based on product IDs. You can use these endpoints to perform product operations outside of Storefront."
  - name: Product Operations by SKU
    description: Products operations based on product SKUs. Merchants are requested to map a unique product identifier against fabric standard `SKU` before using these endpoints.
  - name: General Product Operations
    description: Supports CRUD operations and product search

paths:
  /products/{id}/variants/actions/attach:
    post:
      tags:
        - Product Operations by ID
      summary: Add Variants to Products by ID
      description: "Variants are the different options of an item such as size, color, and materials. For example, there are 12 variants for a laptop that comes in three sizes (13, 15, and 17 inches) and four colors (red, blue, grey, and white). By adding variants to products, you can offer more options to shoppers. With this endpoint, you can add up to 25 variants to an existing product. **Note**: <br /> 1. At least one variant must be specified. <br /> 2. If you don't have product ID, use the corresponding SKU-based endpoint - `POST /products/sku/{sku}/variants/actions/attach`."
      operationId: attachVariantByIds
      # addVariantsbyIds
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          example: 64184766610c0e32a86d8758
          description: 24-character system-generated product ID
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
        - $ref: "#/components/parameters/statusesQueryParam"
      requestBody:
        $ref: "#/components/requestBodies/attachVariantsByIdsRequest"
      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"
        "413":
          $ref: "#/components/responses/payloadLimitExceededError"
        "500":
          $ref: "#/components/responses/internalServerError"
  /products/{id}/bundles/actions/attach:
    post:
      tags:
        - Product Operations by ID
      summary: Add Products to Bundle by ID
      description: "Creating a bundle of two or more complementary products, sold as a single package, is a widely adopted sales and marketing strategy. For example, a laptop is bundled with a carrying case and wireless mouse. This makes it convenient for shoppers to purchase them together. With this endpoint, you can add up to 25 products in a bundle that can be sold together. **Note**: <br />1. At least one product must be added. <br />2. If you don't have product ID, use the corresponding SKU-based endpoint - `POST /products/sku/{sku}/bundles/actions/attach`."
      operationId: attachProductsToBundleById
      # addProductsToBundleById
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          example: 64184766610c0e32a86d8758
          description: 24-character system-generated product ID.
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
        - $ref: "#/components/parameters/statusesQueryParam"
      requestBody:
        $ref: "#/components/requestBodies/attachProductsToBundleByIdRequest"
      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"
        "413":
          $ref: "#/components/responses/payloadLimitExceededError"
        "500":
          $ref: "#/components/responses/internalServerError"
  /products/{id}/actions/publish:
    post:
      tags:
        - Product Operations by ID
      summary: Publish Product by ID
      description: "A newly added product can be in `Published` or `Draft` status. With this endpoint, you can publish the Draft version of a product."
      operationId: publishProductByIdAndLocale
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          example: 64184766610c0e32a86d8758
          description: 24-character system-generated product ID
        - $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"
        "413":
          $ref: "#/components/responses/payloadLimitExceededError"
        "500":
          $ref: "#/components/responses/internalServerError"
  /products/{id}:
    get:
      tags:
        - Product Operations by ID
      summary: Get Product by ID
      description: "With this endpoint, you can get details of a product (item, bundle, or variant) by ID. The response includes the product's attributes and its variants. You can optionally specify `locales` to get products for specific regions. **Note**: If you don't have product ID, use the corresponding SKU-based endpoint - `GET /products/sku/{sku}`"
      operationId: getProductById
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          example: 64184766610c0e32a86d8758
          description: 24-character system-generated product ID
        - $ref: "#/components/parameters/locales"
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
        - $ref: "#/components/parameters/statusesQueryParam"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/getProductByIdResponse"
              examples:
                Product:
                  $ref: "#/components/examples/productExample"
                Variant:
                  $ref: "#/components/examples/variantExample"
                Bundle:
                  $ref: "#/components/examples/bundleExample"
          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:
        - Product Operations by ID
      summary: Update Product by ID
      description: "With this endpoint, you can update details of a single product, which could be an items, variant, or a bundles. **Note**: <br />1. When product type is `Variant`, it can be added either using SKU or ID. <br />2. When product type is `Item`, either `parentCategoryId` or `parentCategorySKU` must be specified. <br />3. When product type is Bundle, associated items or variants can also be added either using SKU or via ID. <br />4. At least one product must be specified."
      operationId: updateProduct
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          example: 64184766610c0e32a86d8758
          description: 24-character system-generated product ID
        - $ref: "#/components/parameters/locales"
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
        - $ref: "#/components/parameters/statusQueryParam"
      requestBody:
        $ref: "#/components/requestBodies/updateProductRequest"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/getProductByIdResponse"
              examples:
                Product:
                  $ref: "#/components/examples/productExample"
                Variant:
                  $ref: "#/components/examples/variantExample"
                Bundle:
                  $ref: "#/components/examples/bundleExample"
          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"
        "409":
          $ref: "#/components/responses/conflict"
        "413":
          $ref: "#/components/responses/payloadLimitExceededError"
        "500":
          $ref: "#/components/responses/internalServerError"

    delete:
      tags:
        - Product Operations by ID
      summary: Delete Product by ID
      description: "To keep the product list (catalog) up to date and current, it's important to remove products that are discontinued permanently. With this endpoint, you can delete a product (Item, Bundle, or Variant) by ID. Using `deleteVariants` as query parameter, you an optionally specify if you want to delete the associated variants as well. **Note**: If you don't have product ID, use the corresponding SKU-based endpoint - `DELETE /products/sku/{sku}`."
      operationId: deleteProductById
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          example: 64184766610c0e32a86d8758
          description: 24-character system-generated product ID
        - $ref: "#/components/parameters/deleteVariants"
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
        - $ref: "#/components/parameters/statusQueryParamWithALL"
      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"
  /products/{id}/attributes:
    put:
      tags:
        - Product Operations by ID
      summary: Update Product Attributes by ID
      description: "Product attributes are the objective and factual descriptions of products that shoppers see when they browse through an e-commerce platform. Attributes may be technical specifications like size, weight, etc., design specifications like color, material, etc., or basic specifications such as name, description, ID, etc. This endpoint is used to update product attributes, completely replacing the existing ones. **Note**: <br /> 1. This endpoint is recommended over `PATCH /products/{id}/attributes`, if the update involves replacing all the attributes. If there are any missing or null fields in the request, the original values will be replaced with empty ones. <br /> 2. If you don't have product ID, use the corresponding SKU-based endpoint - `PUT /products/sku/{sku}/attributes`."

      operationId: updateProductAttributesById
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          example: 64184766610c0e32a86d8758
          description: 24-character system-generated product ID
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
        - $ref: "#/components/parameters/statusesQueryParam"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/updateProductAttributeRequest"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/idBasedProduct"
              examples:
                Product:
                  $ref: "#/components/examples/productExample"
          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"
        "500":
          $ref: "#/components/responses/internalServerError"
    patch:
      tags:
        - Product Operations by ID
      summary: Partially Update Product Attributes by ID
      description: "Product attributes are the objective and factual descriptions of products that shoppers see when they browse through an e-commerce platform. Attributes may be technical specifications like size, weight, etc., design specifications like color, material, etc., or basic specifications such as name, description, ID, etc. With this endpoint, you can partially update attributes of a given product. **Note**: <br /> 1. This endpoint is recommended over `PUT /products/{id}/attributes` (Update product attributes by ID) if you want to update only specific attributes without affecting the others. <br /> 2. If you don't have product ID, use the corresponding SKU-based endpoint - `PATCH /products/sku/{sku}/attributes`."
      operationId: updateProductPartiallyById
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          example: 64184766610c0e32a86d8758
          description: 24-character system-generated product ID.
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
        - $ref: "#/components/parameters/statusesQueryParam"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/partialUpdateProductRequest"
            examples:
              addProductAttribute:
                summary: "Assign attribute to product"
                value:
                  data:
                    - op: "add"
                      path: "/attributes/-"
                      value: 
                        id: "6454e9e045276428de74c554"
                        value: "blue"
              replaceProductAttributeValue:
                summary: "Update attribute value assigned to product"
                value:
                  data:
                    - op: "replace"
                      path: "/attributes/0/value"
                      value: "red"
              removeProductAttribute:
                summary: "Remove attribute assigned to product"
                value:
                  data:
                    - op: "remove"
                      path: "/attributes/0"

      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/idBasedProduct"
              examples:
                Product:
                  $ref: "#/components/examples/productExample"
          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"
        "500":
          $ref: "#/components/responses/internalServerError"
  /products/{id}/variants:
    get:
      tags:
        - Product Operations by ID
      summary: Get Product Variants by ID
      description: "Variants are different options of an item such as size, color, and materials. For example, there are 12 variants for a laptop that comes in three sizes (13, 15, and 17 inches) and four colors (red, blue, grey, and white). By adding variants to products, you can offer more options to shoppers . **Note**: <br /> 1. At least one variant must be specified. <br /> 2. If you don't have product ID, use the corresponding SKU-based endpoint - `GET /products/sku/{sku}/variants`.<br /> 3. The `status` parameter is applicable to the `id` passed in path parameter and not for the variants. That is, the variants returned as part of the response are either the variants attached to the Live or Draft version of the product based on the `status` parameter."
      operationId: getProductVariantsById
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          example: 64184766610c0e32a86d8758
          description: 24-character system-generated product ID.
        - $ref: "#/components/parameters/offset"
        - $ref: "#/components/parameters/limit"
        - $ref: "#/components/parameters/locales"
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
        - $ref: "#/components/parameters/statusesQueryParam"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/getVariantByIdsResponse"
              examples:
                Variant:
                  $ref: "#/components/examples/variantListExample"
          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"
  /products/{id}/variants/actions/detach:
    post:
      tags:
        - Product Operations by ID
      summary: Remove Product Variants by ID
      description: "When one or more variants of a product are discontinued or no longer required, you don't want them to appear as options for the product. This endpoint provides the flexibility to remove up to 25 variants by ID and manage options efficiently. **Note**: <br /> 1. Variants are only detached from the given product, not deleted. They can be reattached to the same or another product at a later point. <br />2. At least one variant must be specified. <br /> 3. If you don't have product ID, use the corresponding SKU-based endpoint - `POST /products/sku/{sku}/variants/actions/detach`."
      operationId: detachVariantByIds
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          example: 64184766610c0e32a86d8758
          description: 24-character system-generated product ID.
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
        - $ref: "#/components/parameters/statusesQueryParam"
      requestBody:
        $ref: "#/components/requestBodies/detachVariantsByIdsRequest"
      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"
        "413":
          $ref: "#/components/responses/payloadLimitExceededError"
        "500":
          $ref: "#/components/responses/internalServerError"
  /products/{id}/bundles:
    get:
      tags:
        - Product Operations by ID
      summary: Get Products in a Bundle by ID
      description: "Bundle is a collection of products that are sold together as a single package. For example, a laptop is bundled with a carrying case and a wireless mouse to be sold as a package. This endpoint gets a paginated list of products by ID.  **Note**: <br />1. You can refine the results by specifying `offset` and `limit` values. When they're not specified, by default, you'll get up to 10 products. <br /> 2. If you don't have product ID, use the corresponding SKU-based endpoint - `GET /products/sku/{sku}/bundles`. <br /> 3. The `status` parameter is applicable to the `id` passed in path parameter and not for bundles. That is, bundles returned as part of the response are either the bundles attached to the Live or Draft version of the product based on the `status` parameter."
      operationId: getProductBundlesById
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          example: 64184766610c0e32a86d8758
          description: 24-character system-generated product ID
        - $ref: "#/components/parameters/offset"
        - $ref: "#/components/parameters/limit"
        - $ref: "#/components/parameters/locales"
          # not necessary and hence deprecated
        - $ref: "#/components/parameters/productType"
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
        - $ref: "#/components/parameters/statusesQueryParam"
      responses:
        "200":
          description: OK
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/x-fabric-request-id-header"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/getBundleByIdsResponse"
              examples:
                Bundle:
                  $ref: "#/components/examples/itemsListForBundlesExample"

        "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"

  /products/{id}/bundles/actions/detach:
    post:
      tags:
        - Product Operations by ID
      summary: Remove Products from a Bundle by ID
      description: "When one or more products in a bundle are discontinued or no longer required, you don't want them to appear in the bundle. With this endpoint, you can remove up to 25 products by ID. **Note** <br /> 1. Products are only detached from the given product, not deleted. They can be added to the same or another product, at a later point. <br />2. At least one product must be specified. <br /> 3. If you don't have product ID, use the corresponding SKU-based endpoint - `POST /products/sku/{sku}/bundles/actions/detach`."
      operationId: detachProductsFromBundlesByIds
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          example: 64184766610c0e32a86d8758
          description: 24-character system-generated product ID
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
        - $ref: "#/components/parameters/statusesQueryParam"
      requestBody:
        $ref: "#/components/requestBodies/detachProductsFromBundleByIdRequest"
      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"
        "413":
          $ref: "#/components/responses/payloadLimitExceededError"
        "500":
          $ref: "#/components/responses/internalServerError"

  /products/{id}/actions/unpublish:
    post:
      tags:
        - Product Operations by ID
      summary: Unpublish Product by ID
      description: "Due to changes in market, you may have to remove a product from being live. With this endpoint, you can unpublish product."
      operationId: unPublishProductByIdAndLocale
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          example: 64184766610c0e32a86d8758
          description: 24-character system-generated product ID
        - $ref: "#/components/parameters/overrideDraft"
        - $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"
        "413":
          $ref: "#/components/responses/payloadLimitExceededError"
        "500":
          $ref: "#/components/responses/internalServerError"

  /products/{id}/actions/change-category:
    post:
      tags:
        - Product Operations by ID
      summary: Change Product Category
      description: "This endpoint lets you change a product from one category to another. When managing a large number of products, this endpoint gives you the flexibility to organize products easily."
      operationId: changeCategoryByProductId.
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
          example: 64184766610c0e32a86d8758
          description: 24-character system-generated product ID.
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
        - $ref: "#/components/parameters/statusesQueryParam"
      requestBody:
        $ref: "#/components/requestBodies/changeCategoryByProductIdRequest"
      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"
        "413":
          $ref: "#/components/responses/payloadLimitExceededError"
        "500":
          $ref: "#/components/responses/internalServerError"

  /products/sku/{sku}/variants/actions/attach:
    post:
      tags:
        - Product Operations by SKU
      summary: Add Variants to Products by SKU
      description: "Variants are the different options of an item such as size, color, and materials. For example, there are 12 variants for a laptop that comes in three sizes (13, 15, and 17 inches) and four colors (red, blue, grey, and white). By adding variants to products, you can offer more options to shoppers. With this endpoint, you can add up to 25 variants to an existing product **Note**: <br /> 1. At least one variant must be specified. <br /> 2. If you don't have product ID, use the corresponding ID-based endpoint - `POST /products/{id}/variants/actions/attach`."
      operationId: attachVariantBySkus
      # addVariantBySkus
      parameters:
        - in: path
          name: sku
          schema:
            type: string
          required: true
          example: CAXCC12
          description: Product SKU
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
        - $ref: "#/components/parameters/statusesQueryParam"
      requestBody:
        $ref: "#/components/requestBodies/attachVariantsBySkusRequest"
      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"
        "413":
          $ref: "#/components/responses/payloadLimitExceededError"
        "500":
          $ref: "#/components/responses/internalServerError"

  /products/sku/{sku}/bundles/actions/attach:
    post:
      tags:
        - Product Operations by SKU
      summary: Add Products to Bundle by SKU
      description: "Creating a bundle of two or more complementary products, sold as a single package, is a widely adopted sales and marketing strategy. For example, a laptop is bundled with a carrying case and wireless mouse. This makes it convenient for shoppers to purchase them together. With this endpoint, you can add up to 25 products in a bundle that can be sold together. **Note**: <br />1. At least one product must be added. <br />2. If you don't have product `sku`, use the corresponding ID-based endpoint - `POST /products/{id}/bundles/actions/attach`."
      operationId: attachProductsToBundleBySku
      # addProductsToBundleBySku
      parameters:
        - in: path
          name: sku
          schema:
            type: string
          required: true
          example: CAXCC1234
          description: Product SKU
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
        - $ref: "#/components/parameters/statusesQueryParam"
      requestBody:
        $ref: "#/components/requestBodies/attachProductsToBundleBySkuRequest"
      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"
        "413":
          $ref: "#/components/responses/payloadLimitExceededError"
        "500":
          $ref: "#/components/responses/internalServerError"

  /products/sku:
    get:
      tags:
        - Product Operations by SKU
      summary: Get Products by SKUs
      description: "Get a paginated list of product (Item, Bundle, or Variant) by SKU, including the attributes and variants. You can optionally specify `locales` to get products for specific regions.  **Note**: <br />1. You can refine the results by specifying `offset` and `limit` values. If you don't specify them, by default, you'll get up to 10 products. <br /> 2. If you don't have product SKU, use the corresponding ID-based endpoint - `GET /products/{id}`."
      operationId: getProductsBySkus
      parameters:
        - $ref: "#/components/parameters/skusQueryParameter"
        - $ref: "#/components/parameters/limit"
        - $ref: "#/components/parameters/offset"
        - $ref: "#/components/parameters/productType"
        - $ref: "#/components/parameters/locales"
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
        - $ref: "#/components/parameters/statusesQueryParam"
        - $ref: "#/components/parameters/productTypes"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/getProductsBySkusResponse"
              examples:
                Product:
                  $ref: "#/components/examples/productSKUListExample"
                Variant:
                  $ref: "#/components/examples/variantSKUListExample"
                Bundle:
                  $ref: "#/components/examples/bundleSKUListExample"
          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:
        - Product Operations by SKU
      summary: Update Product SKUs
      description: "You may need to update the SKUs of one or more products if the products have undergone significant improvements, and you need a way to differentiate between the updated version and the previous one. Or, you may want to address a typographical error or inconsistencies in the SKU naming conventions. This endpoint updates SKUs for up to 25 products. **Note**: Unless all SKUs are updated, the endpoint will fail."
      operationId: updateProductSkus
      parameters:
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
        - $ref: "#/components/parameters/statusesQueryParam"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/updateProductSkusRequest"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/productSkuBulkUpdateResponse"
          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"

  /products/sku/{sku}:
    get:
      tags:
        - Product Operations by SKU
      summary: Get Product by SKU
      description: "You may want to periodically review details of a product to ensure they're correct. This endpoint gets details of a product (item, bundle, or variant) by SKU. The response includes products attributes and its variants. You can optionally specify `locales` to get products for specific regions.  **Note**: If you don't have product SKU, use the corresponding ID-based endpoint - `GET /products/{id}`."
      operationId: getProductBySku
      parameters:
        - in: path
          name: sku
          schema:
            type: string
          required: true
          example: CAXCC1234
          description: Product SKU
        - $ref: "#/components/parameters/locales"
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
        - $ref: "#/components/parameters/statusesQueryParam"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/getProductBySkuResponse"
              examples:
                Product:
                  $ref: "#/components/examples/productSKUExample"
                Variant:
                  $ref: "#/components/examples/variantSKUExample"
                Bundle:
                  $ref: "#/components/examples/bundleSKUExample"
          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:
        - Product Operations by SKU
      summary: Delete Product by SKU
      description: "To keep the product list (catalog) up to date and current, it's important to remove products that are discontinued permanently. With this endpoint, you can delete a product (Item, Bundle, or Variant) by SKU. Using `deleteVariants` as query parameter, you an optionally specify if you want to delete the associated variants as well. **Note**: If you don't have product SKU, use the corresponding ID-based endpoint - `DELETE /products/{id}`."
      operationId: deleteProductBySku
      parameters:
        - in: path
          name: sku
          schema:
            type: string
          required: true
          example: CAXCC1234A
          description: Product SKU
        - $ref: "#/components/parameters/deleteVariants"
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
        - $ref: "#/components/parameters/statusQueryParamWithALL"
      responses:
        "204":
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/x-fabric-request-id-header"
          description: No Content
        "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"

  /products/sku/{sku}/attributes:
    put:
      tags:
        - Product Operations by SKU
      summary: Update Product Attributes by SKU
      description: "Product attributes are the objective and factual descriptions of products that shoppers see when they browse through an e-commerce platform. Attributes may be technical specifications like size, weight, etc., design specifications like color, material, etc., or basic specifications such as name, description, ID, etc. This endpoint is used to update product attributes, completely replacing the existing ones. **Note**: <br /> 1. This is recommended over `PATCH /products/sku/{sku}/attributes`, if the update involves replacing all the attributes. If there are any missing or null fields in the request, the original values will be replaced with empty ones. <br /> 2. If you don't have product SKU, use the corresponding ID-based endpoint - `PUT /products/{id}/attributes`."
      operationId: updateProductBySku
      parameters:
        - in: path
          name: sku
          schema:
            type: string
          required: true
          example: CAXCC1234
          description: Product SKU
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
        - $ref: "#/components/parameters/statusesQueryParam"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/updateProductAttributeRequest"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/skuBasedProduct"
              examples:
                Product:
                  $ref: "#/components/examples/productSKUExample"
          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"
        "500":
          $ref: "#/components/responses/internalServerError"

    patch:
      tags:
        - Product Operations by SKU
      summary: Partially Update Product by SKU
      description: "Product attributes are the objective and factual descriptions of products that shoppers see when they browse through an e-commerce platform. Attributes may be technical specifications like size, weight, etc., design specifications like color, material, etc., or basic specifications such as name, description, ID, etc. This endpoint is used to partially update attributes of the given product attributes. **Note**: <br /> 1. This endpoint is recommended over `PUT /products/sku/{sku}/attributes` (Update product attributes by SKU) if you want to update only specific attributes without affecting the others. <br />2. If you don't have product SKU, use the corresponding ID-based endpoint - `PATCH /products/{id}/attributes`."
      operationId: updateProductPartiallyBySku
      parameters:
        - in: path
          name: sku
          schema:
            type: string
          required: true
          example: CAXCC1234
          description: Product SKU
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
        - $ref: "#/components/parameters/statusesQueryParam"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/partialUpdateProductRequest"
            examples:
              addProductAttribute:
                summary: "Assign attribute to product"
                value:
                  data:
                    - op: "add"
                      path: "/attributes/-"
                      value: 
                        id: "6454e9e045276428de74c554"
                        value: "blue"
              replaceProductAttributeValue:
                summary: "Update attribute value assigned to product"
                value:
                  data:
                    - op: "replace"
                      path: "/attributes/0/value"
                      value: "red"
              removeProductAttribute:
                summary: "Remove attribute assigned to product"
                value:
                  data:
                    - op: "remove"
                      path: "/attributes/0"

      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/skuBasedProduct"
              examples:
                Product:
                  $ref: "#/components/examples/productSKUExample"
          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"
        "500":
          $ref: "#/components/responses/internalServerError"

  /products/sku/{sku}/variants:
    get:
      tags:
        - Product Operations by SKU
      summary: Get Product Variants by SKU
      description: "Variants are different options of an item such as size, color, and materials. For example, there are 12 variants for a laptop that comes in three sizes (13, 15, and 17 inches) and four colors (red, blue, grey, and white). By adding variants to products, you can offer more options to shoppers **Note**: <br /> 1. At least one variant must be specified. <br /> 2. If you don't have product ID, use the corresponding  ID-based endpoint - `/products/{id}/variants`. <br /> 3. The `status` parameter is applicable to the `id` passed in path parameter and not for variants. That is, the variants returned as part of the response are the variants attached to either the Live or Draft version of the product based on the `status` parameter."
      operationId: getProductVariantsBySku
      parameters:
        - in: path
          name: sku
          schema:
            type: string
          required: true
          example: CAXCC1234A
          description: Product SKU
        - $ref: "#/components/parameters/limit"
        - $ref: "#/components/parameters/offset"
        - $ref: "#/components/parameters/locales"
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
        - $ref: "#/components/parameters/statusesQueryParam"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/getVariantBySKUsResponse"
              examples:
                Variant:
                  $ref: "#/components/examples/variantSKUListExample"
          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"

  /products/sku/{sku}/variants/actions/detach:
    post:
      tags:
        - Product Operations by SKU
      summary: Remove Product Variants by SKU
      description: "When one or more variants of a product are discontinued or no longer required, you don't want them to appear as options. This endpoint provides the flexibility to remove up to 25 variants by SKU and manage product options, efficiently. **Note**: <br /> 1. Variants are only detached from the given product, not deleted. They can be reattached to the same or another product, at a later point. <br />2. At least one variant must be specified. <br /> 3. If you don't have product SKU, use the corresponding ID-based endpoint - `POST /products/{id}/variants/actions/detach`."
      operationId: detachVariantBySkus
      parameters:
        - in: path
          name: sku
          schema:
            type: string
          required: true
          example: CAXCC1234
          description: Product SKU
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
        - $ref: "#/components/parameters/statusesQueryParam"
      requestBody:
        $ref: "#/components/requestBodies/detachVariantsBySkusRequest"
      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"
        "413":
          $ref: "#/components/responses/payloadLimitExceededError"
        "500":
          $ref: "#/components/responses/internalServerError"

  /products/sku/{sku}/bundles:
    get:
      tags:
        - Product Operations by SKU
      summary: Get Products in a Bundle by SKU
      description: "Bundle is a collection of products that are sold together as a single package. For example, a laptop is bundled with a carrying case and a wireless mouse to be sold as a package. This endpoint gets a paginated list of products by ID.  **Note**: <br />1. You can refine the results by specifying `offset` and `limit` values. When they're not specified, by default, you'll get up to 10 products. <br /> 2. If you don't have product SKU, use the corresponding ID-based endpoint - `GET /products/{id}/bundles`.<br /> 3. The `status` parameter is applicable to the `id` passed as path parameter and not for bundles. That is, the bundles returned in the response are the bundles attached to either the Live or Draft version of the product based on the `status` parameter."
      operationId: getProductBundlesBySku
      parameters:
        - in: path
          name: sku
          schema:
            type: string
          required: true
          example: CAXCC1234
          description: Product SKU
        - $ref: "#/components/parameters/offset"
        - $ref: "#/components/parameters/limit"
        - $ref: "#/components/parameters/locales"
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
        - $ref: "#/components/parameters/statusesQueryParam"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/getBundleBySKUsResponse"
              examples:
                Bundle:
                  $ref: "#/components/examples/itemsSKUListForBundlesExample"
          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"

  /products/sku/{sku}/bundles/actions/detach:
    post:
      tags:
        - Product Operations by SKU
      summary: Remove Products from a Bundle by SKU
      description: "When one or more products in a bundle are discontinued or no longer required, you don't want them to appear in the bundle. With this endpoint, you can remove up to 25 products by SKU. **Note** <br /> 1. Products are only detached from the given product, not deleted. They can be added to the same or another product, at a later point. <br />2. At least one product must be specified. <br /> 3. If you don't have product ID, use the corresponding SKU-based endpoint - `POST /products/{id}/bundles/actions/detach`."
      operationId: detachProductsFromBundlesBySkus
      parameters:
        - in: path
          name: sku
          schema:
            type: string
          required: true
          example: CAXCC1234
          description: Product SKU
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
        - $ref: "#/components/parameters/statusesQueryParam"
      requestBody:
        $ref: "#/components/requestBodies/detachProductsFromBundleBySkuRequest"
      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"
        "413":
          $ref: "#/components/responses/payloadLimitExceededError"
        "500":
          $ref: "#/components/responses/internalServerError"
  /products/sku/{sku}/actions/unpublish:
    post:
      tags:
        - Product Operations by SKU
      summary: Unpublish Product by SKU
      description: "Due to changes in market, you may have to remove a product from being live. With this endpoint, you can unpublish a product by specifying `sku`."
      operationId: unpublishProductBySKUAndLocale
      parameters:
        - in: path
          name: sku
          schema:
            type: string
          required: true
          example: CAX-CC1234
          description: Product SKU
        - $ref: "#/components/parameters/overrideDraft"
        - $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"
        "413":
          $ref: "#/components/responses/payloadLimitExceededError"
        "500":
          $ref: "#/components/responses/internalServerError"
  /products/sku/{sku}/actions/publish:
    post:
      tags:
        - Product Operations by SKU
      summary: Publish Product by SKU
      description: "A newly added product can be in `Published` or `Draft` status. With this endpoint, by specifying `sku`, you can publish a product in Draft status."
      operationId: publishProductBySKUAndLocale
      parameters:
        - $ref: "#/components/parameters/skuPathParameter"
        - $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"
        "413":
          $ref: "#/components/responses/payloadLimitExceededError"
        "500":
          $ref: "#/components/responses/internalServerError"

  /products/sku/{sku}/collections:
    get:
      tags:
        - Product Operations by SKU
      summary: Get collections that the SKU belongs to.
      description: "On your Storefront products are organized or grouped in logical groups called Collections. The main purpose of Collection is distribution management by displaying products on your website based on separate browsing structures required to achieve specific merchandising objectives, such as organizational requirements, multi-regional assortments, multi-channel assortments, and collections.<br>This endpoint gets the collection details of a product by SKU"
      operationId: getProductCollectionsBySku
      parameters:
        - $ref: "#/components/parameters/skuPathParameter"
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
        - $ref: "#/components/parameters/statusesQueryParam"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/getCollectionsBySKUResponse"
          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"
        "500":
          $ref: "#/components/responses/internalServerError"

  /products/batch:
    post:
      tags:
        - General Product Operations
      summary: Add Products
      description: >-
        At fabric, the term products refers to items, variants, and/or bundles.
         With this endpoint, you can add up to 25 products. Refer to the
        examples added for each type. **Note**:<br /> 1. If product type is
        Variant, they can be added using either SKU or ID.<br />2. When
        product type is Item, either `parentCategoryId` or `parentCategorySKU`
        must be specified.<br />3. When product `type` is Bundle, items in a
        bundle can be added using either SKU or ID. <br />4. In the response you
        can see the products that are added successfully and the ones that couldn't
        be added.
      operationId: createProducts
      parameters:
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
      requestBody:
        $ref: "#/components/requestBodies/insertProductsRequest"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/upsertProductsResponse"
          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"

  /products:
    post:
      tags:
        - Product Operations by ID
      summary: Add Product
      description: "At fabric, the term products refers to items, variants, and/or bundles."
      operationId: createProduct
      parameters:
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
      requestBody:
        $ref: "#/components/requestBodies/insertProductRequest"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/getProductByIdResponse"
              examples:
                Product:
                  $ref: "#/components/examples/productExample"
                Variant:
                  $ref: "#/components/examples/variantExample"
                Bundle:
                  $ref: "#/components/examples/bundleExample"
          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"

    get:
      tags:
        - General Product Operations
      summary: Get Product List
      description: "You may have to review products to review or analyze them or create certain reports. This endpoint gets a paginated list of products (items, variants, and bundles) for the specified `locales`. **Note**: Specify product IDs to get only those products. Or, you may mention `offset` and `limit` to refine the search results. When they're not specified, by default, you'll get up to 10 products."
      operationId: getProductsByIds
      parameters:
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
        - $ref: "#/components/parameters/ids"
        - $ref: "#/components/parameters/limit"
        - $ref: "#/components/parameters/offset"
        - $ref: "#/components/parameters/productType"
        - $ref: "#/components/parameters/locales"
        - $ref: "#/components/parameters/statusesQueryParam"
        - $ref: "#/components/parameters/sortBy"
        - $ref: "#/components/parameters/productTypes"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/getProductsByIdsResponse"
              examples:
                Product:
                  $ref: "#/components/examples/productListExample"
                Variant:
                  $ref: "#/components/examples/variantListExample"
                Bundle:
                  $ref: "#/components/examples/bundleListExample"
          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:
        - General Product Operations
      summary: Update Multiple Products
      description:
        "With this endpoint, you can update details of multiple products, which
        could be items, variants, and bundles. **Note**: <br />1. When product
        type is `Variant`, it can be added either via SKU or ID. <br />2.  When
        product type is `Item`, either the `parentCategoryId` or
        `parentCategorySKU` must be specified. <br />3. When product type is
        `Bundle`, the associated items or variants can be added either via SKU
        or via ID. <br />4. At least one product must be specified."
      operationId: updateProducts
      parameters:
        - in: query
          name: locales
          schema:
            type: string
            example: fr-CA%2Cen-US
          description: "Comma-separated locale codes of product. The service throws a 400 error if the locale isn't supported. Standard locales can be found at https://www.rfc-editor.org/rfc/rfc5646. <br /> **Note**: The recommended way to get the locale is by invoking multi-channel service."
          required: false
          deprecated: true
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
        - $ref: "#/components/parameters/statusQueryParam"
      requestBody:
        $ref: "#/components/requestBodies/updateProductsRequest"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/upsertProductsResponse"
          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"

    delete:
      tags:
        - General Product Operations
      summary: Delete Multiple Products
      description: "To keep the product list (catalog) up to date and current, it's important to remove products that are discontinued permanently. With this endpoint, you can delete up to 25 products either by SKUs or IDs. **Note**: <br />1. Unless all products are deleted, this endpoint fails. <br /> 2. To delete a single product, you can use either the ID-based (`DELETE /products/{id}`) or SKU-based endpoint (`DELETE /products/sku/{sku}`)."
      operationId: deleteProducts
      parameters:
        - $ref: "#/components/parameters/locales"
        - $ref: "#/components/parameters/skusQueryParameter"
        - $ref: "#/components/parameters/deleteVariants"
        - $ref: "#/components/parameters/ids"
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
        - $ref: "#/components/parameters/statusQueryParamWithALL"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/deleteProductsResponse"
          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"

  /products/search:
    post:
      tags:
        - General Product Operations
      summary: Find Products
      description: "To find specific products for review or reports, you need to specify the criteria for the search. With this endpoint, you can find products (items, variants, and bundles) based on ID or SKU, type, category, and other criteria."
      operationId: getProductsBySearchCriteria
      # to discuss with developer getProductsBySearch
      parameters:
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
      requestBody:
        $ref: "#/components/requestBodies/productSearchRequest"
      responses:
        "200":
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/x-fabric-request-id-header"
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/getProductsByIdsResponse"
              examples:
                Product:
                  $ref: "#/components/examples/productListExample"
                Variant:
                  $ref: "#/components/examples/variantListExample"
                Bundle:
                  $ref: "#/components/examples/bundleListExample"

        "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"

  /products/find:
    post:
      tags:
        - General Product Operations
      summary: Find Products
      description: "To find specific products for review or reports, you need to specify the criteria for the search. With this endpoint, you can find products (items, variants, and bundles) based on ID or SKU, type, category, and other criteria."
      operationId: getProductsBySearchCriteriaAtlas
      # to discuss with developer getProductsBySearch
      parameters:
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
      requestBody:
        $ref: "#/components/requestBodies/productSearchRequest"
      responses:
        "200":
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/x-fabric-request-id-header"
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/getProductsByIdsResponse"
              examples:
                Product:
                  $ref: "#/components/examples/productListExample"
                Variant:
                  $ref: "#/components/examples/variantListExample"
                Bundle:
                  $ref: "#/components/examples/bundleListExample"

        "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"

  /products/actions/change-category:
    post:
      tags:
        - General Product Operations
      summary: Reassign Products to a Different Category Synchronously
      description: "To enhance product visibility or improve product organization, you may want to reassign products to a different category. With this endpoint, you can synchronously reassign up to 25 products to a different category. The response will show a list of successful and unsuccessful reassignments"
      operationId: changeCategoryByIds
      parameters:
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
        - $ref: "#/components/parameters/statusQueryParam"
      requestBody:
        $ref: "#/components/requestBodies/changeCategoryByProductIdsRequest"
      responses:
        "200":
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/x-fabric-request-id-header"
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/changeProductCategoryResponse"
        "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"

  /products/actions/filter-change-category:
    post:
      tags:
        - General Product Operations
      summary: Bulk Reassign Products to a Different Category Using Filter Conditions
      description: To enhance product visibility or improve product organization, you may want to reassign products to a different category. With this endpoint, you can asynchronously reassign products to a different category. Instead of waiting for results through the API response, you'll gets notified via email whether the products were successfully reassigned.
      operationId: changeCategoryByFilters
      parameters:
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
      requestBody:
        $ref: "#/components/requestBodies/productChangeCategoryFilterRequest"
      responses:
        "200":
          headers:
            x-fabric-request-id:
              $ref: "#/components/headers/x-fabric-request-id-header"
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/jobIdResponse"
        "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"

  /products/actions/publish:
    post:
      tags:
        - General Product Operations
      summary: Publish up to 25 Products at Once
      description: "Publish up to 25 products at once."
      operationId: publishProducts
      parameters:
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
      requestBody:
        $ref: "#/components/requestBodies/bulkPublishOrUnPublishProductRequest"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/genericPublishResponse"
          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"
        "500":
          $ref: "#/components/responses/internalServerError"

  /products/actions/unpublish:
    post:
      tags:
        - General Product Operations
      summary: Unpublish up to 25 Products at Once
      description: Unpublish up to 25 products at once.
      operationId: UnPublishProducts
      parameters:
        - $ref: "#/components/parameters/overrideDraft"
        - $ref: "#/components/parameters/x-fabric-tenant-id"
        - $ref: "#/components/parameters/x-fabric-request-id"
      requestBody:
        $ref: "#/components/requestBodies/bulkPublishOrUnPublishProductRequest"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/genericPublishResponse"
          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"
        "500":
          $ref: "#/components/responses/internalServerError"
components:
  # Headers
  securitySchemes:
    authorization:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: S2S access token (JWT) from fabric Identity service (during Login)

  requestBodies:
    bulkPublishOrUnPublishProductRequest:
      content:
        application/json:
          schema:
            anyOf:
              - $ref: "#/components/schemas/arrayProductIdObjects"
              - $ref: "#/components/schemas/arraySKUObjects"
    updateProductRequest:
      content:
        application/json:
          schema:
            required:
              - sku
              - categoryId
              - type
            type: object
            additionalProperties: false
            allOf:
              - $ref: "#/components/schemas/insertProductsRequestBody"
              - type: object
                properties:
                  variants:
                    anyOf:
                      - $ref: "#/components/schemas/variantProducts"
                      - $ref: "#/components/schemas/variantProductSKU"
                  localizedProperties:
                    $ref: "#/components/schemas/localizedPropertiesUpdateRequest"

    updateProductsRequest:
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            required:
              - products
            properties:
              products:
                type: array
                minItems: 1
                items:
                  type: object
                  required:
                    - sku
                    - categoryId
                    - type
                    - id
                  allOf:
                    - $ref: "#/components/schemas/insertProductsRequestBody"
                  properties:
                    id:
                      $ref: "#/components/schemas/productId"
                    variants:
                      anyOf:
                        - $ref: "#/components/schemas/variantProducts"
                        - $ref: "#/components/schemas/variantProductSKU"
                    localizedProperties:
                      $ref: "#/components/schemas/localizedPropertiesUpdateRequest"

    insertProductRequest:
      content:
        application/json:
          schema:
            required:
              - sku
              - categoryId
              - type
              - status
            type: object
            additionalProperties: false
            allOf:
              - $ref: "#/components/schemas/insertProductsRequestBody"
              - type: object
                properties:
                  status:
                    $ref: "#/components/schemas/status"
                  localizedProperties:
                    $ref: "#/components/schemas/localizedPropertiesCreateRequest"

    insertProductsRequest:
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            required:
              - products
            properties:
              products:
                type: array
                minItems: 1
                items:
                  type: object
                  required:
                    - sku
                    - categoryId
                    - type
                    - status
                  allOf:
                    - $ref: "#/components/schemas/insertProductsRequestBody"
                  properties:
                    status:
                      $ref: "#/components/schemas/status"
                    localizedProperties:
                      $ref: "#/components/schemas/localizedPropertiesCreateRequest"

          examples:
            Item:
              $ref: "#/components/examples/productUpsertRequestBody"
            VariantWithId:
              $ref: "#/components/examples/variantUpsertRequestBodyWithIDExample"
            VariantWithSKU:
              $ref: "#/components/examples/variantUpsertRequestBodyWithSKUExample"
            BundleWithId:
              $ref: "#/components/examples/bundleUpsertRequestBodyWithIDExample"
            BundleWithSKU:
              $ref: "#/components/examples/bundleUpsertRequestBodyWithSKUExample"

    attachVariantsByIdsRequest:
      content:
        application/json:
          schema:
            type: object
            required:
              - variants
            additionalProperties: false
            properties:
              variants:
                $ref: "#/components/schemas/variantProducts"

    attachVariantsBySkusRequest:
      content:
        application/json:
          schema:
            type: object
            required:
              - variants
            additionalProperties: false
            properties:
              variants:
                $ref: "#/components/schemas/variantSKUProducts"

    detachVariantsByIdsRequest:
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            required:
              - variants
            properties:
              variants:
                $ref: "#/components/schemas/variantProducts"

    detachVariantsBySkusRequest:
      content:
        application/json:
          schema:
            type: object
            required:
              - variants
            additionalProperties: false
            properties:
              variants:
                $ref: "#/components/schemas/variantSKUProducts"

    attachProductsToBundleByIdRequest:
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            required:
              - products
            properties:
              products:
                type: array
                minItems: 1
                items:
                  type: object
                  required:
                    - id
                    - quantity
                  properties:
                    id:
                      $ref: "#/components/schemas/productId"
                    quantity:
                      type: integer
                      format: int32
                      example: 2
                      description: Number of products

    attachProductsToBundleBySkuRequest:
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            required:
              - products
            properties:
              products:
                type: array
                minItems: 1
                items:
                  type: object
                  required:
                    - sku
                    - quantity
                  properties:
                    sku:
                      type: string
                      example: AAVVDD12345
                      description: Product SKU
                    quantity:
                      type: integer
                      format: int32
                      example: 2
                      description: Total number of the given product

    detachProductsFromBundleByIdRequest:
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            required:
              - products
            properties:
              products:
                type: array
                minItems: 1
                items:
                  type: object
                  required:
                    - id
                  properties:
                    id:
                      $ref: "#/components/schemas/productId"

    changeCategoryByProductIdsRequest:
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            properties:
              products:
                type: array
                minItems: 1
                items:
                  type: object
                  properties:
                    id:
                      $ref: "#/components/schemas/productId"
              targetCategoryId:
                type: string
                description: 24-character system-generated category ID
                example: AACCVVV1234567

    changeCategoryByProductIdRequest:
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            required:
              - targetCategoryId
            properties:
              targetCategoryId:
                $ref: "#/components/schemas/targetCategoryId"

    detachProductsFromBundleBySkuRequest:
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            required:
              - products
            properties:
              products:
                type: array
                minItems: 1
                items:
                  type: object
                  required:
                    - sku
                  properties:
                    sku:
                      type: string
                      example: AAVVDD123456
                      description: Product SKU

    productChangeCategoryFilterRequest:
      content:
        application/json:
          schema:
            required:
              - targetCategoryId
              - match
            type: object
            properties:
              targetCategoryId:
                $ref: "#/components/schemas/targetCategoryId"
              match:
                $ref: "#/components/schemas/productSearchRequestMatch"

    productSearchRequest:
      content:
        application/json:
          schema:
            type: object
            required:
              - match
            properties:
              #              sort:
              #                type: array
              #                description: Sorting specification for products
              #                items:
              #                  type: object
              #                  description: Individual fields to sort on.
              #                  properties:
              #                    sortBy:
              #                      $ref: "#/components/schemas/productSort"
              #                    direction:
              #                      $ref: "#/components/schemas/sortDirection"
              sort:
                type: string
                description: "Sorting criteria. Sorting is supported only on `sku`, `type` and `createdAt`. `-` refers to descending while `+` refers to ascending order"
                example: "+sku,-name"
              match:
                $ref: "#/components/schemas/productSearchRequestMatch"
              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

  responses:
    notAuthorized:
      description: Request is unauthorized
      headers:
        x-fabric-request-id:
          $ref: "#/components/headers/x-fabric-request-id-header"
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/genericError"
          example:
            type: UNAUTHORIZED_ERROR
            message: The requester is unauthorized

    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"

    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"

    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

    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:
            message: Internal Server Error
            type: 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: Payload exceeds maximum configured size

  examples:
    productUpsertRequestBody:
      value:
        products:
          - sku: QWERTTY56DDFFVVV
            type: ITEM
            status: LIVE
            categoryId: 5e7329dfd5288b0011332377
            attributes:
              - id: 2f7329dfd5288b0011332317
                value: blue
            localizedProperties:
              en-US:
                attributes:
                  - id: 5g7329dfd5288b0011332313
                    value: blue
              en-IN:
                attributes:
                  - id: 3d7329dfd5288b0011332314
                    value: blue

    variantUpsertRequestBodyWithIDExample:
      value:
        products:
          - sku: QWERTTY56DDFFVVV
            type: VARIANT
            status: LIVE
            categoryId: 9f7329dfd5288b0011332313
            attributes:
              - id: 8d7329dfd5288b0011332317
                value: blue
            localizedProperties:
              en-US:
                attributes:
                  - id: 887329dfd5288b0011332318
                    value: blue
              en-IN:
                attributes:
                  - id: 6d7329dfd5288b0011332318
                    value: blue
            parentProduct:
              id: 547329dfd5288b0011332311

    variantUpsertRequestBodyWithSKUExample:
      value:
        products:
          - sku: QWERDFFVVV
            type: VARIANT
            status: LIVE
            categoryId: 6d7329dfd5288b0011332377
            attributes:
              - id: 5e7329dfd5288b0011332355
                value: blue
            localizedProperties:
              en-US:
                attributes:
                  - id: 6e7329dfd5288b0011332322
                    value: blue
              en-IN:
                attributes:
                  - id: 6f7329dfd5288b0011332311
                    value: blue
            parentProduct:
              sku: AAVVCDDD123456

    bundleUpsertRequestBodyWithIDExample:
      value:
        products:
          - sku: QWERTTY56DDFFVVV
            type: BUNDLE
            status: LIVE
            categoryId: 6d7329dfd5288b0011332388
            attributes:
              - id: 677329dfd5288b0011332344
                value: blue
            localizedProperties:
              en-US:
                attributes:
                  - id: 6d7329dfd5288b0011332388
                    value: blue
              en-IN:
                attributes:
                  - id: 6e7329dfd5288b0011332366
                    value: blue
            bundleProducts:
              - id: 7f7329dfd5288b0011332333
                quantity: 2
              - id: 6d7329dfd5288b0011332311
                quantity: 2

    bundleUpsertRequestBodyWithSKUExample:
      value:
        products:
          - sku: QWERTDDFFVVV
            type: BUNDLE
            status: LIVE
            categoryId: AAB2345678II
            attributes:
              - id: 6d7329dfd5288b0011332311
                value: blue
            localizedProperties:
              en-US:
                attributes:
                  - id: 8f7329dfd5288b0011332344
                    value: blue
              en-IN:
                attributes:
                  - id: 6f7329dfd5288b0011332365
                    value: blue
            bundleProducts:
              - sku: ASSD12334V3
                quantity: 2
              - sku: ASSBCC12334F
                quantity: 2

    productListExample:
      value:
        data:
          - id: 8d7329dfd5288b0011332376
            sku: QWERTTY56DDFFVVV
            type: ITEM
            isActive: true
            hasDraft: true
            hasLive: true
            status: LIVE
            attributes:
              - id: 6d7329dfd5288b0011332345
                name: Color
                type: string
                isDeleted: false
                value: blue
                isInherited: true
            localizedProperties:
              en-US:
                attributes:
                  - id: 517329dfd5288b0011332315
                    name: Color
                    type: string
                    isDeleted: false
                    value: blue
                    isInherited: true
              en-IN:
                attributes:
                  - id: 617329dfd5288b0011332316
                    name: Colour
                    type: string
                    isDeleted: false
                    value: blue
                    isInherited: true
            variants:
              - id: 717329dfd5288b0011332317
            categoryId: 5e7329dfd5288b00113323e4
            createdAt: "2021-09-14T22:10:30.618Z"
            updatedAt: "2021-09-14T22:10:30.618Z"
        offset: 5
        limit: 10
        count: 100

    productExample:
      value:
        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"

    variantListExample:
      value:
        data:
          - id: 527329dfd5288b001133235
            sku: QWE56DDFFVVV
            type: VARIANT
            isActive: true
            hasDraft: false
            hasLive: true
            status: LIVE
            attributes:
              - id: 567329dfd5288b0011332341
                name: Color
                type: string
                isDeleted: false
                value: blue,
                isInherited: true
            localizedProperties:
              en-US:
                attributes:
                  - id: 517329dfd5288b0011332341
                    name: Color
                    type: string
                    isDeleted: false
                    value: blue
                    isInherited: true
              en-IN:
                attributes:
                  - id: 5e7329dfd5288b0011332318
                    name: Colour
                    type: string
                    isDeleted: false
                    value: blue
                    isInherited: true
            parentProduct:
              id: 8e7329dfd5288b0011332315
            categoryId: 7e7329dfd5288b0011332354
            createdAt: "2021-09-14T22:10:30.618Z"
            updatedAt: "2021-09-14T22:10:30.618Z"
        offset: 5
        limit: 10
        count: 100

    variantExample:
      value:
        id: 717329dfd5288b0011332317
        sku: QWDDFFVVV
        type: VARIANT
        isActive: true
        hasDraft: false
        hasLive: true
        status: LIVE
        attributes:
          - id: 9e7329dfd5288b00113323b7
            name: Color
            type: string
            isDeleted: false
            value: blue,
            isInherited: true
        localizedProperties:
          en-US:
            attributes:
              - id: 4e7329dfd5288b00113323b6
                name: Color
                type: string
                isDeleted: false
                value: blue
                isInherited: true
          en-IN:
            attributes:
              - id: 7b7329dfd5288b0011332317
                name: Colour
                type: string
                isDeleted: false
                value: blue
                isInherited: true
        parentProduct:
          id: 7e7329dfd5288b0011332355
        categoryId: 717329dfd5288b0011332317
        createdAt: "2021-09-14T22:10:30.618Z"
        updatedAt: "2021-09-14T22:10:30.618Z"

    itemsListForBundlesExample:
      value:
        data:
          - id: 617329dfd5288b0011332311
            sku: QWE6DDFFVVV
            type: ITEM
            isActive: true
            hasDraft: false
            hasLive: true
            status: LIVE
            quantity: 3
            attributes:
              - id: 517329dfd5288b0011332355
                name: Color
                type: string
                isDeleted: false
                value: blue
                isInherited: true
            localizedProperties:
              en-US:
                attributes:
                  - id: 2e7329dfd5288b0011332313
                    name: Color
                    type: string
                    isDeleted: false
                    value: blue
                    isInherited: true
              en-IN:
                attributes:
                  - id: 717329dfd5288b0011332317
                    name: Colour
                    type: string
                    isDeleted: false
                    value: blue
                    isInherited: true
            categoryId: 967329dfd5288b0011332317
            createdAt: "2021-09-14T22:10:30.618Z"
            updatedAt: "2021-09-14T22:10:30.618Z"
        offset: 5
        limit: 10
        count: 100

    bundleListExample:
      value:
        data:
          - id: 617329dfd5288b0011332311
            sku: QWERTDDFFVVV
            type: BUNDLE
            isActive: false
            hasLive: false
            hasDraft: true
            status: DRAFT
            attributes:
              - id: 557329dfd5288b00113323k4
                name: Color
                type: string
                isDeleted: false
                value: blue
                isInherited: true
            localizedProperties:
              en-US:
                attributes:
                  - id: 567329dfd5288b0011332317
                    name: Color
                    type: string
                    isDeleted: false
                    value: blue
                    isInherited: true
              en-IN:
                attributes:
                  - id: 6e7329dfd5288b00113323e3
                    name: Colour
                    type: string
                    isDeleted: false
                    value: blue
                    isInherited: true
            bundleProducts:
              - id: 9b7329dfd5288b0011332312
                quantity: 2
              - id: 787329dfd5288b0011332311
                quantity: 2
            categoryId: AABBCC12345678II
            createdAt: "2021-09-14T22:10:30.618Z"
            updatedAt: "2021-09-14T22:10:30.618Z"
        offset: 5
        limit: 10
        count: 100

    bundleExample:
      value:
        id: 8b7329dfd5288b0011332322
        sku: QWEDFFVVV
        type: BUNDLE
        isActive: false
        hasLive: true
        hasDraft: true
        status: DRAFT
        attributes:
          - id: 9b7329dfd5288b0011332344
            name: Color
            type: string
            isDeleted: false
            value: blue
            isInherited: true
        localizedProperties:
          en-US:
            attributes:
              - id: 9a7329dfd5288b0011332344
                name: Color
                type: string
                isDeleted: false
                value: blue
                isInherited: true
          en-IN:
            attributes:
              - id: 712329dfd5288b0011332366
                name: Colour
                type: string
                isDeleted: false
                value: blue
                isInherited: true
        bundleProducts:
          - id: 567329dfd5288b0011332311
            quantity: 2
          - id: 717329dfd5288b0011332355
            quantity: 2
        categoryId: 5b7329dfd5288b0011332366
        createdAt: "2021-09-14T22:10:30.618Z"
        updatedAt: "2021-09-14T22:10:30.618Z"

    productSKUListExample:
      value:
        data:
          - id: 7b7329dfd5288b0011332399
            sku: QWEFVVV
            type: ITEM
            isActive: true
            hasDraft: true
            hasLive: true
            status: LIVE
            attributes:
              - id: 7b7329dfd5288b0011332355
                name: Color
                type: string
                isDeleted: false
                value: blue
                isInherited: true
            localizedProperties:
              en-US:
                attributes:
                  - id: 5e7329dfd5288b0011332344
                    name: Color
                    type: string
                    isDeleted: false
                    value: blue
                    isInherited: true
              en-IN:
                attributes:
                  - id: 717329dfd5288b0011332317
                    name: Colour
                    type: string
                    isDeleted: false
                    value: blue
                    isInherited: true
            variants:
              - id: 2b7329dfd5288b0011332311
                sku: AAD12334V2
            categoryId: 6b7329dfd5288b0011332317
            createdAt: "2021-09-14T22:10:30.618Z"
            updatedAt: "2021-09-14T22:10:30.618Z"
        offset: 5
        limit: 10
        count: 100

    productSKUExample:
      value:
        id: 717329dfd5288b0011332317
        sku: QWEFFVVV
        type: ITEM
        isActive: true
        hasDraft: true
        hasLive: true
        status: LIVE
        attributes:
          - id: 7b17329dfd5288b0011332314
            name: Color
            type: string
            isDeleted: false
            value: blue
            isInherited: true
        localizedProperties:
          en-US:
            attributes:
              - id: 8b7329dfd5288b0011332317
                name: Color
                type: string
                isDeleted: false
                value: blue
                isInherited: true
          en-IN:
            attributes:
              - id: 9e7329dfd5288b0011332388
                name: Colour
                type: string
                isDeleted: false
                value: blue
                isInherited: true
        variants:
          - id: 5b7329dfd5288b0011332322
            sku: AA334V2
        categoryId: 7b7329dfd5288b0011332389
        createdAt: "2021-09-14T22:10:30.618Z"
        updatedAt: "2021-09-14T22:10:30.618Z"

    variantSKUListExample:
      value:
        data:
          - id: 5g7329dfd5288b0011332345
            sku: QWERFFVVV
            type: VARIANT
            isActive: true
            hasDraft: true
            hasLive: true
            status: LIVE
            attributes:
              - id: 7b7329dfd5288b0011332311
                name: Color
                type: string
                isDeleted: false
                value: blue,
                isInherited: true
            localizedProperties:
              en-US:
                attributes:
                  - id: 7b7329dfd5288b0011332314
                    name: Color
                    type: string
                    isDeleted: false
                    value: blue
                    isInherited: true
              en-IN:
                attributes:
                  - id: 8n7329dfd5288b0011332314
                    name: Colour
                    type: string
                    isDeleted: false
                    value: blue
                    isInherited: true
            parentProduct:
              id: 5b7329dfd5288b00113323b1
              sku: AA3456
            categoryId: 717329dfd5288b0011332317
            createdAt: "2021-09-14T22:10:30.618Z"
            updatedAt: "2021-09-14T22:10:30.618Z"
        offset: 5
        limit: 10
        count: 100

    variantSKUExample:
      value:
        id: 9b7329dfd5288b0011332319
        sku: QWERTDFFVVV
        type: VARIANT
        isActive: false
        hasLive: true
        hasDraft: true
        status: DRAFT
        attributes:
          - id: 717329dfd5288b0011332317
            name: Color
            type: string
            isDeleted: false
            value: blue,
            isInherited: true
        localizedProperties:
          en-US:
            attributes:
              - id: 1b7329dfd5288b0011332315
                name: Color
                type: string
                isDeleted: false
                value: blue
                isInherited: true
          en-IN:
            attributes:
              - id: 717329dfd5288b0011332317
                name: Colour
                type: string
                isDeleted: false
                value: blue
                isInherited: true
        parentProduct:
          id: 7b7329dfd5288b0011332322
          sku: AA3456
        categoryId: 9b7329dfd5288b0011332345
        createdAt: "2021-09-14T22:10:30.618Z"
        updatedAt: "2021-09-14T22:10:30.618Z"

    itemsSKUListForBundlesExample:
      value:
        data:
          - id: 5b7329dfd5288b0011332399
            sku: QWERFFVVV
            type: ITEM
            quantity: 3
            isActive: true
            hasDraft: true
            hasLive: true
            status: LIVE
            attributes:
              - id: 8b7329dfd5288b00113323b3
                name: Color
                type: string
                isDeleted: false
                value: blue
                isInherited: true
            localizedProperties:
              en-US:
                attributes:
                  - id: 7e7329dfd5288b0011332311
                    name: Color
                    type: string
                    isDeleted: false
                    value: blue
                    isInherited: true
              en-IN:
                attributes:
                  - id: 723f29dfd5288b0011332311
                    name: Colour
                    type: string
                    isDeleted: false
                    value: blue
                    isInherited: true
            categoryId: 7f7329dfd5288b0011332317
            createdAt: "2021-09-14T22:10:30.618Z"
            updatedAt: "2021-09-14T22:10:30.618Z"
        offset: 5
        limit: 10
        count: 100

    bundleSKUListExample:
      value:
        data:
          - id: 7f7329dfd5288b0011332312
            sku: QWEDFFVVV
            type: BUNDLE
            isActive: true
            hasDraft: false
            hasLive: true
            status: LIVE
            attributes:
              - id: 9f7329dfd5288b0011332317
                name: Color
                type: string
                isDeleted: false
                value: blue
                isInherited: true
            localizedProperties:
              en-US:
                attributes:
                  - id: 6f7329dfd5288b00113323f11
                    name: Color
                    type: string
                    isDeleted: false
                    value: blue
                    isInherited: true
              en-IN:
                attributes:
                  - id: 3f7329dfd5288b0011332389
                    name: Colour
                    type: string
                    isDeleted: false
                    value: blue
                    isInherited: true
            bundleProducts:
              - id: 8e7329dfd5288b0011332322
                sku: AS334V3
                quantity: 2
              - id: 5e7329dfd5288b0011332366
                sku: ASCD12334V3
                quantity: 2
            categoryId: 8b7329dfd5288b0011332317
            createdAt: "2021-09-14T22:10:30.618Z"
            updatedAt: "2021-09-14T22:10:30.618Z"
        offset: 5
        limit: 10
        count: 100

    bundleSKUExample:
      value:
        id: 8e7329dfd5288b0011332377
        sku: QWEFVVV
        type: BUNDLE
        isActive: true
        hasDraft: false
        hasLive: true
        status: LIVE
        attributes:
          - id: 717329dfd5288b0011332317
            name: Color
            type: string
            isDeleted: false
            value: blue
            isInherited: true
        localizedProperties:
          en-US:
            attributes:
              - id: 6e7329dfd5288b0011332366
                name: Color
                type: string
                isDeleted: false
                value: blue
                isInherited: true
          en-IN:
            attributes:
              - id: 8e7329dfd5288b0011332377
                name: Colour
                type: string
                isDeleted: false
                value: blue
                isInherited: true
        bundleProducts:
          - id: 567329dfd5288b00113323e4
            sku: CA12334V3
            quantity: 2
          - id: 7e7329dfd5288b00113323f7
            sku: CAS2334V4
            quantity: 2
        categoryId: 8e7329dfd5288b0011332344
        createdAt: "2021-09-14T22:10:30.618Z"
        updatedAt: "2021-09-14T22:10:30.618Z"

  # Global query/path params
  parameters:
    deleteVariants:
      in: query
      name: deleteVariants
      description: "true(default): Delete variants of the product <br /> false: Don't delete variants of the product and make them regular items. <br /> **Note**: This parameter will have no impact if the `status` is `DRAFT`."
      schema:
        type: boolean
        default: true
      example: true
    ids:
      in: query
      name: ids
      schema:
        type: string
        example: "Q1WW1233DDFRE112F,WE223RRTYUHBVVDD"
      description: Comma-separated product IDs
      required: false
      allowReserved: true
    statusQueryParam:
      in: query
      name: status
      schema:
        type: string
        enum:
          - DRAFT
          - LIVE
        example: LIVE
        default: LIVE
      description: "Determines the version of the product applicable for this operation (endpoint action). If the status is `DRAFT`, only the Draft version of the product, if it exists, is considered for the operation."
      required: false
    statusQueryParamWithALL:
      in: query
      name: status
      schema:
        type: string
        enum:
          - DRAFT
          - LIVE
          - ALL
        example: LIVE
        default: ALL
      description: Determines the version of the product applicable for this operation (endpoint action). <br /> 1. If the status is 'DRAFT', this operation will only impact the Draft version of the product, if it exists. <br /> 2. If the status is 'ALL', this operation applies to both the Draft and Live versions of the product.
      required: false
    statusesQueryParam:
      in: query
      name: statuses
      schema:
        type: string
        example: DRAFT
        default: DRAFT,LIVE
      description: Comma-separated statuses indicating the preferred order of the product versions considered for this operation (endpoint action). For example, <br />1. When the status is `DRAFT`, this operations will only apply to the Draft version of product, if it exists <br />2. When the status is `LIVE`, this operation will only apply to the Live version of the product, if it exists <br />3 When the status is `LIVE,DRAFT`, this operation will prioritize Live version first, if it exists. Otherwise, the Draft version is considered. <br />4 When the status is `DRAFT,LIVE` this operation will prioritize the Draft version first, if it exists. Otherwise, the Live version is considered.
      required: false
      allowReserved: true
    locales:
      in: query
      name: locales
      schema:
        type: string
        example: fr-CA%2Cen-US
      description: "Comma-separated locale codes of product. The service throws a 400 error if the locale isn't supported. Standard locales can be found at https://www.rfc-editor.org/rfc/rfc5646. <br /> **Note**: The recommended way to get the locale is by invoking multi-channel service."
      required: false
    overrideDraft:
      in: query
      name: overrideDraft
      description: "true: Override the Draft version of the product when the Live version of the product is unpublished <br /> false: Discard the Live version and keep the Draft version. If there is no Draft, a new Draft status will be created"
      schema:
        type: boolean
        example: true
        default: true
      required: false
    productType:
      in: query
      name: type
      schema:
        $ref: "#/components/schemas/productType"
      description: Product types that can be filtered are Item, Bundle, and Variant
      required: false
      deprecated: true
    productTypes:
      in: query
      name: types
      schema:
        type: string
      description: Product types that can be filtered are Item, Bundle, and Variant. Supports multiple types when provided as comma separated types
      required: false
      allowReserved: true
      example: ITEM,VARIANT
    limit:
      in: query
      name: limit
      description: Maximum number of records per page
      schema:
        type: integer
        format: int32
        default: 10
        example: 10
    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
    sortBy:
      in: query
      name: sort
      description: "Sorting criteria. Supported values are `sku`, and `createdAt`. **Note**: `-` refers to descending and `+` refers to ascending order"
      schema:
        type: string
        example: +sku,-createdAt
      required: false
      allowReserved: true
    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
    skusQueryParameter:
      in: query
      name: skus
      schema:
        $ref: "#/components/schemas/sku"
      required: false
      allowReserved: true
    skuPathParameter:
      name: sku
      in: path
      example: QWERTASB
      description: Product SKU
      schema:
        type: string
      required: true

  headers:
    x-fabric-request-id-header:
      description: Unique request ID
      schema:
        type: string
        example: 263e731c-45c8-11ed-b878-0242ac120002
  schemas:
    insertProductsRequestBody:
      description: Request body for creating Items, Variants and Bundles
      type: object
      properties:
        sku:
          $ref: "#/components/schemas/sku"
        categoryId:
          type: string
          description: 24-character system-generated category ID
          example: QWE1234CCVFDDERW21
        isActive:
          type: boolean
          example: true
          description: "Determines if the Product is published or unpublished. Status parameter takes precedence"
          deprecated: true
        type:
          $ref: "#/components/schemas/productType"
        attributes:
          $ref: "#/components/schemas/productAttributes"
        parentProduct:
          anyOf:
            - $ref: "#/components/schemas/parentProductId"
            - $ref: "#/components/schemas/parentProductSKU"
          description: ID or SKU of parent product
        bundleProducts:
          anyOf:
            - $ref: "#/components/schemas/bundleSKUProducts"
            - $ref: "#/components/schemas/bundleProducts"
          description: Bundle ID or SKU

    productSearchRequestMatch:
      minProperties: 1
      additionalProperties: false
      description: Search criteria to match attributes
      type: object
      properties:
        id:
          $ref: "#/components/schemas/simpleStringSearchOperation"
        sku:
          $ref: "#/components/schemas/stringSearchOperation"
        type:
          oneOf:
            - $ref: "#/components/schemas/singleProductType"
            - $ref: "#/components/schemas/multiProductType"
        hasDraft:
          $ref: "#/components/schemas/booleanSearchOperation"
        hasLive:
          $ref: "#/components/schemas/booleanSearchOperation"
        status:
          $ref: "#/components/schemas/singleStatusSearchSchema"
        categoryId:
          type: array
          description: Search by category IDs
          items:
            anyOf:
              - $ref: "#/components/schemas/advancedMultiStringSearchOperation"
              - $ref: "#/components/schemas/simpleSingleStringSearchOperation"

        properties:
          description: "Product Attributes are searched with the combination of `id` and `value`. Multiple attributes can be included in the search"
          type: array
          items:
            $ref: "#/components/schemas/productAttributeValueSearch"
        variantIds:
          $ref: "#/components/schemas/simpleStringSearchOperation"
        bundleProductIds:
          $ref: "#/components/schemas/simpleStringSearchOperation"
        createdAt:
          $ref: "#/components/schemas/datetimeSearchOperation"
        updatedAt:
          $ref: "#/components/schemas/datetimeSearchOperation"
        createdBy:
          $ref: "#/components/schemas/simpleStringSearchOperation"

    targetCategoryId:
      type: string
      description: Category ID
      example: AACCVVV1234567

    singleStatusSearchSchema:
      type: object
      description: Attributes that match the search query using single status
      required:
        - op
        - value
      properties:
        op:
          type: string
          description: "Operations that can be performed on a single-status"
          example: EQUALS
          enum:
            - EQUALS
        value:
          description: "Statuses indicating the product version considered for this operation. For example, <br />1. When the status is `DRAFT`, this operations will only apply to the Draft version of product, if it exists <br />2. When the status is `LIVE`, this operation will only apply to the Live version of the product."
          type: string
          enum:
            - DRAFT
            - LIVE
          example: LIVE
          default: LIVE

    singleProductType:
      type: object
      description: Attributes that match the search query using single product type
      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/productType"

    multiProductType:
      type: object
      description: Attributes that match the search query using multiple product types
      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/productType"

    #    productSort:
    #      oneOf:
    #        - $ref: "#/components/schemas/productSortByAttributes"
    #        - $ref: "#/components/schemas/productSortByFeatures"
    #
    #    productSortByAttributes:
    #      type: object
    #      description: Sort by Attributes
    #      properties:
    #        attributeId:
    #          type: string
    #          description: Attribute ID
    #          example: AGFGGHH12345IIII
    #        locale:
    #          type: string
    #          description: The locale
    #          example: en_US
    #
    #    productSortByFeatures:
    #      type: string
    #      enum: [ "SKU", "TYPE", "CREATED_ON" ]
    #      example: SKU
    #      description: Sort by product
    #
    #    sortDirection:
    #      type: string
    #      enum: [ "DESC", "ASC" ]
    #      example: ASC
    #      description: Sort by direction

    productAttributeValueInfo:
      description: Product attribute value
      anyOf:
        - $ref: "#/components/schemas/datetimeSearchOperation"
        - $ref: "#/components/schemas/localizedStringSearchOperation"
        - $ref: "#/components/schemas/booleanSearchOperation"
        - $ref: "#/components/schemas/numberSearchOperation"

    productAttributeValueSearch:
      description: Search based on Product Attribute value
      type: object
      properties:
        attributeId:
          $ref: "#/components/schemas/attributeId"
        attributeValue:
          type: array
          items:
            $ref: "#/components/schemas/productAttributeValueInfo"

    localizedStringSearchOperation:
      description: Localised attribute value search
      allOf:
        - $ref: "#/components/schemas/advancedStringSearchOperation"
      type: object
      properties:
        locale:
          type: string
          description: Locale of attribute
          example: en_US

    arrayOfStrings:
      type: array
      description: Array of strings
      items:
        $ref: "#/components/schemas/stringSchema"

    booleanSchema:
      type: boolean
      nullable: true
      description: Sample `boolean` schema
      example: true

    stringSchema:
      type: string
      nullable: true
      description: Sample `string` schema
      example: blue

    integerSchema:
      type: integer
      nullable: true
      format: int32
      description: Sample `integer` schema
      example: 1

    doubleSchema:
      type: number
      nullable: true
      format: double
      description: Sample `double` schema
      example: 1

    dateSchema:
      type: string
      format: date
      nullable: true
      description: Sample `date` schema
      example: 2022-12-31T00:00:00.000Z

    productAttributeValue:
      type: object
      description: Details of product attributes
      properties:
        id:
          $ref: "#/components/schemas/productId"
        name:
          type: string
          example: "color"
          description: Attribute name
        type:
          type: string
          example: "string"
          description: Attribute type
          # need enum
        validation:
          type: object
          description: Attribute validation - date
          properties:
            dateFormat:
              type: string
              description: >-
                Date format. <br> Applicable when `attributeType`
                is `DATETIME`.
              example: MM-DD-YYYY
        isDeleted:
          type: boolean
          nullable: true
          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
          nullable: true
          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"
          example: blue
          description: Attribute value

    productProperties:
      type: object
      description: Localized attribute names
      additionalProperties:
        type: object
        properties:
          attributes:
            type: array
            items:
              $ref: "#/components/schemas/productAttributeValue"
      example:
        en-US:
          attributes:
            - id: 4e7329dfd5288b0011332366
              name: Color
              type: string
              isDeleted: false
              value: blue
              isInherited: true

    bundleProducts:
      type: array
      description: Items or variants that are part of Bundle by ID
      items:
        minItems: 1
        required:
          - id
          - quantity
        type: object
        properties:
          id:
            $ref: "#/components/schemas/productId"
          quantity:
            type: integer
            format: int32
            example: 2
            description: Number of items or variants in bundle

    variantSKUProducts:
      type: array
      description: Variants based on SKU
      minItems: 1
      items:
        type: object
        required:
          - sku
        properties:
          sku:
            $ref: "#/components/schemas/sku"

    parentProductId:
      description: Parent item ID of the Variant
      type: object
      properties:
        id:
          $ref: "#/components/schemas/productId"

    parentProductSKU:
      description: Parent item SKU of the Variant
      type: object
      properties:
        sku:
          $ref: "#/components/schemas/sku"

    variantProducts:
      type: array
      description: Product variants by ID
      items:
        type: object
        required:
          - id
        properties:
          id:
            $ref: "#/components/schemas/productId"

    variantProductSKU:
      type: array
      description: Lists product variants by SKU.
      items:
        type: object
        required:
          - sku
        properties:
          sku:
            $ref: "#/components/schemas/sku"

    bundleSKUProducts:
      type: array
      description: Items or variants that are part of the bundle
      items:
        type: object
        minItems: 1
        required:
          - sku
          - quantity
        properties:
          sku:
            $ref: "#/components/schemas/sku"
          quantity:
            type: integer
            format: int32
            example: 2
            description: Number of items or variants in bundle

    variantSKUAndIDProducts:
      type: array
      description: Variants with ID and SKU
      items:
        type: object
        properties:
          id:
            $ref: "#/components/schemas/productId"
          sku:
            $ref: "#/components/schemas/sku"

    categoryIdResponse:
      type: string
      example: 6h7329dfd5288b001133231d
      description: 24-character system-generated category ID of product

    bundleSKUAndIDProducts:
      type: array
      description: Bundles with ID and SKU
      items:
        type: object
        properties:
          id:
            $ref: "#/components/schemas/productId"
          sku:
            $ref: "#/components/schemas/sku"
          quantity:
            type: integer
            format: int32
            example: 2
            description: Number of products or variants in bundle

    idBasedVariant:
      type: object
      description: Variant details by ID
      properties:
        id:
          $ref: "#/components/schemas/productId"
        sku:
          $ref: "#/components/schemas/sku"
        type:
          $ref: "#/components/schemas/productType"
        isActive:
          type: boolean
          example: true
          description: "true: Variant is active <br /> false: Variant is inactive"
        hasDraft:
          $ref: "#/components/schemas/hasDraft"
        hasLive:
          $ref: "#/components/schemas/hasLive"
        status:
          $ref: "#/components/schemas/status"
        attributes:
          type: array
          description: Product attributes
          items:
            $ref: "#/components/schemas/productAttributeValue"
        localizedProperties:
          $ref: "#/components/schemas/productProperties"
        parentProduct:
          $ref: "#/components/schemas/parentProductId"
        categoryId:
          type: string
          example: 617329dfd5288b0011332311
          description: 24-character system-generated category ID of product
        createdAt:
          type: string
          example: "2021-09-14T22:10:30.618Z"
          description: Time of variant creation (UTC)
        updatedAt:
          type: string
          example: "2021-09-14T22:10:30.618Z"
          description: Time of last update to variant (UTC)

    idBasedBundle:
      type: object
      description: Details of Bundle by ID
      properties:
        id:
          $ref: "#/components/schemas/productId"
        sku:
          $ref: "#/components/schemas/sku"
        type:
          $ref: "#/components/schemas/productType"
        quantity:
          type: integer
          format: int32
          example: 2
          description: Number of products in bundle
        isActive:
          type: boolean
          example: true
          description: "true: Bundle is active <br /> false: Bundle is inactive"
        hasDraft:
          $ref: "#/components/schemas/hasDraft"
        hasLive:
          $ref: "#/components/schemas/hasLive"
        status:
          $ref: "#/components/schemas/status"
        attributes:
          type: array
          description: Product attributes
          items:
            $ref: "#/components/schemas/productAttributeValue"
        localizedProperties:
          $ref: "#/components/schemas/productProperties"
        categoryId:
          type: string
          example: 6g7329dfd5288b0011332322
          description: 24-character system-generated category ID of product
        createdAt:
          type: string
          example: "2021-09-14T22:10:30.618Z"
          description: Time of bundle creation (UTC)
        updatedAt:
          type: string
          example: "2022-02-14T22:10:30.618Z"
          description: Time of last update to bundle (UTC)

    skuBasedVariant:
      type: object
      description: Details of Variant by SKU
      properties:
        id:
          $ref: "#/components/schemas/productId"
        sku:
          $ref: "#/components/schemas/sku"
        type:
          $ref: "#/components/schemas/productType"
        isActive:
          type: boolean
          example: true
          description: "true: Variant is active <br /> false: Variant is inactive"
        hasDraft:
          $ref: "#/components/schemas/hasDraft"
        hasLive:
          $ref: "#/components/schemas/hasLive"
        status:
          $ref: "#/components/schemas/status"
        attributes:
          type: array
          description: Product attributes
          items:
            $ref: "#/components/schemas/productAttributeValue"
        localizedProperties:
          $ref: "#/components/schemas/productProperties"
        parentProduct:
          allOf:
            - $ref: "#/components/schemas/parentProductId"
            - $ref: "#/components/schemas/parentProductSKU"
        categoryId:
          type: string
          example: 2f7329dfd5288b001133231D
          description: 24-character system-generated category ID
        createdAt:
          type: string
          example: "2021-09-14T22:10:30.618Z"
          description: Time of variant of creation (UTC)
        updatedAt:
          type: string
          example: "2021-09-14T22:10:30.618Z"
          description: Time of last update to variant (UTC)

    skuBasedBundle:
      type: object
      description: Bundle details by SKU
      properties:
        id:
          $ref: "#/components/schemas/productId"
        sku:
          $ref: "#/components/schemas/sku"
        type:
          $ref: "#/components/schemas/productType"
        isActive:
          type: boolean
          example: true
          description: "true: Bundle is active <br /> false: Bundle is inactive"
        hasDraft:
          $ref: "#/components/schemas/hasDraft"
        hasLive:
          $ref: "#/components/schemas/hasLive"
        status:
          $ref: "#/components/schemas/status"
        quantity:
          type: integer
          format: int32
          example: 3
          description: Number of products in bundle
        attributes:
          type: array
          description: Product attributes
          items:
            $ref: "#/components/schemas/productAttributeValue"
        localizedProperties:
          $ref: "#/components/schemas/productProperties"
        categoryId:
          type: string
          example: 6d7329dfd5288b0011332311
          description: 24-character system-generated category ID of product
        createdAt:
          type: string
          example: "2021-09-14T22:10:30.618Z"
          description: Time of bundle creation (UTC)
        updatedAt:
          type: string
          example: "2021-09-14T22:10:30.618Z"
          description: Time of last update bundle (UTC)

    idBasedProduct:
      type: object
      description: Details of Item by ID
      properties:
        id:
          $ref: "#/components/schemas/productId"
        sku:
          $ref: "#/components/schemas/sku"
        type:
          $ref: "#/components/schemas/productType"
        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 product
          items:
            $ref: "#/components/schemas/productAttributeValue"
        localizedProperties:
          $ref: "#/components/schemas/productProperties"
        parentProduct:
          $ref: "#/components/schemas/parentProductId"
        variants:
          $ref: "#/components/schemas/variantProducts"
        categoryId:
          $ref: "#/components/schemas/categoryIdResponse"
        bundleProducts:
          $ref: "#/components/schemas/bundleProducts"
        createdAt:
          type: string
          example: "2021-09-14T22:10:30.618Z"
          description: Time of product creation (UTC)
        updatedAt:
          type: string
          example: "2021-09-14T22:10:30.618Z"
          description: Time of last update to product (UTC)

    skuBasedProduct:
      type: object
      description: Details of Item by SKU
      properties:
        id:
          $ref: "#/components/schemas/productId"
        sku:
          $ref: "#/components/schemas/sku"
        type:
          $ref: "#/components/schemas/productType"
        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 assigned to product
          items:
            $ref: "#/components/schemas/productAttributeValue"
        localizedProperties:
          $ref: "#/components/schemas/productProperties"
        parentProduct:
          allOf:
            - $ref: "#/components/schemas/parentProductId"
            - $ref: "#/components/schemas/parentProductSKU"
        variants:
          $ref: "#/components/schemas/variantSKUAndIDProducts"
        bundleProducts:
          $ref: "#/components/schemas/bundleSKUAndIDProducts"
        categoryId:
          $ref: "#/components/schemas/categoryIdResponse"
        createdAt:
          type: string
          example: "2021-09-14T22:10:30.618Z"
          description: Time of product creation (UTC)
        updatedAt:
          type: string
          example: "2021-09-14T22:10:30.618Z"
          description: Time of last update to product (UTC)

    productId:
      type: string
      example: AASSBCC12334FCD12334V
      description: Product ID

    attributeId:
      type: string
      example: CAZZX1234567DDDDD
      description: Attribute ID

    productType:
      type: string
      enum: ["ITEM", "VARIANT", "BUNDLE"]
      example: ITEM
      description: Supported product types

    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 takes precedence over `isActive` if both are sent in the request.
      enum:
        - DRAFT
        - LIVE
      example: LIVE

    patchOperation:
      type: string
      enum: ["add", "replace", "remove"]
      example: add
      description: Patch operations

    genericError:
      type: object
      properties:
        message:
          type: string
          description: Place holder error message for all 4xx, 5xx errors
          example: Request is invalid
        type:
          type: string
          description: Place holder for error types such as 4xx, 5xx
          example: Bad request
        errors:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                description: Error type
                example: CLIENT_ERROR
              message:
                type: string
                description: Error message
                example: Invalid request. Unable to find or create product

    productValueWithAttributeArray:
      type: object
      description: "patch value with attributes"
      properties:
        attributes:
          $ref: "#/components/schemas/productAttributes"

    productAttributes:
      type: array
      description: Array of product attributes
      items:
        $ref: "#/components/schemas/productAttribute"

    productAttribute:
      type: object
      description: Details of product attributes
      required:
        - id
        - value
      properties:
        id:
          type: string
          example: 6d7329dfd5288b0011332311
          description: 24-character system-generated attribute ID
        value:
          anyOf:
            - $ref: "#/components/schemas/booleanSchema"
            - $ref: "#/components/schemas/stringSchema"
            - $ref: "#/components/schemas/integerSchema"
            - $ref: "#/components/schemas/doubleSchema"
            - $ref: "#/components/schemas/arrayOfStrings"
          example: blue
          description: Attribute value

    updateProductAttributeRequest:
      type: object
      description: Request to update product attributes.
      additionalProperties: false
      properties:
        attributes:
          $ref: "#/components/schemas/productAttributes"
        localizedProperties:
          type: object
          additionalProperties:
            type: object
            properties:
              attributes:
                $ref: "#/components/schemas/productAttributes"
            description: Localized names of attributes
          example:
            en-US:
              attributes:
                - id: W123333RRTT555y1
                  value: blue
            en-IN:
              attributes:
                - id: W123333RRTT555AA
                  value: blue

    updateProductSkusRequest:
      type: object
      description: Request to update products by SKUs
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: array
          minItems: 1
          items:
            type: object
            required:
              - oldProductSku
              - newProductSku
            properties:
              oldProductSku:
                type: string
                example: AAWE1234CCVFDDERW21
                description: Existing product SKU
              newProductSku:
                type: string
                example: BQWE1234CCVFDDERW21
                description: New product SKU
      example:
        data:
          - oldProductSku: AAWE1234CCVFDDERW21
            newProductSku: BQWE1234CCVFDDERW21
          - oldProductSku: AAWE1234CCVFDDERW20
            newProductSku: BQWE1234CCVFDDERW20

    partialUpdateProductRequest:
      type: object
      description: Request for partial update
      required:
        - data
      properties:
        data:
          type: array
          minItems: 1
          items:
            type: object
            required:
              - op
              - path
            properties:
              op:
                $ref: "#/components/schemas/patchOperation"
              path:
                type: string
                example: "/attributes/0/value"
                description: Attribute path
              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/productAttribute"
                  - $ref: "#/components/schemas/productAttributes"
                  - $ref: "#/components/schemas/productValueWithAttributeArray"
                description: Attribute value
                example: blue

    getProductByIdResponse:
      $ref: "#/components/schemas/idBasedProduct"

    getProductBySkuResponse:
      $ref: "#/components/schemas/skuBasedProduct"

    productListByIds:
      description: Product list by IDs
      allOf:
        - $ref: "#/components/schemas/paginatedResultMeta"
        - type: object
          properties:
            data:
              type: array
              items:
                $ref: "#/components/schemas/idBasedProduct"

    getProductsByIdsResponse:
      $ref: "#/components/schemas/productListByIds"

    getVariantByIdsResponse:
      description: Details of variants by IDs
      type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/idBasedVariant"

    getBundleByIdsResponse:
      description: Details of bundles by IDs
      allOf:
        - $ref: "#/components/schemas/paginatedResultMeta"
        - type: object
          properties:
            data:
              type: array
              items:
                $ref: "#/components/schemas/idBasedBundle"

    getVariantBySKUsResponse:
      description: Details of variants by SKUs
      allOf:
        - $ref: "#/components/schemas/paginatedResultMeta"
        - type: object
          properties:
            data:
              type: array
              items:
                $ref: "#/components/schemas/skuBasedVariant"

    getBundleBySKUsResponse:
      description: Details of bundles by SKUs
      allOf:
        - $ref: "#/components/schemas/paginatedResultMeta"
        - type: object
          properties:
            data:
              type: array
              items:
                $ref: "#/components/schemas/skuBasedBundle"

    getCollectionsBySKUResponse:
      description: Details of collections by SKU
      allOf:
        - $ref: "#/components/schemas/paginatedResultMeta"
        - type: object
          properties:
            data:
              type: array
              items:
                $ref: "#/components/schemas/skuBasedCollections"

    skuBasedCollections:
      type: object
      description: Collection details by SKU
      properties:
        id:
          type: string
          description: 24-character system-generated collection ID
          example: 55184766610c0e32a86d8759
        name:
          type: string
          description: Non-localized collection name
          example: Color
        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 <p> **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/categoryAttribute"
        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)

    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

    deleteProductsResponse:
      description: Delete product response
      type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/deleteProduct"

    changeProductCategoryResponse:
      description: Change product category response object
      type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/bulkOperationsResponse"
      example:
        data:
          - success:
              - id: AASSBCC12334FCD12334V
                sku: XP-123345
            errors:
              - id: AASSBCC12334FCD23456A
                sku: XP-23456
                message: [Product AASSBCC12334FCD12334V is already published]

    deleteProduct:
      description: Delete product response object
      allOf:
        - $ref: "#/components/schemas/bulkOperationsResponse"
      example:
        success:
          - id: 6d7329dfd5288b0011332311
            sku: AAWEDDERW21
        errors:
          - id: 6d7329dfd5288b0011332311
            sku: AAWE1234CCVFDDERW21
            message:
              [
                Product 6d7329dfd5288b0011332311 is associated with bundle ID 5f7329dfd5288b0011332322,
              ]

    upsertProductsResponse:
      description: Add product response
      type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/upsertProducts"

    genericPublishResponse:
      description: Response for publishing or unpublishing product.
      type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/bulkOperationsResponse"
      example:
        data:
          - success:
              - id: AASSBCC12334FCD12334V
                sku: XP-123345
            errors:
              - id: AASSBCC12334FCD23456A
                sku: XP-23456
                message: Product AASSBCC12334FCD12334V is already published

    bulkOperationsResponse:
      description: Bulk operation response
      type: object
      properties:
        success:
          type: array
          items:
            type: object
            properties:
              id:
                $ref: "#/components/schemas/productId"
              sku:
                $ref: "#/components/schemas/sku"
        errors:
          type: array
          items:
            type: object
            properties:
              id:
                $ref: "#/components/schemas/productId"
              sku:
                $ref: "#/components/schemas/sku"
              message:
                type: array
                items:
                  description: Error detail
                  type: string
                  example: Attribute ID 6d7329dfd5288b0011332311 can't be null

    upsertProducts:
      description: Add product response
      allOf:
        - $ref: "#/components/schemas/bulkOperationsResponse"
      example:
        success:
          - id: AASSBCC12334FCD12334V
            sku: XP-123345
        errors:
          - id: AASSBCC12334FCD23456A
            sku: XP-23456
            message: [Attribute ID 6d7329dfd5288b0011332311 can not be null]

    getProductsBySkusResponse:
      description: Product details by SKUs
      allOf:
        - $ref: "#/components/schemas/paginatedResultMeta"
        - type: object
          properties:
            data:
              type: array
              items:
                $ref: "#/components/schemas/skuBasedProduct"

    productSkuBulkUpdateResponse:
      description: Bulk operation response to change the SKUs
      type: object
      properties:
        data:
          type: array
          items:
            description: Response of bulk operation
            type: object
            properties:
              success:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      description: 24-character system-generated product ID
                      anyOf:
                        - $ref: "#/components/schemas/productId"
                      example: AASSBCC12334FCD123346
                    newSku:
                      description: Product's new SKU
                      anyOf:
                        - $ref: "#/components/schemas/sku"
                      example: BQWE1234CCVFDDERW21
                    oldSku:
                      description: Product's old SKU
                      anyOf:
                        - $ref: "#/components/schemas/sku"
                      example: AAWE1234CCVFDDERW21
              errors:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      anyOf:
                        - $ref: "#/components/schemas/productId"
                      example: AASSBCC12334FCD123345
                    newSku:
                      anyOf:
                        - $ref: "#/components/schemas/sku"
                      example: BQWE1234CCVFDDERW20
                    oldSku:
                      anyOf:
                        - $ref: "#/components/schemas/sku"
                      example: AAWE1234CCVFDDERW20
                    message:
                      type: array
                      items:
                        description: Error detail
                        type: string
                        example: Attribute ID AASSBB123456IIII can not be null

    paginatedResultMeta:
      description: Pagination metadata
      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

    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 with IN condition
      required:
        - op
        - value
      properties:
        op:
          type: string
          description: "Operations that can be performed on a date-time type. That is, equals to, less than, greater than, less than or equal to, greater than or equal to"
          example: IN
          enum:
            - IN
        value:
          type: array
          items:
            type: string
          example:
            - 2023-01-14T22:10:30.618Z
            - 2023-05-14T22:10:30.618Z
          description: Timestamp to be searched (UTC)

    datetimeOperation:
      type: object
      description: Date-time search
      required:
        - op
        - value
      properties:
        op:
          type: string
          description: "Operations that can be performed on a date-time type. That is, equals to, less than, greater than, less than or equal to, greater than or equal to"
          example: GTE
          enum:
            - EQUALS
            - LTE
            - GTE
            - LT
            - GT
        value:
          type: string
          description: Timestamp to be searched (UTC)
          example: "2021-09-14T22:10:30.618Z"

    datetimeRangeOperation:
      type: object
      description: Date range search
      required:
        - op
        - toValue
        - fromValue
      properties:
        op:
          type: string
          description: Search operation that can be performed on a `date-time` range type
          example: RANGE
          enum:
            - RANGE
        fromValue:
          type: string
          description: Start date for searching (UTC)
          example: "2022-09-14T22:10:30.618Z"
        toValue:
          type: string
          description: End date for searching (UTC)
          example: "2023-04-14T22:10:30.618Z"

    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
            - NOT_CONTAINS
        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: Multi-number 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: Advanced single-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"

    localizedPropertiesUpdateRequest:
      type: object
      additionalProperties:
        type: object
        properties:
          attributes:
            $ref: "#/components/schemas/productAttributes"
        description: Localized attribute names
      example:
        en-US:
          attributes:
            - id: W123333RRTT555y1
              value: blue
        en-IN:
          attributes:
            - id: W123333RRTT555AA
              value: blue

    localizedPropertiesCreateRequest:
      type: object
      additionalProperties:
        type: object
        properties:
          attributes:
            $ref: "#/components/schemas/productAttributes"
        description: Localized attribute names
      example:
        en-US:
          attributes:
            - id: W123333RRTT555y1
              value: blue
        en-IN:
          attributes:
            - id: W123333RRTT555AA
              value: blue

    jobIdResponse:
      type: object
      description: Job ID for the exported job
      properties:
        jobId:
          type: string
          description: 24-character system-generated job ID
          example: 877f1f77bcf86cd799439087
    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: "^[^;=]*$"

    arraySKUObjects:
      type: object
      additionalProperties: false
      required:
        - products
      properties:
        products:
          type: array
          minItems: 1
          items:
            type: object
            properties:
              sku:
                $ref: "#/components/schemas/sku"

    arrayProductIdObjects:
      type: object
      additionalProperties: false
      required:
        - products
      properties:
        products:
          type: array
          minItems: 1
          items:
            type: object
            properties:
              id:
                $ref: "#/components/schemas/productId"

security:
  - authorization: []
