> ## 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 Products Metrics Endpoint

> Per-product metrics for an explicit set of products.

Lets the collection grid paint immediately (products are fetched without
metrics) and then overlay the numbers. The expensive whole-catalog fetch is
shared via the cached, single-flighted ``fetch_collection_metrics``, so on a
warm cache this endpoint is just an in-memory slice keyed by the requested
ids. Missing ids resolve to zeroed metrics, mirroring the inline
``include_metrics`` path.



## OpenAPI

````yaml /api-reference/openapi/foundation-portal.json post /api/v1/merchants/{merchant_id}/products/metrics
openapi: 3.1.0
info:
  title: Depict Foundation Portal API
  version: 1.0.0
  description: >-
    REST API behind the Depict Foundation merchant portal: merchants, products,
    collections, curation, metrics, analytics and search insights. All endpoints
    require an Auth0-issued bearer token.
servers:
  - url: ''
security: []
paths:
  /api/v1/merchants/{merchant_id}/products/metrics:
    post:
      tags:
        - Products
      summary: Get Products Metrics Endpoint
      description: >-
        Per-product metrics for an explicit set of products.


        Lets the collection grid paint immediately (products are fetched without

        metrics) and then overlay the numbers. The expensive whole-catalog fetch
        is

        shared via the cached, single-flighted ``fetch_collection_metrics``, so
        on a

        warm cache this endpoint is just an in-memory slice keyed by the
        requested

        ids. Missing ids resolve to zeroed metrics, mirroring the inline

        ``include_metrics`` path.
      operationId: >-
        get_products_metrics_endpoint_api_v1_merchants__merchant_id__products_metrics_post
      parameters:
        - name: merchant_id
          in: path
          required: true
          schema:
            type: string
            title: Merchant Id
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/ProductMetricsRequest'
              default:
                main_product_ids: []
              title: Request
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductMetricsResponse'
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - Auth0: []
components:
  schemas:
    ProductMetricsRequest:
      properties:
        main_product_ids:
          items:
            type: string
          type: array
          maxItems: 2000
          title: Main Product Ids
        market_group_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Market Group Id
        market:
          anyOf:
            - type: string
            - type: 'null'
          title: Market
      type: object
      title: ProductMetricsRequest
    ProductMetricsResponse:
      properties:
        metrics:
          additionalProperties:
            $ref: '#/components/schemas/ProductMetrics'
          type: object
          title: Metrics
        revenue_currency:
          type: string
          title: Revenue Currency
          default: ''
      type: object
      required:
        - metrics
      title: ProductMetricsResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ProductMetrics:
      properties:
        clicks:
          type: integer
          title: Clicks
          default: 0
        prev_clicks:
          type: integer
          title: Prev Clicks
          default: 0
        views:
          type: integer
          title: Views
          default: 0
        prev_views:
          type: integer
          title: Prev Views
          default: 0
        sold:
          type: integer
          title: Sold
          default: 0
        prev_sold:
          type: integer
          title: Prev Sold
          default: 0
        revenue:
          anyOf:
            - type: number
            - type: 'null'
          title: Revenue
          default: 0
        prev_revenue:
          anyOf:
            - type: number
            - type: 'null'
          title: Prev Revenue
          default: 0
        revenue_currency:
          type: string
          title: Revenue Currency
          default: ''
        inventory:
          type: integer
          title: Inventory
          default: 0
        click_through_rate:
          type: number
          title: Click Through Rate
          default: 0
        prev_click_through_rate:
          type: number
          title: Prev Click Through Rate
          default: 0
        sell_through_rate:
          type: number
          title: Sell Through Rate
          default: 0
        prev_sell_through_rate:
          type: number
          title: Prev Sell Through Rate
          default: 0
        add_to_carts:
          type: integer
          title: Add To Carts
          default: 0
        prev_add_to_carts:
          type: integer
          title: Prev Add To Carts
          default: 0
      type: object
      title: ProductMetrics
    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
  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

````