> ## 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 Data Sorted Collections



## OpenAPI

````yaml /api-reference/openapi/lite.json post /collections/data-sorted-by
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/data-sorted-by:
    post:
      summary: Get Data Sorted Collections
      operationId: get_data_sorted_collections_collections_data_sorted_by_post
      parameters:
        - name: merchant_id
          in: query
          required: true
          schema:
            type: string
            title: Merchant Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetDataSortedPaginatedCollectionsRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPaginatedDataCollectionsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - Auth0: []
components:
  schemas:
    GetDataSortedPaginatedCollectionsRequest:
      properties:
        offset:
          type: integer
          title: Offset
          default: 0
        page_size:
          type: integer
          title: Page Size
          default: 50
        query:
          anyOf:
            - type: string
            - type: 'null'
          title: Query
        order_by:
          allOf:
            - $ref: '#/components/schemas/CollectionDataOrderBy'
          default: top_views
        from_date:
          type: string
          format: date
          title: From Date
        to_date:
          type: string
          format: date
          title: To Date
        reverse:
          type: boolean
          title: Reverse
          default: false
        filter_by:
          anyOf:
            - $ref: '#/components/schemas/CollectionFilterBy'
            - type: 'null'
      type: object
      required:
        - from_date
        - to_date
      title: GetDataSortedPaginatedCollectionsRequest
    GetPaginatedDataCollectionsResponse:
      properties:
        offset:
          type: integer
          title: Offset
        has_next:
          type: boolean
          title: Has Next
        collections:
          items:
            $ref: '#/components/schemas/LiteDashboardCollectionDto'
          type: array
          title: Collections
      type: object
      required:
        - offset
        - has_next
        - collections
      title: GetPaginatedDataCollectionsResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CollectionDataOrderBy:
      type: string
      enum:
        - top_views
        - top_ctr
        - top_clicks
        - updated_at
        - name_a_z
        - number_of_products
      title: CollectionDataOrderBy
    CollectionFilterBy:
      type: string
      enum:
        - live
        - draft
      title: CollectionFilterBy
    LiteDashboardCollectionDto:
      properties:
        collection_id:
          type: string
          title: Collection Id
        title:
          type: string
          title: Title
        description:
          type: string
          title: Description
        handle:
          type: string
          title: Handle
        image_urls:
          items:
            type: string
          type: array
          title: Image Urls
        shopify_sort_order:
          $ref: '#/components/schemas/CollectionSortOrder'
        sort_order:
          $ref: '#/components/schemas/LiteCollectionSortOrder'
        has_depict_configuration:
          type: boolean
          title: Has Depict Configuration
          description: >-
            'Depict configuration' meaning sort order, pinned products, content
            blocks, etc.
        sync_back_to_shopify:
          type: boolean
          title: Sync Back To Shopify
        unpin_oos:
          type: boolean
          title: Unpin Oos
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
          description: >-
            The last time the Depict configuration for this collection was
            updated
        shopify_updated_at:
          type: string
          format: date-time
          title: Shopify Updated At
        use_collection_specific_boost_bury:
          type: boolean
          title: Use Collection Specific Boost Bury
        main_version:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Main Version
        n_products:
          type: integer
          title: N Products
        n_pinned_main_product_ids:
          anyOf:
            - type: integer
            - type: 'null'
          title: N Pinned Main Product Ids
        product_images:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Product Images
        selected_period_data:
          $ref: '#/components/schemas/LiteDashboardCollectionData'
      type: object
      required:
        - collection_id
        - title
        - description
        - handle
        - image_urls
        - shopify_sort_order
        - sort_order
        - has_depict_configuration
        - sync_back_to_shopify
        - unpin_oos
        - shopify_updated_at
        - use_collection_specific_boost_bury
        - main_version
        - n_products
        - n_pinned_main_product_ids
        - selected_period_data
      title: LiteDashboardCollectionDto
    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
    CollectionSortOrder:
      type: string
      enum:
        - ALPHA_ASC
        - ALPHA_DESC
        - BEST_SELLING
        - CREATED
        - CREATED_DESC
        - MANUAL
        - PRICE_ASC
        - PRICE_DESC
      title: CollectionSortOrder
    LiteCollectionSortOrder:
      type: string
      enum:
        - ALPHA_ASC
        - ALPHA_DESC
        - BEST_SELLING
        - TRENDING
        - CREATED
        - CREATED_DESC
        - PRICE_ASC
        - PRICE_DESC
        - STOCK_DESC
        - CLICKS_DESC
        - MANUAL
      title: LiteCollectionSortOrder
    LiteDashboardCollectionData:
      properties:
        clicks:
          type: integer
          title: Clicks
        views:
          type: integer
          title: Views
        percentage_of_max_clicks:
          type: number
          title: Percentage Of Max Clicks
        percentage_of_total_clicks:
          type: number
          title: Percentage Of Total Clicks
        clickthrough_rate:
          anyOf:
            - type: number
            - type: 'null'
          title: Clickthrough Rate
      type: object
      required:
        - clicks
        - views
        - percentage_of_max_clicks
        - percentage_of_total_clicks
        - clickthrough_rate
      title: LiteDashboardCollectionData
  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

````