---
title: "Fetch contract scores for an entity"
method: POST
path: "/contract_routing.ContractScoreCalculator/FetchContractScore"
tags: ["Contract Routing"]
---

# Fetch contract scores for an entity

`POST /contract_routing.ContractScoreCalculator/FetchContractScore`

Calculates contract scores for an entity based on provided parameters and labels

## Headers

- `x-tenant-id` string, required
- `x-profile-id` string, required
- `x-api-key` string, required

## Request body

- CalContractScoreRequest
  - `id` string, required — Entity identifier
  - `params` string — Additional parameters for contract calculation
  - `labels` string[], required — Labels (processors) to calculate scores for
  - `config` CalContractScoreConfig, required
    - `constants` number[], required — Constants used in score calculation algorithm
    - `time_scale` TimeScale, required
      - `time_scale` 'Day' | 'Month' — Selected time scale for contract calculation

## Response `200`

Success rate calculated successfully

- CalContractScoreResponse
  - `labels_with_score` ScoreData[] — Contract scores for each label
    - `score` number, double, required — Contract score (higher values indicate higher priority)
    - `label` string, required — Label (processor) identifier
    - `current_count` integer, required — Current transaction count for this processor

## Other responses

- `400` — Invalid request parameters
- `500` — Internal server error

---

[API](https://skmtc.dev/hyperswitch/apis/dynamic-routing-openapi-3-0.md) · [All operations](https://skmtc.dev/hyperswitch/apis/dynamic-routing-openapi-3-0/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/hyperswitch/dynamic-routing-openapi-3-0/revisions/8fbf69ab2597/schema)
