openapi: '3.0.2'
"x-mint": {
    "mcp": {
      "enabled": true
    }
  }
info:
  title: Products - Published Products API
  version: "3.0.0"
  description: fabric **Published Products** API enables displaying products (items, variants, and bundles) and their details on your e-commerce platform (website or mobile app). Published products are products that are ready to be sold. Published products API supports getting one or more product details by product ID, SKUs, or Item IDs. And, also support search and filter functions, making it easier for shoppers to view product details such as descriptions, specification, images, and more. This will help them make informed purchases and enjoy a better shopping experience.
  contact:
    email: support@fabric.inc
    name: Product team
  license:
    name: fabric API License
    url: https://fabric.inc/api-license
  x-audience: external-public
  termsOfService: https://fabric.inc/terms-of-use

externalDocs:
  description: Find out more about Product
  url: https://developer.fabric.inc/docs/products-overview

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

tags:
  - name: Published Products By ID
    description: These are read-only endpoints used with Storefront. They support product operations by product ID.
  - name: Published Products By SKU
    description: These are read-only endpoints used with Storefront. They support product operations by product SKU.
  - name: Published Products By itemId
    description: 'These are read-only endpoints used with Storefront. They support product operations by item ID, which is a unique identifier of an item, a variant or a bundle. <br /> `NOTE:` This is a legacy ID which will be deprecated eventually. The recommendation is to use Product ID (`id`).'

