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

# Get Initial Collection Products

> Returns all products in a collection, sorted according to what should be initially displayed in the Collection view.
IE if the collection is completely untouched, without a Depict version, the current Shopify order.
Or if there is at least one Depict version, sorted according to the currently saved main version, without any changes.



## OpenAPI

````yaml /api-reference/openapi/lite.json get /collections/{collection_id}/initial-products
openapi: 3.1.0
info:
  title: Depict Lite API
  version: 1.0.0
  description: >-
    REST API behind Depict Lite, the native Shopify app: onboarding,
    collections, boost & bury, dashboards, A/B testing and multi-store
    management. Endpoints are served under the /api/lite prefix and require an
    Auth0-issued bearer token.
servers:
  - url: /api/lite
security: []
paths:
  /collections/{collection_id}/initial-products:
    get:
      summary: Get Initial Collection Products
      description: >-
        Returns all products in a collection, sorted according to what should be
        initially displayed in the Collection view.

        IE if the collection is completely untouched, without a Depict version,
        the current Shopify order.

        Or if there is at least one Depict version, sorted according to the
        currently saved main version, without any changes.
      operationId: >-
        get_initial_collection_products_collections__collection_id__initial_products_get
      parameters:
        - name: collection_id
          in: path
          required: true
          schema:
            type: string
            title: Collection Id
        - name: merchant_id
          in: query
          required: true
          schema:
            type: string
            title: Merchant Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LiteCollectionProductDto'
                title: >-
                  Response Get Initial Collection Products Collections 
                  Collection Id  Initial Products Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - Auth0: []
