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

# View sales by channel report

> View sales by channel report



## OpenAPI

````yaml /api-reference/openapi.json post /reports/view/salesByChannel
openapi: 3.0.1
info:
  title: MerchantSpring Public API
  version: 1.0.0
servers:
  - url: https://mm-api.merchantspring.io
    description: Production
  - url: https://mm-api-staging.merchantspring.io
    description: Staging
security: []
tags:
  - name: channel
    x-group: Channel
  - name: content-change
    x-group: Content Change
  - name: custom-group
    x-group: Custom Group
  - name: order
    x-group: Order
  - name: report
    x-group: Report
  - name: tag
    x-group: Tag
  - name: profitability
    x-group: Profitability
paths:
  /reports/view/salesByChannel:
    post:
      tags:
        - report
      summary: View sales by channel report
      description: View sales by channel report
      operationId: viewSalesByChannelReport
      requestBody:
        description: Sales by channel report criteria
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ViewSalesByChannelRequest'
        required: true
      responses:
        '200':
          description: Successful operation
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SalesByChannelResponse'
        '400':
          description: Invalid input
          content: {}
      security:
        - api_key: []
components:
  schemas:
    ViewSalesByChannelRequest:
      allOf:
        - $ref: '#/components/schemas/CommonReportOptions'
        - type: object
          description: Request body for viewing sales by channel report
          required:
            - fromDate
            - toDate
            - timezone
            - priorFromDate
            - priorToDate
          properties:
            filter:
              type: object
              description: Filter criteria for the report
              properties:
                marketplaces:
                  type: array
                  items:
                    type: string
                  description: Array of marketplace filters
                  default: []
                  example: []
                countries:
                  type: array
                  items:
                    type: string
                  description: Array of country code filters
                  default: []
                  example: []
                tags:
                  type: array
                  items:
                    type: string
                  description: Array of tag filters
                  default: []
                  example: []
              default:
                marketplaces: []
                countries: []
                tags: []
            includeTax:
              type: boolean
              description: Whether to include tax in calculations
              default: false
              example: false
            vendorRevenueType:
              type: string
              description: Type of vendor revenue to calculate
              enum:
                - orderedRevenue
                - shippedRevenue
              default: orderedRevenue
              example: orderedRevenue
            sortKey:
              type: string
              description: Field to sort results by
              enum:
                - sales
                - salesSplit
                - forecastTarget
                - budgetTarget
                - orders
                - units
                - avOrderSize
                - avOrderValue
                - outOfStockPercentage
                - pageViews
                - conversions
              default: sales
              example: sales
            sortOrder:
              type: string
              description: Sort order direction
              enum:
                - asc
                - desc
              default: desc
              example: desc
            searchText:
              type: string
              description: Text to search within results
              default: ''
              example: ''
            pageSize:
              type: integer
              description: Number of items per page for pagination
              example: 10
            pageIndex:
              type: integer
              description: Zero-based page index for pagination
              minimum: 0
              example: 0
    SalesByChannelResponse:
      type: object
      description: >-
        Response for sales by channel endpoint containing marketplace overview
        data
      properties:
        rows:
          type: array
          description: Array of store/channel data
          items:
            type: object
            properties:
              store:
                type: string
                description: Store identifier/name
              outOfStockPercentage:
                type: number
                nullable: true
                description: Percentage of products out of stock
              buyBoxSnapshot:
                type: object
                nullable: true
                description: Buy box performance snapshot
              forecastTarget:
                type: number
                description: Forecast target value
              adspendLimit:
                type: number
                description: Advertising spend limit
              budgetTarget:
                type: number
                description: Budget target value
              currency:
                type: string
                description: Currency code (e.g., USD)
              salesSplit:
                type: number
                description: Sales split percentage
              storeId:
                type: string
                description: Unique store identifier
              marketplace:
                type: object
                description: Marketplace information
                properties:
                  market:
                    type: string
                    description: Marketplace type (e.g., amazon, ebay, shopify)
                  countryCode:
                    type: string
                    description: Country code (e.g., USA, CAN, GBR)
              sales:
                type: object
                description: Sales metrics
                properties:
                  value:
                    type: number
                    description: Current period sales value
                  priorPeriodValue:
                    type: number
                    nullable: true
                    description: Prior period sales value for comparison
              orders:
                type: object
                description: Order metrics
                properties:
                  value:
                    type: string
                    description: Current period order count
                  priorPeriodValue:
                    type: string
                    description: Prior period order count for comparison
              avOrderValue:
                type: object
                description: Average order value metrics
                properties:
                  value:
                    type: number
                    description: Current period average order value
                  priorPeriodValue:
                    type: number
                    nullable: true
                    description: Prior period average order value for comparison
              units:
                type: object
                description: Units sold metrics
                properties:
                  value:
                    type: string
                    description: Current period units sold
                  priorPeriodValue:
                    type: string
                    description: Prior period units sold for comparison
              avOrderSize:
                type: object
                description: Average order size metrics
                properties:
                  value:
                    type: number
                    description: Current period average order size
                  priorPeriodValue:
                    type: number
                    description: Prior period average order size for comparison
              pageViews:
                type: object
                description: Page view metrics
                properties:
                  value:
                    type: string
                    description: Current period page views
                  priorPeriodValue:
                    type: string
                    description: Prior period page views for comparison
              conversions:
                type: object
                description: Conversion rate metrics
                properties:
                  value:
                    type: number
                    description: Current period conversion rate
                  priorPeriodValue:
                    type: number
                    description: Prior period conversion rate for comparison
              healthStatus:
                type: string
                description: Health status of the store (e.g., noData, healthy, warning)
        count:
          type: number
          description: Total number of stores/channels in the result set
    CommonReportOptions:
      type: object
      properties:
        fromDate:
          type: number
          description: >-
            Unix epoch time (seconds) representing the start of the reporting
            period
        toDate:
          type: number
          description: >-
            Unix epoch time (seconds) representing the end of the reporting
            period
        priorFromDate:
          type: number
          description: >-
            Unix epoch time (seconds) representing the start of the comparison
            period
        priorToDate:
          type: number
          description: >-
            Unix epoch time (seconds) representing the end of the comparison
            period
        timezone:
          type: string
          description: >-
            The timezone string you wish to see the report in (e.g.
            'America/Los_Angeles') see
            https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  securitySchemes:
    api_key:
      type: apiKey
      name: x-api-key
      in: header

````