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

# Get Top Selling Items

> Get top selling items based on the number of times they were purchased.
Returns the top items sorted by purchase count.



## OpenAPI

````yaml get /dashboard/top-selling-items
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /dashboard/top-selling-items:
    get:
      tags:
        - provider
        - dashboard
      summary: Get Top Selling Items
      description: |-
        Get top selling items based on the number of times they were purchased.
        Returns the top items sorted by purchase count.
      operationId: get_top_selling_items_dashboard_top_selling_items_get
      parameters:
        - name: TENANT
          in: header
          required: true
          schema:
            type: string
            title: Tenant
          description: The tenant you are making this request on behalf of
        - name: API-KEY
          in: header
          required: true
          schema:
            type: string
            title: Api-Key
          description: Your api key
        - name: page
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            default: 1
            title: Page
        - name: per_page
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            default: 10
            title: Per Page
        - name: sort_by
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Sort By
        - name: sort_direction
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                enum:
                  - asc
                  - desc
              - type: 'null'
            title: Sort Direction
        - name: location_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Location Id
        - name: start_date
          in: query
          required: true
          schema:
            type: string
            title: Start Date
        - name: end_date
          in: query
          required: true
          schema:
            type: string
            title: End Date
        - name: location_ids
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            title: Location Ids
        - name: payment_mediums
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            title: Payment Mediums
        - name: tz
          in: query
          required: true
          schema:
            type: string
            title: Tz
        - name: limit
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            default: 5
            title: Limit
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TopSellingItem'
                title: Response Get Top Selling Items Dashboard Top Selling Items Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    TopSellingItem:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        price:
          type: number
          title: Price
        totalQuantity:
          type: integer
          title: Totalquantity
        numberOfPurchases:
          type: integer
          title: Numberofpurchases
        totalRevenue:
          type: number
          title: Totalrevenue
        averageQuantityPerPurchase:
          type: number
          title: Averagequantityperpurchase
      type: object
      required:
        - id
        - name
        - price
        - totalQuantity
        - numberOfPurchases
        - totalRevenue
        - averageQuantityPerPurchase
      title: TopSellingItem
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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

````