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

# Fetch entity and global success rates

> Calculates success rates for both entity-specific and global metrics



## OpenAPI

````yaml post /success_rate.SuccessRateCalculator/FetchEntityAndGlobalSuccessRate
openapi: 3.0.0
info:
  title: Dynamic routing - OpenAPI 3.0
  description: This the the open API 3.0 specification for the dynamic routing.
  version: 1.0.0
servers: []
security: []
paths:
  /success_rate.SuccessRateCalculator/FetchEntityAndGlobalSuccessRate:
    post:
      tags:
        - Success Rate
      summary: Fetch entity and global success rates
      description: Calculates success rates for both entity-specific and global metrics
      operationId: fetchEntityAndGlobalSuccessRate
      parameters:
        - name: x-tenant-id
          in: header
          required: true
          schema:
            type: string
          example: public
        - name: x-profile-id
          in: header
          required: true
          schema:
            type: string
          example: pro_WX0giXQnzk2wQJjkKVBX
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
          example: dev_VLzQTxkPq3ALj2mlfiHL4mMtXca4uplOIOLaKEzmWAmNBXZjwsuv5bCLjnf0QYHm
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CalGlobalSuccessRateRequest'
      responses:
        '200':
          description: Success rates calculated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CalGlobalSuccessRateResponse'
        '400':
          description: Invalid request parameters
        '500':
          description: Internal server error
components:
  schemas:
    CalGlobalSuccessRateRequest:
      type: object
      example:
        entity_id: merchant1
        entity_params: card
        entity_labels:
          - stripe
          - adyen
        global_labels:
          - visa
          - mastercard
        config:
          entity_min_aggregates_size: 10
          entity_default_success_rate: 0.85
      properties:
        entity_id:
          type: string
          example: merchant1
        entity_params:
          type: string
          example: card
        entity_labels:
          type: array
          items:
            type: string
          example:
            - stripe
            - adyen
        global_labels:
          type: array
          items:
            type: string
          example:
            - visa
            - mastercard
        config:
          $ref: '#/components/schemas/CalGlobalSuccessRateConfig'
    CalGlobalSuccessRateResponse:
      type: object
      properties:
        entity_scores_with_labels:
          type: array
          items:
            $ref: '#/components/schemas/LabelWithScore'
          description: Entity-specific labels with their calculated success rates
        global_scores_with_labels:
          type: array
          items:
            $ref: '#/components/schemas/LabelWithScore'
          description: Global labels with their calculated success rates
    CalGlobalSuccessRateConfig:
      type: object
      example:
        entity_min_aggregates_size: 10
        entity_default_success_rate: 0.85
      properties:
        entity_min_aggregates_size:
          type: integer
          format: uint32
          example: 10
        entity_default_success_rate:
          type: number
          format: double
          example: 0.85
    LabelWithScore:
      type: array
      items:
        $ref: '#/components/schemas/LabelWithScoreList'
      example:
        - score: 100
          label: stripe
        - score: 98.5
          label: adyen
    LabelWithScoreList:
      type: object
      properties:
        score:
          type: number
          format: double
          example: 100
          description: Calculated success rate score
        label:
          type: string
          example: stripe
          description: Label identifier
      required:
        - score
        - label

````