Get Rule Config

August 3, 2026 ยท View on GitHub

Use case

Fetches a service-level success-rate or elimination configuration for a merchant.

Authentication

Protected. Send either Authorization: Bearer <jwt_token> or x-api-key: <api_key>. In sandbox, also send x-feature: decision-engine.

For local development, start with:

export BASE_URL=http://localhost:8080
export AUTH_HEADER="Authorization: Bearer <jwt_token>"
# Sandbox only:
# export BASE_URL=https://sandbox.hyperswitch.io
# export FEATURE_HEADER="x-feature: decision-engine"

Request

  • Method and path: POST /rule/get
  • Parameters: none.
  • Body: JSON body with merchant_id and algorithm ("successRate" or "elimination").

Example

Get success-rate config

curl --location "$BASE_URL/rule/get" \
  --header "$AUTH_HEADER" \
  --header "Content-Type: application/json" \
  --data '{
  "merchant_id": "merchant_demo",
  "algorithm": "successRate"
}'

Get elimination config

curl --location "$BASE_URL/rule/get" \
  --header "$AUTH_HEADER" \
  --header "Content-Type: application/json" \
  --data '{
  "merchant_id": "merchant_demo",
  "algorithm": "elimination"
}'

Response

{
  "merchant_id": "merchant_demo",
  "config": {
    "type": "successRate",
    "data": {
      "defaultLatencyThreshold": null,
      "defaultBucketSize": 20,
      "defaultHedgingPercent": null,
      "margin": 0.2,
      "subLevelInputConfig": [
        { "paymentMethodType": "CARD", "bucketSize": 30, "hedgingPercent": 0.05 }
      ]
    }
  }
}

Notes

  • A missing config should be treated as not configured in the dashboard.
  • Use this to determine overview setup readiness.