paths:
  /published-products/{id}:
    get:
      tags:
        - Published Products By ID
      summary: Get Published Product by ID
      description: "Your Storefront must displays all the relevant information for shoppers to make an informed purchase decision. This endpoint gets details of a published product (item, bundle, or variant) by ID, which can be used to display product details on your Storefront.  **Note**: If you don't have product ID, use the corresponding SKU-based or item ID-based endpoints."
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
        - $ref: "#/components/parameters/excludeBundleProductsParameter"
        - $ref: "#/components/parameters/excludeCollectionsParameter"
        - $ref: "#/components/parameters/excludeCategoriesParameter"
        - $ref: "#/components/parameters/excludeVariantsParameter"
        - $ref: "#/components/parameters/localeParameter"
        - $ref: "#/components/parameters/idPathParameter"
      responses:
        "200":
          $ref: "#/components/responses/getByIdWithExclusions200Response"
        "400":
          $ref: "#/components/responses/badRequest"
        "401":
          $ref: "#/components/responses/notAuthorized"
        "403":
          $ref: "#/components/responses/forbidden"
        "404":
          $ref: "#/components/responses/notFound"
        "413":
          $ref: "#/components/responses/payloadLimitExceededError"
        "500":
          $ref: "#/components/responses/internalServerError"

  /published-products/{id}/variants:
    get:
      tags:
        - Published Products By ID
      summary: Get Variants of Published Product by ID
      description: "Variants are the different versions of a product with different sizes, colors, or materials. For example, there are 12 variants of 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 shoppers more options. This endpoint gets a paginated list of variants of a published product by ID.  **Note**:<br /> 1. You can narrow down the search results by specifying `offset` and `limit`. When they're not specified, by default you'll get up to 10 records. <br /> 2. If you don't have product ID, use the corresponding SKU-based or item ID-based endpoints."
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
        - $ref: "#/components/parameters/idPathParameter"
        - $ref: "#/components/parameters/localeParameter"
        - $ref: "#/components/parameters/limit"
        - $ref: "#/components/parameters/offset"
      responses:
        "200":
          $ref: "#/components/responses/getVariantsByProductId200Response"
        "400":
          $ref: "#/components/responses/badRequest"
        "401":
          $ref: "#/components/responses/notAuthorized"
        "403":
          $ref: "#/components/responses/forbidden"
        "404":
          $ref: "#/components/responses/notFound"
        "413":
          $ref: "#/components/responses/payloadLimitExceededError"
        "500":
          $ref: "#/components/responses/internalServerError"

  /published-products/{id}/bundle-products:
    get:
      tags:
        - Published Products By ID
      summary: Get Products in a Bundle by ID
      description: "A 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 published products in a bundle by bundle ID. You can refine your search results by specifying query parameters - `excludeBundleProducts`, `excludeCollections`, `excludeCategories` and `excludeVariants` **Note**: <br />1. You can refine the results by specifying `offset` and `limit`. 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 item ID-based or SKU-based endpoints."
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
        - $ref: "#/components/parameters/idPathParameter"
        - $ref: "#/components/parameters/localeParameter"
        - $ref: "#/components/parameters/limit"
        - $ref: "#/components/parameters/offset"
      responses:
        "200":
          $ref: "#/components/responses/getBundledProductsByProductId200Respon\
                se"
        "400":
          $ref: "#/components/responses/badRequest"
        "401":
          $ref: "#/components/responses/notAuthorized"
        "403":
          $ref: "#/components/responses/forbidden"
        "404":
          $ref: "#/components/responses/notFound"
        "413":
          $ref: "#/components/responses/payloadLimitExceededError"
        "500":
          $ref: "#/components/responses/internalServerError"

  /published-products/{id}/collections:
    get:
      tags:
        - Published Products By ID
      summary: Get Collections by Product ID
      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. This endpoint gets the collection details of a published product by ID. You can refine your search results by specifying query parameters - `collectionIds` and `collectionRootName` **Note**: <br />1. You can narrow down the results by specifying `offset` and `limit`. 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 item ID-based or SKU-based endpoints."
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
        - $ref: "#/components/parameters/idPathParameter"
        - $ref: "#/components/parameters/collectionIds"
        - $ref: "#/components/parameters/collectionRootNames"
        - $ref: "#/components/parameters/localeParameter"
        - $ref: "#/components/parameters/limit"
        - $ref: "#/components/parameters/offset"
      responses:
        "200":
          $ref: "#/components/responses/getCollectionsByProductId200Response"
        "400":
          $ref: "#/components/responses/badRequest"
        "401":
          $ref: "#/components/responses/notAuthorized"
        "403":
          $ref: "#/components/responses/forbidden"
        "404":
          $ref: "#/components/responses/notFound"
        "413":
          $ref: "#/components/responses/payloadLimitExceededError"
        "500":
          $ref: "#/components/responses/internalServerError"

  /published-products/ids:
    get:
      tags:
        - Published Products By ID
      summary: Get Multiple Published Products by IDs
      description: "Shoppers may want to view the products they've already identified or bookmarked, or you may want to promote a particular set of products as part of promotions. This endpoint get details of published products with or without variants, categories, bundle products, and collections. You can specify multiple comma-separated product `ids`. Using this endpoint, you can show up to 25 products on your Storefront.  **Note**: If you don't have product ID, use the corresponding item ID-based or SKU-based endpoints."
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
        - $ref: "#/components/parameters/idsParameter"
        - $ref: "#/components/parameters/excludeVariantsParameter"
        - $ref: "#/components/parameters/excludeCategoriesParameter"
        - $ref: "#/components/parameters/excludeCollectionsParameter"
        - $ref: "#/components/parameters/excludeBundleProductsParameter"
        - $ref: "#/components/parameters/localeParameter"
        - $ref: "#/components/parameters/limit"
        - $ref: "#/components/parameters/offset"
      responses:
        "200":
          $ref: "#/components/responses/getByIdsWithExclusions200Response"
        "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"

  /published-products/skus/{sku}:
    get:
      tags:
        - Published Products By SKU
      summary: Get Published Product by SKU
      description: "Your Storefront must displays all the relevant information for shoppers to help them make an informed purchase decision. This endpoint gets details of a published product (item, bundle, or variant) by SKU, which can be used to display product details on your Storefront.  **Note**: If you don't have product SKU, use the corresponding item ID-based or product ID-based endpoints."
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
        - $ref: "#/components/parameters/skuPathParameter"
        - $ref: "#/components/parameters/excludeBundleProductsParameter"
        - $ref: "#/components/parameters/excludeCollectionsParameter"
        - $ref: "#/components/parameters/excludeCategoriesParameter"
        - $ref: "#/components/parameters/excludeVariantsParameter"
        - $ref: "#/components/parameters/localeParameter"
        # SiteContext (x-fabric-tenant-id or x-fabric-stage), Authorization
      responses:
        "200":
          $ref: "#/components/responses/getByIdWithExclusions200Response"
        "400":
          $ref: "#/components/responses/badRequest"
        "401":
          $ref: "#/components/responses/notAuthorized"
        "403":
          $ref: "#/components/responses/forbidden"
        "404":
          $ref: "#/components/responses/notFound"
        "413":
          $ref: "#/components/responses/payloadLimitExceededError"
        "500":
          $ref: "#/components/responses/internalServerError"

  /published-products/skus/{sku}/variants:
    get:
      tags:
        - Published Products By SKU
      summary: Get Variants of Published Products by SKU
      description: "Variants are different versions of a product with different sizes, colors, or materials. For example, there are 12 variants of 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 shoppers more options. This endpoint gets a paginated response of variants of a published product by SKU.  **Note**:<br /> 1. You can refine results by specifying `offset` and `limit`. When they're not specified, by default you'll get up to 10 records. <br /> 2. If you don't have product SKU, use the corresponding item ID-based or product ID-based endpoints."
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
        - $ref: "#/components/parameters/skuPathParameter"
        - $ref: "#/components/parameters/localeParameter"
        - $ref: "#/components/parameters/limit"
        - $ref: "#/components/parameters/offset"
      responses:
        "200":
          $ref: "#/components/responses/getVariantsByProductId200Response"
        "400":
          $ref: "#/components/responses/badRequest"
        "401":
          $ref: "#/components/responses/notAuthorized"
        "403":
          $ref: "#/components/responses/forbidden"
        "404":
          $ref: "#/components/responses/notFound"
        "413":
          $ref: "#/components/responses/payloadLimitExceededError"
        "500":
          $ref: "#/components/responses/internalServerError"

  /published-products/skus/{sku}/bundle-products:
    get:
      tags:
        - Published Products By SKU
      summary: Get Bundle Products by Bundle SKU
      description: "A 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 published products in a bundle by bundle SKU.  **Note**: <br />1. You can refine the results by specifying `offset` and `limit`. 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 item ID-based or product ID-based endpoints."
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
        - $ref: "#/components/parameters/skuPathParameter"
        - $ref: "#/components/parameters/localeParameter"
        - $ref: "#/components/parameters/limit"
        - $ref: "#/components/parameters/offset"
      responses:
        "200":
          $ref: "#/components/responses/getBundledProductsByProductId200Respon\
                se"
        "400":
          $ref: "#/components/responses/badRequest"
        "401":
          $ref: "#/components/responses/notAuthorized"
        "403":
          $ref: "#/components/responses/forbidden"
        "404":
          $ref: "#/components/responses/notFound"
        "413":
          $ref: "#/components/responses/payloadLimitExceededError"
        "500":
          $ref: "#/components/responses/internalServerError"

  /published-products/skus/{sku}/collections:
    get:
      tags:
        - Published Products By SKU
      summary: Get Collections by Product SKU
      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. This endpoint gets the collection details of a published product by ID. You can refine your search results by specifying query parameters - `collectionIds` and `collectionRootName`.  **Note**: If you don't have SKU, use the corresponding item ID-based or product ID-based endpoints."
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
        - $ref: "#/components/parameters/skuPathParameter"
        - $ref: "#/components/parameters/collectionIds"
        - $ref: "#/components/parameters/collectionRootNames"
        - $ref: "#/components/parameters/localeParameter"
        - $ref: "#/components/parameters/limit"
        - $ref: "#/components/parameters/offset"
      responses:
        "200":
          $ref: "#/components/responses/getCollectionsByProductId200Response"
        "400":
          $ref: "#/components/responses/badRequest"
        "401":
          $ref: "#/components/responses/notAuthorized"
        "403":
          $ref: "#/components/responses/forbidden"
        "404":
          $ref: "#/components/responses/notFound"
        "413":
          $ref: "#/components/responses/payloadLimitExceededError"
        "500":
          $ref: "#/components/responses/internalServerError"

  /published-products/skus:
    get:
      tags:
        - Published Products By SKU
      summary: Get Multiple Published Products by SKUs
      description: "Shoppers may want to view the products they've already identified or bookmarked, or you want to promote a particular set of products as part of promotions. This endpoint gets multiple published products based on `skus` (comma-separated values) and is useful to show product list (up to 25 products) on your Storefront.  **Note**: <br />1. Using the examples you can see separate response for items, variants, and bundles. <br /> 2. If you don't have product SKU, use the corresponding item ID-based or product ID-based endpoints."
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
        - $ref: "#/components/parameters/skusParameter"
        - $ref: "#/components/parameters/excludeVariantsParameter"
        - $ref: "#/components/parameters/excludeCategoriesParameter"
        - $ref: "#/components/parameters/excludeCollectionsParameter"
        - $ref: "#/components/parameters/excludeBundleProductsParameter"
        - $ref: "#/components/parameters/localeParameter"
        - $ref: "#/components/parameters/limit"
        - $ref: "#/components/parameters/offset"
      responses:
        "200":
          $ref: "#/components/responses/getByIdsWithExclusions200Response"
        "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"


  /published-products/itemIds/{itemId}:
    get:
      tags:
        - Published Products By itemId
      summary: Get Published Product by itemId
      description: "Your Storefront must display all the relevant information for shoppers to help them make an informed purchase decision. This endpoint gets details of a published product (item, bundle, or variant) by item ID, which can be used to display product details on your Storefront. **Note**: If you don't have item ID, use the corresponding product ID-based or SKU-based endpoints."
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
        - $ref: "#/components/parameters/excludeBundleProductsParameter"
        - $ref: "#/components/parameters/excludeCollectionsParameter"
        - $ref: "#/components/parameters/excludeCategoriesParameter"
        - $ref: "#/components/parameters/excludeVariantsParameter"
        - $ref: "#/components/parameters/localeParameter"
        - $ref: "#/components/parameters/itemIdPathParameter"
      responses:
        "200":
          $ref: "#/components/responses/getByIdWithExclusions200Response"
        "400":
          $ref: "#/components/responses/badRequest"
        "401":
          $ref: "#/components/responses/notAuthorized"
        "403":
          $ref: "#/components/responses/forbidden"
        "404":
          $ref: "#/components/responses/notFound"
        "413":
          $ref: "#/components/responses/payloadLimitExceededError"
        "500":
          $ref: "#/components/responses/internalServerError"

  /published-products/itemIds/{itemId}/variants:
    get:
      tags:
        - Published Products By itemId
      summary: Get Variants of Published Product by itemId
      description: "Variants are the different versions of a product with different sizes, colors, or materials. For example, there are 12 variants of 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 shoppers more options. This endpoint gets a paginated list of variants of a published product, by item ID.  **Note**:<br /> 1. You can narrow down the search results by specifying `offset` and `limit`. When they're not specified, by default you'll get up to 10 records. <br /> 2. If you don't have item ID, use the corresponding product ID-based or SKU-based endpoints."
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
        - $ref: "#/components/parameters/itemIdPathParameter"
        - $ref: "#/components/parameters/localeParameter"
        - $ref: "#/components/parameters/limit"
        - $ref: "#/components/parameters/offset"
      responses:
        "200":
          $ref: "#/components/responses/getVariantsByProductId200Response"
        "400":
          $ref: "#/components/responses/badRequest"
        "401":
          $ref: "#/components/responses/notAuthorized"
        "403":
          $ref: "#/components/responses/forbidden"
        "404":
          $ref: "#/components/responses/notFound"
        "413":
          $ref: "#/components/responses/payloadLimitExceededError"
        "500":
          $ref: "#/components/responses/internalServerError"

  /published-products/itemIds/{itemId}/bundle-products:
    get:
      tags:
        - Published Products By itemId
      summary: Get Products in a Bundle by itemId
      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 published products in a bundle by bundle ID. You can refine your search results by specifying query parameters `excludeBundleProducts`, `excludeCollections`, `excludeCategories` and `excludeVariants` **Note**: <br />1. You can refine the results by specifying `offset` and `limit`. When they're not specified, by default, you'll get up to 10 products. <br /> 2. If you don't have item ID, use the corresponding product ID-based or SKU-based endpoints."
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
        - $ref: "#/components/parameters/itemIdPathParameter"
        - $ref: "#/components/parameters/localeParameter"
        - $ref: "#/components/parameters/limit"
        - $ref: "#/components/parameters/offset"
      responses:
        "200":
          $ref: "#/components/responses/getBundledProductsByProductId200Respon\
                se"
        "400":
          $ref: "#/components/responses/badRequest"
        "401":
          $ref: "#/components/responses/notAuthorized"
        "403":
          $ref: "#/components/responses/forbidden"
        "404":
          $ref: "#/components/responses/notFound"
        "413":
          $ref: "#/components/responses/payloadLimitExceededError"
        "500":
          $ref: "#/components/responses/internalServerError"

  /published-products/itemIds/{itemId}/collections:
    get:
      tags:
        - Published Products By itemId
      summary: Get Collections by Product itemId
      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. This endpoint gets collection details of a published product by ID. You can refine your search results by specifying query parameters - `collectionIds` and `collectionRootName` **Note**: <br />1. You can narrow down the results by specifying `offset` and `limit`. When they're not specified, by default, you'll get up to 10 products. <br /> 2. If you don't have item ID, use the corresponding product ID-based or SKU-based endpoints."
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
        - $ref: "#/components/parameters/itemIdPathParameter"
        - $ref: "#/components/parameters/collectionIds"
        - $ref: "#/components/parameters/collectionRootNames"
        - $ref: "#/components/parameters/localeParameter"
        - $ref: "#/components/parameters/limit"
        - $ref: "#/components/parameters/offset"
      responses:
        "200":
          $ref: "#/components/responses/getCollectionsByProductId200Response"
        "400":
          $ref: "#/components/responses/badRequest"
        "401":
          $ref: "#/components/responses/notAuthorized"
        "403":
          $ref: "#/components/responses/forbidden"
        "404":
          $ref: "#/components/responses/notFound"
        "413":
          $ref: "#/components/responses/payloadLimitExceededError"
        "500":
          $ref: "#/components/responses/internalServerError"

  /published-products/itemIds:
    get:
      tags:
        - Published Products By itemId
      summary: Get Products by itemIds
      description: "Shoppers may want to view the products they've already identified or bookmarked, or you may want to promote a particular set of products as part of promotions. This endpoint get details of published products with or without variants, categories, bundle products, and collections. You can specify multiple comma-separated product `itemIds`. Using this endpoint, you can show up to 25 products on your Storefront.  **Note**: If you don't have item ID, use the corresponding product ID-based or SKU-based endpoints."
      parameters:
        - $ref: '#/components/parameters/x-fabric-tenant-id'
        - $ref: '#/components/parameters/x-fabric-request-id'
        - $ref: "#/components/parameters/itemIdsParameter"
        - $ref: "#/components/parameters/excludeVariantsParameter"
        - $ref: "#/components/parameters/excludeCategoriesParameter"
        - $ref: "#/components/parameters/excludeCollectionsParameter"
        - $ref: "#/components/parameters/excludeBundleProductsParameter"
        - $ref: "#/components/parameters/localeParameter"
        - $ref: "#/components/parameters/limit"
        - $ref: "#/components/parameters/offset"
      responses:
        "200":
          $ref: "#/components/responses/getByIdsWithExclusions200Response"
        "400":
          $ref: "#/components/responses/badRequest"
        "401":
          $ref: "#/components/responses/notAuthorized"
        "403":
          $ref: "#/components/responses/forbidden"
        "413":
          $ref: "#/components/responses/payloadLimitExceededError"
        "500":
          $ref: "#/components/responses/internalServerError"

