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

# Retrieve vendor sales-by-period performance

> Retrieve aggregated revenue with advertising metrics for a merchant over the selected date range, grouped by the requested interval.



## OpenAPI

````yaml /api-reference/openapi.json post /reports/view/vendorSalesByPeriod
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/vendorSalesByPeriod:
    post:
      tags:
        - report
      summary: Retrieve vendor sales-by-period performance
      description: >-
        Retrieve aggregated revenue with advertising metrics for a merchant over
        the selected date range, grouped by the requested interval.
      operationId: getVendorSalesByPeriodReport
      requestBody:
        description: >-
          Report filters that identify the merchant, time range, and marketplace
          scope to evaluate.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VendorSalesByPeriodRequest'
      responses:
        '200':
          description: Aggregated performance data grouped to match the requested interval.
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorSalesByPeriodSuccessResponse'
        '400':
          description: Missing or invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorSalesByPeriodErrorResponse'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorSalesByPeriodErrorResponse'
      security:
        - api_key: []
components:
  schemas:
    VendorSalesByPeriodRequest:
      type: object
      description: Payload used to request the vendor sales-by-period view report.
      properties:
        merchantId:
          type: string
          description: >-
            MerchantSpring merchant identifier for the account whose performance
            should be returned.
        channelId:
          type: string
          description: >-
            MerchantSpring channel identifier for the account whose performance
            should be returned.
        reportOptions:
          allOf:
            - $ref: '#/components/schemas/VendorSalesByPeriodReportOptions'
          description: >-
            Defines the reporting window and comparison period that should be
            analysed.
        asins:
          type: array
          description: Optional list of ASINs to restrict the dataset to specific products.
          items:
            type: string
      required:
        - merchantId
        - channelId
        - reportOptions
    VendorSalesByPeriodSuccessResponse:
      type: object
      description: Successful response returned by the sales-by-period report endpoint.
      properties:
        status:
          type: string
          enum:
            - success
          description: Indicates that the request completed successfully.
        currency:
          type: string
          description: Currency code associated with the returned metrics.
        formattedChartData:
          type: array
          description: >-
            Display-ready metrics including formatted strings and comparison
            values for each interval.
          items:
            $ref: '#/components/schemas/VendorFormattedSalesByPeriodChartData'
      required:
        - status
        - currency
        - formattedChartData
    VendorSalesByPeriodErrorResponse:
      type: object
      description: >-
        Error payload returned when the sales-by-period request cannot be
        processed.
      properties:
        status:
          type: string
          enum:
            - error
          description: Identifies the response as an error.
        error:
          type: string
          description: Human-readable explanation of what went wrong.
      required:
        - status
        - error
    VendorSalesByPeriodReportOptions:
      allOf:
        - $ref: '#/components/schemas/CommonReportOptions'
        - type: object
          description: >-
            Defines the principal and comparison date windows for the report and
            how results should be bucketed.
          properties:
            interval:
              type: string
              enum:
                - 'y'
                - Q
                - M
                - w
                - d
                - h
              description: >-
                Interval code that controls how results are bucketed (y=year,
                Q=quarter, M=month, w=week, d=day, h=hour).
          required:
            - fromDate
            - toDate
            - priorFromDate
            - priorToDate
            - timezone
            - interval
    VendorFormattedSalesByPeriodChartData:
      type: object
      description: >-
        Human-readable metrics pre-formatted using the requested currency and
        timezone.
      properties:
        startTime:
          type: string
          description: >-
            Formatted start timestamp for the time bucket (respecting the
            requested interval and timezone).
        endTime:
          type: string
          description: >-
            Formatted end timestamp for the time bucket (respecting the
            requested interval and timezone).
        glanceViews:
          type: integer
          format: int32
          description: Current-period glance views
        priorGlanceViews:
          type: integer
          format: int32
          description: Prior-period glance views
        orderedRevenue:
          type: string
          description: Ordered revenue during the current period.
        priorOrderedRevenue:
          type: string
          description: Ordered revenue during the comparison period.
        orderedUnits:
          type: integer
          format: int32
          description: Ordered units during the current period.
        priorOrderedUnits:
          type: integer
          format: int32
          description: Ordered units during the comparison period.
        conversionRate:
          type: string
          description: Conversion rate during the current period.
        priorConversionRate:
          type: string
          description: Conversion rate during the comparison period.
        retailPrice:
          type: string
          description: Retail price during the current period.
        priorRetailPrice:
          type: string
          description: Retail price during the comparison period.
        shippedRevenue:
          type: string
          description: Shipped revenue during the current period.
        priorShippedRevenue:
          type: string
          description: Shipped revenue during the comparison period.
        shippedRevenueManufacturing:
          type: string
          description: Shipped revenue manufacturing during the current period.
        priorShippedRevenueManufacturing:
          type: string
          description: Shipped revenue manufacturing during the comparison period.
        shippedCogs:
          type: string
          description: Shipped cogs during the current period.
        priorShippedCogs:
          type: string
          description: Shipped cogs during the comparison period.
        shippedCogsManufacturing:
          type: string
          description: Shipped cogs manufacturing during the current period.
        priorShippedCogsManufacturing:
          type: string
          description: Shipped cogs manufacturing during the comparison period.
        shippedUnits:
          type: integer
          format: int32
          description: Shipped units during the current period.
        priorShippedUnits:
          type: integer
          format: int32
          description: Shipped units during the comparison period.
        shippedUnitsManufacturing:
          type: integer
          format: int32
          description: Shipped units manufacturing during the current period.
        priorShippedUnitsManufacturing:
          type: integer
          format: int32
          description: Shipped units manufacturing during the comparison period.
        adSales:
          type: string
          description: Ad sales during the current period.
        priorAdSales:
          type: string
          description: Ad sales during the comparison period.
        adSpend:
          type: string
          description: Ad spend during the current period.
        priorAdSpend:
          type: string
          description: Ad spend during the comparison period.
        acos:
          type: string
          description: Acos during the current period.
        priorAcos:
          type: string
          description: Acos during the comparison period.
        tacosOrderedRevenue:
          type: string
          description: Tacos ordered revenue during the current period.
        priorTacosOrderedRevenue:
          type: string
          description: Tacos ordered revenue during the comparison period.
        tacosShippedRevenue:
          type: string
          description: Tacos shipped revenue during the current period.
        priorTacosShippedRevenue:
          type: string
          description: Tacos shipped revenue during the comparison period.
        tacosManufacturing:
          type: string
          description: Tacos manufacturing during the current period.
        priorTacosManufacturing:
          type: string
          description: Tacos manufacturing during the comparison period.
        impressions:
          type: integer
          format: int32
          description: Impressions during the current period.
        priorImpressions:
          type: integer
          format: int32
          description: Impressions during the comparison period.
        clicks:
          type: integer
          format: int32
          description: Clicks during the current period.
        priorClicks:
          type: integer
          format: int32
          description: Clicks during the comparison period.
        clickThroughRate:
          type: string
          description: Click through rate during the current period.
        priorClickThroughRate:
          type: string
          description: Click through rate during the comparison period.
        currency:
          type: string
          description: Currency code used when formatting the monetary totals.
    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

````