components:
  schemas:
    LiteCollectionProductDto:
      properties:
        main_product_id:
          type: string
          title: Main Product Id
        title:
          type: string
          title: Title
        handle:
          type: string
          title: Handle
        images:
          items:
            $ref: '#/components/schemas/ShopifyImage'
          type: array
          title: Images
        price:
          anyOf:
            - type: number
            - type: 'null'
          title: Price
        status:
          $ref: '#/components/schemas/ProductStatus'
        in_stock:
          type: boolean
          title: In Stock
        quantity:
          type: integer
          title: Quantity
        badges:
          items:
            oneOf:
              - $ref: '#/components/schemas/OnSaleProductBadge'
              - $ref: '#/components/schemas/OutOfStockProductBadge'
              - $ref: '#/components/schemas/NewInProductBadge'
              - $ref: '#/components/schemas/BestsellerProductBadge'
              - $ref: '#/components/schemas/SlowMoverProductBadge'
              - $ref: '#/components/schemas/TrendingProductBadge'
              - $ref: '#/components/schemas/FewVariantsAvailableProductBadge'
            discriminator:
              propertyName: type
              mapping:
                bestseller:
                  $ref: '#/components/schemas/BestsellerProductBadge'
                few_variants_available:
                  $ref: '#/components/schemas/FewVariantsAvailableProductBadge'
                new_in:
                  $ref: '#/components/schemas/NewInProductBadge'
                on_sale:
                  $ref: '#/components/schemas/OnSaleProductBadge'
                out_of_stock:
                  $ref: '#/components/schemas/OutOfStockProductBadge'
                slow_mover:
                  $ref: '#/components/schemas/SlowMoverProductBadge'
                trending:
                  $ref: '#/components/schemas/TrendingProductBadge'
          type: array
          title: Badges
        n_sold_current_period:
          type: integer
          title: N Sold Current Period
        n_sold_last_7_days:
          type: integer
          title: N Sold Last 7 Days
        clicks_current_period:
          type: integer
          title: Clicks Current Period
        skus:
          items:
            type: string
          type: array
          title: Skus
        created_at:
          type: string
          format: date-time
          title: Created At
        published_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Published At
        variants:
          items:
            $ref: '#/components/schemas/LiteVariant'
          type: array
          title: Variants
        sort_index:
          type: integer
          title: Sort Index
          description: The sort order of the product in the collection, disregarding pins
          default: 0
        applied_boost_bury_rule:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/BadgeBoostBuryRule'
                - $ref: '#/components/schemas/CollectionBoostBuryRule'
                - $ref: '#/components/schemas/TagBoostBuryRule'
              discriminator:
                propertyName: type
                mapping:
                  badge:
                    $ref: '#/components/schemas/BadgeBoostBuryRule'
                  collection:
                    $ref: '#/components/schemas/CollectionBoostBuryRule'
                  tag:
                    $ref: '#/components/schemas/TagBoostBuryRule'
            - type: 'null'
          title: Applied Boost Bury Rule
      type: object
      required:
        - main_product_id
        - title
        - handle
        - images
        - price
        - status
        - in_stock
        - quantity
        - badges
        - n_sold_current_period
        - n_sold_last_7_days
        - clicks_current_period
        - skus
        - created_at
        - published_at
        - variants
        - sort_index
        - applied_boost_bury_rule
      title: LiteCollectionProductDto
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ShopifyImage:
      properties:
        id:
          type: string
          title: Id
        url:
          type: string
          title: Url
        width:
          anyOf:
            - type: integer
            - type: 'null'
          title: Width
        height:
          anyOf:
            - type: integer
            - type: 'null'
          title: Height
        alt:
          anyOf:
            - type: string
            - type: 'null'
          title: Alt
      additionalProperties: false
      type: object
      required:
        - id
        - url
      title: ShopifyImage
    ProductStatus:
      type: string
      enum:
        - ACTIVE
        - ARCHIVED
        - DRAFT
      title: ProductStatus
    OnSaleProductBadge:
      properties:
        type:
          type: string
          enum:
            - on_sale
          const: on_sale
          title: Type
        sale_percentage:
          type: integer
          title: Sale Percentage
      type: object
      required:
        - type
        - sale_percentage
      title: OnSaleProductBadge
    OutOfStockProductBadge:
      properties:
        type:
          type: string
          enum:
            - out_of_stock
          const: out_of_stock
          title: Type
      type: object
      required:
        - type
      title: OutOfStockProductBadge
    NewInProductBadge:
      properties:
        type:
          type: string
          enum:
            - new_in
          const: new_in
          title: Type
        published_at:
          type: string
          format: date-time
          title: Published At
      type: object
      required:
        - type
        - published_at
      title: NewInProductBadge
    BestsellerProductBadge:
      properties:
        value:
          type: number
          title: Value
        n_days:
          type: integer
          title: N Days
        type:
          type: string
          enum:
            - bestseller
          const: bestseller
          title: Type
      type: object
      required:
        - value
        - n_days
        - type
      title: BestsellerProductBadge
    SlowMoverProductBadge:
      properties:
        value:
          type: number
          title: Value
        n_days:
          type: integer
          title: N Days
        type:
          type: string
          enum:
            - slow_mover
          const: slow_mover
          title: Type
      type: object
      required:
        - value
        - n_days
        - type
      title: SlowMoverProductBadge
    TrendingProductBadge:
      properties:
        value:
          type: number
          title: Value
        n_days:
          type: integer
          title: N Days
        type:
          type: string
          enum:
            - trending
          const: trending
          title: Type
      type: object
      required:
        - value
        - n_days
        - type
      title: TrendingProductBadge
    FewVariantsAvailableProductBadge:
      properties:
        type:
          type: string
          enum:
            - few_variants_available
          const: few_variants_available
          title: Type
        variant_options_available:
          items:
            additionalProperties:
              type: string
            type: object
          type: array
          title: Variant Options Available
        n_variants_total:
          type: integer
          title: N Variants Total
      type: object
      required:
        - type
        - variant_options_available
        - n_variants_total
      title: FewVariantsAvailableProductBadge
    LiteVariant:
      properties:
        id:
          type: string
          title: Id
        image_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Image Url
        selected_options:
          items:
            $ref: '#/components/schemas/VariantOption'
          type: array
          title: Selected Options
      type: object
      required:
        - id
        - image_url
        - selected_options
      title: LiteVariant
    BadgeBoostBuryRule:
      properties:
        strength:
          type: integer
          title: Strength
        type:
          type: string
          enum:
            - badge
          const: badge
          title: Type
          default: badge
        badge:
          $ref: '#/components/schemas/ProductBadgeType'
      type: object
      required:
        - strength
        - badge
      title: BadgeBoostBuryRule
    CollectionBoostBuryRule:
      properties:
        strength:
          type: integer
          title: Strength
        type:
          type: string
          enum:
            - collection
          const: collection
          title: Type
          default: collection
        collection_id:
          type: string
          title: Collection Id
      type: object
      required:
        - strength
        - collection_id
      title: CollectionBoostBuryRule
    TagBoostBuryRule:
      properties:
        strength:
          type: integer
          title: Strength
        type:
          type: string
          enum:
            - tag
          const: tag
          title: Type
          default: tag
        tags:
          items:
            type: string
          type: array
          title: Tags
      type: object
      required:
        - strength
        - tags
      title: TagBoostBuryRule
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    VariantOption:
      properties:
        name:
          type: string
          title: Name
        value:
          type: string
          title: Value
      type: object
      required:
        - name
        - value
      title: VariantOption
    ProductBadgeType:
      type: string
      enum:
        - on_sale
        - out_of_stock
        - new_in
        - bestseller
        - slow_mover
        - few_variants_available
        - trending
      title: ProductBadgeType
  securitySchemes:
    Auth0:
      type: oauth2
      flows:
        authorizationCode:
          scopes:
            openid: OpenID Connect
            profile: User profile
            email: User email
          authorizationUrl: https://depict.eu.auth0.com/oauth/authorize
          tokenUrl: https://depict.eu.auth0.com/oauth/token
      x-tokenName: id_token

````