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

# Get Collections by Product SKU

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



## OpenAPI

````yaml published-product.openapi get /published-products/skus/{sku}/collections
openapi: 3.0.2
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
servers:
  - url: https://api.fabric.inc/v3
    description: Production URL
security:
  - authorization: []
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`).
externalDocs:
  description: Find out more about Product
  url: https://developer.fabric.inc/docs/products-overview
paths:
  /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'
components:
  parameters:
    x-fabric-tenant-id:
      name: x-fabric-tenant-id
      in: header
      description: >-
        A header used by fabric to identify the tenant making the request. You
        must include tenant id in the authentication header for an API request
        to access any of fabric’s endpoints. You can retrieve the tenant id ,
        which is also called account id, from
        [Copilot](/v3/platform/settings/account-details/getting-the-account-id).
        This header is required.
      schema:
        type: string
        example: 517fa9dfd42d8b00g1o3k312
    x-fabric-request-id:
      name: x-fabric-request-id
      in: header
      description: Unique request ID
      schema:
        type: string
        example: 263e731c-45c8-11ed-b878-0242ac120002
      required: false
    skuPathParameter:
      name: sku
      in: path
      example: QWERTASB
      description: Product SKU
      schema:
        type: string
      required: true
    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
    localeParameter:
      name: locale
      in: query
      example: en_US
      description: Locale name
      schema:
        type: string
      required: 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
  responses:
    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'
    badRequest:
      description: Request is invalid or malformed
      headers:
        x-fabric-request-id:
          $ref: '#/components/headers/x-fabric-request-id-header'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/genericError'
    notAuthorized:
      description: 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
    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
    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
  headers:
    x-fabric-request-id-header:
      description: Unique request ID
      schema:
        type: string
        example: 263e731c-45c8-11ed-b878-0242ac120002
  schemas:
    collections:
      type: array
      items:
        $ref: '#/components/schemas/collection'
    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
    limit:
      type: integer
      format: int32
      default: 10
      description: Maximum number of records per page
      example: 10
    count:
      type: integer
      format: int32
      description: Total number of records in the response
      example: 100
    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
    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
    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'
    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.
    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
    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'
    categoryType:
      type: object
      description: Category type
      properties:
        type:
          type: string
          enum:
            - PRIMARY
            - ALTERNATE
          description: Category type
          example: PRIMARY
    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
    productAttributesArray:
      type: array
      items:
        $ref: '#/components/schemas/productAttribute'
    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
    id:
      type: string
      description: >-
        24-character system-generated entity ID. Depending on context, entity
        could be item, attribute, variant, bundle or category.
      example: 5f7329dfd5288b0011332322
    booleanSchema:
      type: boolean
      nullable: true
      description: Sample boolean schema
      example: true
    stringSchema:
      type: string
      nullable: true
      description: Sample string schema
      example: blue
    doubleSchema:
      type: number
      nullable: true
      format: double
      description: Sample double schema
      example: 1
    integerSchema:
      type: integer
      nullable: true
      format: int32
      description: Sample integer schema
      example: 1
    arrayOfStrings:
      type: array
      items:
        $ref: '#/components/schemas/stringSchema'
  securitySchemes:
    authorization:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: S2S access token (JWT) from fabric Identity service (during Login)

````