Skip to main content
POST
/
success_rate.SuccessRateCalculator
/
FetchSuccessRate
Fetch success rate for an entity
curl --request POST \
  --url https://api.example.com/success_rate.SuccessRateCalculator/FetchSuccessRate \
  --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": {
    "min_aggregates_size": 10,
    "default_success_rate": 0.95,
    "specificity_level": "ENTITY"
  }
}
'
{
  "labels_with_score": [
    [
      {
        "score": 100,
        "label": "stripe"
      },
      {
        "score": 98.5,
        "label": "adyen"
      }
    ]
  ],
  "routing_approach": "EXPLOITATION"
}

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"

params
string
required

Parameters on which success rate scores has to be maintained

Example:

"card"

labels
string[]
required

Labels for which to calculate success rates

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

Response

Success rate calculated successfully

labels_with_score
object[][]

List of labels with their calculated success rates

Example:
[
{ "score": 100, "label": "stripe" },
{ "score": 98.5, "label": "adyen" }
]
routing_approach
enum<string>

Defines the routing approach based on the success rate calculation.

Available options:
EXPLORATION,
EXPLOITATION
Example:

"EXPLOITATION"