Fetch contract scores for an entity
POST /contract_routing.ContractScoreCalculator/FetchContractScore
Description: Fetch contract (processor) scores for a given entity.
Try it (cURL)
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"
}
}
}
'Successful response (200)
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:
config (object) — required
Configuration for calculation (show child attributes)
params (string)
Additional parameters for contract calculation
Example:
"card"
Response
200 (application/json) — Success rate calculated successfully
labels_with_score (object[]) — Contract scores for each label (show child attributes)
Related links:
Documentation: https://api-reference.hyperswitch.io/introduction
Locker API Reference: https://api-reference.hyperswitch.io/locker-api-reference/overview
Intelligent Router API Reference: https://api-reference.hyperswitch.io/intelligent-router-api-reference/overview
Edit this page: https://github.com/juspay/hyperswitch/edit/main/api-reference/intelligent-router-api-reference/contract-routing/fetch-contract-scores-for-an-entity.mdx
Raise issue: https://github.com/juspay/hyperswitch/issues/new?title=Issue%20on%20docs&body=Path:%20/intelligent-router-api-reference/contract-routing/fetch-contract-scores-for-an-entity
Other relevant endpoints:
Invalidate elimination bucket: https://api-reference.hyperswitch.io/intelligent-router-api-reference/elimination/invalidate-elimination-bucket
Update contract information for an entity: https://api-reference.hyperswitch.io/intelligent-router-api-reference/contract-routing/update-contract-information-for-an-entity