components:
  securitySchemes:
    authorization:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: S2S access token (JWT) from fabric Identity service (during Login)

  responses:
    getByIdsWithExclusions200Response:
      description: OK
      headers:
        x-fabric-request-id:
          $ref: '#/components/headers/x-fabric-request-id-header'
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                $ref: "#/components/schemas/publishedProducts"
              offset:
                $ref: "#/components/schemas/offset"
              limit:
                $ref: "#/components/schemas/limit"
              count:
                $ref: "#/components/schemas/count"


    getByIdWithExclusions200Response:
      description: OK
      headers:
        x-fabric-request-id:
          $ref: '#/components/headers/x-fabric-request-id-header'
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/publishedProduct"


    getVariantsByProductId200Response:
      description: OK
      headers:
        x-fabric-request-id:
          $ref: '#/components/headers/x-fabric-request-id-header'
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                $ref: "#/components/schemas/variants"
              offset:
                $ref: "#/components/schemas/offset"
              limit:
                $ref: "#/components/schemas/limit"
              count:
                $ref: "#/components/schemas/count"


    getBundledProductsByProductId200Response:
      description: OK
      headers:
        x-fabric-request-id:
          $ref: '#/components/headers/x-fabric-request-id-header'
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                $ref: "#/components/schemas/bundleProducts"
              offset:
                $ref: "#/components/schemas/offset"
              limit:
                $ref: "#/components/schemas/limit"
              count:
                $ref: "#/components/schemas/count"

    getCollectionsByProductId200Response:
      description: OK
      headers:
        x-fabric-request-id:
          $ref: '#/components/headers/x-fabric-request-id-header'
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                $ref: "#/components/schemas/collections"
              offset:
                $ref: "#/components/schemas/offset"
              limit:
                $ref: "#/components/schemas/limit"
              count:
                $ref: "#/components/schemas/count"

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

    forbidden:
      description: User isn't allowed to perform the action
      headers:
        x-fabric-request-id:
          $ref: '#/components/headers/x-fabric-request-id-header'
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/genericError"
          example:
            type: REQUEST_DENIED
            message: User doesn't have the required permission

    badRequest:
      description: Request is invalid or malformed
      headers:
        x-fabric-request-id:
          $ref: '#/components/headers/x-fabric-request-id-header'
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/genericError"

    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: Internal Server Error
            errors:
              - type: SERVER_ERROR
                message: Internal Server Error

    notFound:
      description: Not found
      headers:
        x-fabric-request-id:
          $ref: '#/components/headers/x-fabric-request-id-header'
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/notFound"

    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:
            message: Payload exceeds maximum configured size
            type: Payload limit exceeded
            errors:
              - type: PAYLOAD_LIMIT_EXCEEDED_ERROR
                message: Payload exceeds maximum configured size

  parameters:

    idPathParameter:
      name: id
      in: path
      example: 33184766610c0e32a86d8759
      description: 24-character system-generated product ID.
      schema:
        type: string
      required: true

    itemIdPathParameter:
      name: itemId
      in: path
      example: 1682313863
      description: Unique identifier of an item, a variant or a bundle
      schema:
        type: number
        format: int32
      required: true

    skuPathParameter:
      name: sku
      in: path
      example: QWERTASB
      description: Product SKU
      schema:
        type: string
      required: true

    localeParameter:
      name: locale
      in: query
      example: en_US
      description: Locale name
      schema:
        type: string
      required: true

    idsParameter:
      name: ids
      in: query
      example: "33184766610c0e32a86d8759, 55184766610c0e32a86d8722"
      description: Comma-separated list of product IDs
      schema:
        type: string
      required: true
      allowReserved: true

    itemIdsParameter:
      name: itemIds
      in: query
      example: "1682327795, 1682327796"
      description: "Comma-separated list of Item IDs.  **Note**: The query parameters needs to be encoded."
      schema:
        type: string
      required: true
      allowReserved: true

    skusParameter:
      name: skus
      in: query
      example: ZXCVBNM56DDFFVVV, ASDFGHJK56BDFFVMA
      description: Comma-separated product SKUs
      schema:
        type: string
      required: true
      allowReserved: true

    excludeBundleProductsParameter:
      name: excludeBundleProducts
      in: query
      example: false
      description: "true: Response shouldn't include products of the bundle <br /> false: Response should include products of the bundle **Note**: Default value is false"
      schema:
        type: boolean
      required: false

    excludeCollectionsParameter:
      name: excludeCollections
      in: query
      example: false
      description: "true: Response shouldn't include collection or hierarchy details <br /> false: Response should include collection or hierarchy details **Note**: Default value is false"
      schema:
        type: boolean
      required: false

    excludeCategoriesParameter:
      name: excludeCategories
      in: query
      example: false
      description: "true: Response shouldn't include categories or hierarchy details <br /> false: Response should include categories or hierarchy details **Note**: Default value is false"
      schema:
        type: boolean
      required: false

    excludeVariantsParameter:
      name: excludeVariants
      in: query
      example: false
      description: "true: Response shouldn't include categories or hierarchy details <br /> false: Response should include categories or hierarchy detail **Note**: Default value is false"
      schema:
        type: boolean
      required: false

    collectionIds:
      name: collectionIds
      in: query
      description: Comma-separated collection IDs
      example: SDUIGASDKHQWUIG, 871623568YUASV12
      schema:
        type: string
      required: false
      allowReserved: true

    collectionRootNames:
      name: collectionRootNames
      in: query
      description: Comma-separated list of root collection names. For example, Bose Frames Alto is both a Fashion and an Electronics item.
      example: Electronics, Fashion
      schema:
        type: string
      required: false
      allowReserved: true

    limit:
      in: query
      name: limit
      description: Maximum number of records per page
      schema:
        type: integer
        format: int32
        default: 10
        example: 20

    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: 2
      required: false

    x-fabric-tenant-id:
      name: x-fabric-tenant-id
      in: header
      description: A header used by fabric to identify the tenant making the request. You must include tenant id in the authentication header for an API request to access any of fabric’s endpoints. You can retrieve the tenant id , which is also called account id, from [Copilot](/v3/platform/settings/account-details/getting-the-account-id). This header is required. 
      schema:
        type: string
        example: '517fa9dfd42d8b00g1o3k312'

    x-fabric-request-id:
      name: x-fabric-request-id
      in: header
      description: Unique request ID
      schema:
        type: string
        example: 263e731c-45c8-11ed-b878-0242ac120002
      required: false

  headers:
    x-fabric-request-id-header:
      description: Unique request ID
      schema:
        type: string
        example: 263e731c-45c8-11ed-b878-0242ac120002

  schemas:
    publishedProducts:
      type: array
      items:
        $ref: "#/components/schemas/publishedProduct"


    publishedProduct:
      allOf:
        - $ref: "#/components/schemas/productSkuId"
        - $ref: "#/components/schemas/productId"
        - $ref: "#/components/schemas/itemId"
        - $ref: "#/components/schemas/productType"
        - $ref: "#/components/schemas/categoryId"
      description: Details of published product
      type: object
      properties:
        attributes:
          $ref: "#/components/schemas/productAttributesArray"
        localizedProperties:
          $ref: "#/components/schemas/productAttributesArray"
        variants:
          $ref: "#/components/schemas/variants"
        bundleProducts:
          $ref: "#/components/schemas/bundleProducts"
        categories:
          $ref: "#/components/schemas/categories"
        collections:
          $ref: "#/components/schemas/collections"


    bundleProductsQuantity:
      type: object
      description: Number of published products in a bundle
      properties:
        quantity:
          type: integer
          format: int32
          description: Product quantity
          example: 2

    isRootFlag:
      type: object
      description: Indicates if it's a root flag.
      properties:
        isRoot:
          type: boolean
          description: "true: It's a root flag <br /> false: It's not a root flag. "
          example: true

    variants:
      type: array
      items:
        $ref: "#/components/schemas/variant"

    variant:
      allOf:
        - $ref: "#/components/schemas/productSkuId"
        - $ref: "#/components/schemas/productId"
        - $ref: "#/components/schemas/itemId"
      description: "Variants of a published product. For example, Phone base model is 128 GB. So, the 256GB model becomes its variant."
      type: object
      properties:
        attributes:
          $ref: "#/components/schemas/productAttributesArray"
        localizedProperties:
          $ref: "#/components/schemas/productAttributesArray"

    collections:
      type: array
      items:
        $ref: "#/components/schemas/collection"

    collection:
      description: Collection is an alternative organization of the original category tree. They're used to support various use cases for a Storefront. For example, Bose Frames Alto could have their main grouping as Fashion and secondary grouping as Electronics.
      allOf:
        - $ref: "#/components/schemas/name"
        - $ref: "#/components/schemas/productId"
      type: object
      properties:
        hierarchy:
          type: array
          items:
            $ref: "#/components/schemas/category"

    categories:
      type: array
      items:
        $ref: "#/components/schemas/category"

    category:
      description: Original hierarchical tree of product organization and grouping. For example, an iPhone could be under Electronics->SmartPhones->IOS_devices.
      allOf:
        - $ref: "#/components/schemas/productId"
        - $ref: "#/components/schemas/categoryType"
        - $ref: "#/components/schemas/isRootFlag"
      type: object
      properties:
        localizedProperties:
          $ref: "#/components/schemas/productAttributesArray"
        attributes:
          $ref: "#/components/schemas/productAttributesArray"

    bundleProducts:
      type: array
      items:
        $ref: "#/components/schemas/bundleProduct"

    bundleProduct:
      description: Bundles are combo of two or more products sold exclusively together or as individual products (depending on the configuration). For example, an iPhone and a 20W USB-C Power Adapter becomes a bundle that can be sold together to offer value to shoppers.
      allOf:
        - $ref: "#/components/schemas/bundleProductsQuantity"
        - $ref: "#/components/schemas/productSkuId"
        - $ref: "#/components/schemas/productId"
        - $ref: "#/components/schemas/itemId"
      type: object
      properties:
        attributes:
          $ref: "#/components/schemas/productAttributesArray"
        localizedProperties:
          $ref: "#/components/schemas/productAttributesArray"

    productId:
      type: object
      description: Depending on the context, this is a 24-character system-generated ID for item, attribute, variant, bundle, or category.
      properties:
        id:
          type: string
          example: 5f7329dfd5288b0011332366
          description: 24-character system-generated product ID

    itemId:
      type: object
      description: Unique identifier of item
      properties:
        itemId:
          type: number
          format: int32
          example: 1682313863
          description: Unique identifier of an item, a variant or a bundle

    limit:
      type: integer
      format: int32
      default: 10
      description: Maximum number of records per page
      example: 10

    offset:
      type: integer
      format: int32
      default: 0
      description: Number of records to skip before returning records. For example, `offset=20, limit=10` returns records 21-30.
      example: 10

    count:
      type: integer
      format: int32
      description: Total number of records in the response
      example: 100

    productSkuId:
      type: object
      description: Unique Store Keeping Unit (SKU) of product
      properties:
        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: '^[^;=]*$'

    name:
      type: object
      description: Entity name
      properties:
        name:
          type: string
          example: Demo Name
          description: Based on the context, this is the name of item, attribute, variant, bundle or category.

    productType:
      type: object
      description: Product type
      properties:
        type:
          type: string
          enum: [ "ITEM", "VARIANT", "BUNDLE" ]
          description: Product type
          example: ITEM

    categoryType:
      type: object
      description: Category type
      properties:
        type:
          type: string
          enum: [ "PRIMARY", "ALTERNATE" ]
          description: Category type
          example: PRIMARY

    categoryId:
      type: object
      description: Category ID
      properties:
        categoryId:
          type: string
          description: 24-character system-generated category ID
          example: 34e7329dfd5288b0011332366
    id:
      type: string
      description: 24-character system-generated entity ID. Depending on context, entity could be item, attribute, variant, bundle or category.
      example: 5f7329dfd5288b0011332322

    productAttribute:
      type: object
      description: Details of product attributes
      properties:
        id:
          $ref: "#/components/schemas/id"
        name:
          type: string
          example: color
          description: Attribute name that's unique for a merchant
        value:
          anyOf:
            - $ref: "#/components/schemas/booleanSchema"
            - $ref: "#/components/schemas/stringSchema"
            - $ref: "#/components/schemas/doubleSchema"
            - $ref: "#/components/schemas/integerSchema"
            - $ref: "#/components/schemas/arrayOfStrings"
          description: Attribute value
          example: blue
        type:
          type: string
          description: Attribute type
          example: string

    productAttributesArray:
      type: array
      items:
        $ref: "#/components/schemas/productAttribute"

    notFound:
      type: object
      description: Error message for 404 error code
      properties:
        type:
          type: string
          description: Placeholder 404 error type
          example: NOT_FOUND
        message:
          type: string
          description: Requested product not found
          example: Provided ID doesn't exist

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

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

    arrayOfStrings:
      type: array
      items:
        $ref: "#/components/schemas/stringSchema"

    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.0

    genericError:
      type: object
      properties:
        message:
          type: string
          description: Place holder error message for all 4xx, 5xx errors
          example: Request was invalid
        type:
          type: string
          description: Place holder error type for all 4xx, 5xx errors
          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/create product

security:
  - authorization: []
