Skip to main content
POST
/
contract_routing.ContractScoreCalculator
/
FetchContractScore
Fetch contract scores for an entity
curl --request POST \
  --url https://api.example.com/contract_routing.ContractScoreCalculator/FetchContractScore \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <x-api-key>' \
  --header 'x-profile-id: <x-profile-id>' \
  --header 'x-tenant-id: <x-tenant-id>' \
  --data '
{
  "id": "merchant1",
  "params": "card",
  "labels": [
    "stripe",
    "adyen"
  ],
  "config": {
    "constants": [
      0.7,
      0.3
    ],
    "time_scale": {
      "time_scale": "Day"
    }
  }
}
'
{
  "labels_with_score": [
    {
      "score": 0.95,
      "label": "stripe",
      "current_count": 500
    }
  ]
}

Headers

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

Body

application/json
id
string
required

Entity identifier

Example:

"merchant1"

labels
string[]
required

Labels (processors) to calculate scores for

Example:
["stripe", "adyen"]
config
object
required

Configuration for calculation

params
string

Additional parameters for contract calculation

Example:

"card"

Response

Success rate calculated successfully

labels_with_score
object[]

Contract scores for each label