Skip to main content
POST
/
success_rate.SuccessRateCalculator
/
FetchEntityAndGlobalSuccessRate
Fetch entity and global success rates
curl --request POST \
  --url https://api.example.com/success_rate.SuccessRateCalculator/FetchEntityAndGlobalSuccessRate \
  --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 '
{
  "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
  }
}
'
{
  "entity_scores_with_labels": [
    [
      {
        "score": 100,
        "label": "stripe"
      },
      {
        "score": 98.5,
        "label": "adyen"
      }
    ]
  ],
  "global_scores_with_labels": [
    [
      {
        "score": 100,
        "label": "stripe"
      },
      {
        "score": 98.5,
        "label": "adyen"
      }
    ]
  ]
}

Headers

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

Body

application/json
entity_id
string
Example:

"merchant1"

entity_params
string
Example:

"card"

entity_labels
string[]
Example:
["stripe", "adyen"]
global_labels
string[]
Example:
["visa", "mastercard"]
config
object
Example:
{
"entity_min_aggregates_size": 10,
"entity_default_success_rate": 0.85
}

Response

Success rates calculated successfully

entity_scores_with_labels
object[][]

Entity-specific labels with their calculated success rates

Example:
[
{ "score": 100, "label": "stripe" },
{ "score": 98.5, "label": "adyen" }
]
global_scores_with_labels
object[][]

Global labels with their calculated success rates

Example:
[
{ "score": 100, "label": "stripe" },
{ "score": 98.5, "label": "adyen" }
]