Create Rule Config

August 3, 2026 ยท View on GitHub

Use case

Creates service-level scoring configuration for success-rate or elimination behaviour.

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/create
  • Parameters: none.
  • Body: JSON body with merchant_id and tagged config. Supported config.type values include successRate and elimination.

Example

Create success-rate config

config.data fields are camelCase. subLevelInputConfig is an array of per-dimension overrides.

curl --location "$BASE_URL/rule/create" \
  --header "$AUTH_HEADER" \
  --header "Content-Type: application/json" \
  --data '{
  "merchant_id": "merchant_demo",
  "config": {
    "type": "successRate",
    "data": {
      "defaultBucketSize": 20,
      "defaultLatencyThreshold": null,
      "defaultHedgingPercent": null,
      "margin": 0.20,
      "subLevelInputConfig": [
        { "paymentMethodType": "CARD", "bucketSize": 30, "hedgingPercent": 0.05 }
      ]
    }
  }
}'

Create elimination config

curl --location "$BASE_URL/rule/create" \
  --header "$AUTH_HEADER" \
  --header "Content-Type: application/json" \
  --data '{
  "merchant_id": "merchant_demo",
  "config": {
    "type": "elimination",
    "data": {
      "threshold": 0.25
    }
  }
}'

Response

{
  "message": "Success Rate Configuration created successfully",
  "merchant_id": "merchant_demo",
  "config": {
    "type": "successRate",
    "data": {
      "defaultBucketSize": 20,
      "defaultLatencyThreshold": null,
      "defaultHedgingPercent": null,
      "margin": 0.20,
      "subLevelInputConfig": [
        { "paymentMethodType": "CARD", "bucketSize": 30, "hedgingPercent": 0.05 }
      ]
    }
  }
}

Notes

  • This is not Euclid rule creation. Use /routing/create for routing algorithms.
  • Success-rate config affects auth-rate based routing and score snapshots.