> ## Documentation Index
> Fetch the complete documentation index at: https://api-reference.hyperswitch.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Decide Gateway: SR Based Routing

> Curl example for /decide-gateway using SR_BASED_ROUTING.

# Decide Gateway: SR Based Routing

`SR_BASED_ROUTING` uses auth-rate history, downtime state, and eligible gateway filters to choose a connector.

## Request

```bash theme={null}
curl --location "$BASE_URL/decide-gateway" \
  --header "$AUTH_HEADER" \
  --header "Content-Type: application/json" \
  --data '{
    "merchantId": "merchant_demo",
    "eligibleGatewayList": ["stripe", "adyen", "checkout"],
    "rankingAlgorithm": "SR_BASED_ROUTING",
    "eliminationEnabled": true,
    "enableMultiObjective": false,
    "paymentInfo": {
      "paymentId": "sr_001",
      "amount": 1000,
      "currency": "USD",
      "country": "US",
      "paymentType": "ORDER_PAYMENT",
      "metadata": null,
      "paymentMethodType": "CARD",
      "paymentMethod": "CREDIT",
      "authType": "THREE_DS",
      "cardIsin": "424242"
    }
  }'
```

## Response

```json theme={null}
{
  "decided_gateway": "stripe",
  "gateway_priority_map": {
    "stripe": 0.94,
    "adyen": 0.91,
    "checkout": 0.88
  },
  "filter_wise_gateways": null,
  "priority_logic_tag": null,
  "routing_approach": "SR_SELECTION_V3_ROUTING",
  "gateway_before_evaluation": "stripe",
  "priority_logic_output": {
    "isEnforcement": false,
    "gws": ["stripe", "adyen", "checkout"],
    "priorityLogicTag": null,
    "gatewayReferenceIds": {},
    "primaryLogic": null,
    "fallbackLogic": null
  },
  "reset_approach": "NO_RESET",
  "routing_dimension": "ORDER_PAYMENT,CARD,CREDIT,UNKNOWN",
  "routing_dimension_level": "CARD_LEVEL",
  "is_scheduled_outage": false,
  "is_dynamic_mga_enabled": false,
  "gateway_mga_id_map": null,
  "is_rust_based_decider": true,
  "multi_objective_info": null
}
```

## Routing Approach Values

* `SR_SELECTION_V3_ROUTING`: best eligible gateway from SR score at the active routing dimension.
* `SR_V3_DOWNTIME_ROUTING`: some eligible gateways were deprioritized due to downtime.
* `SR_V3_ALL_DOWNTIME_ROUTING`: all eligible gateways are in downtime and the best degraded option is selected.
* `SR_V3_HEDGING`: exploration mode across eligible gateways.
* `SR_V3_DOWNTIME_HEDGING`: hedging with partial downtime.
* `SR_V3_ALL_DOWNTIME_HEDGING`: hedging while all eligible gateways are down.
* `SR_SELECTION_MULTI_OBJECTIVE`: the multi-objective post-step promoted a cheaper gateway over the SR head on expected value — see [Multi-objective routing](/decision-engine-api-reference/api-reference/guides/run-transactions/decide-gateway-multi-objective).

## Multi-Objective Option

When multi-objective routing is enabled (request field `enableMultiObjective`, or the `multi_objective_routing_enabled` merchant feature flag), a cost-aware post-step may re-rank the SR result and the response gains a `multi_objective_info` block. Details and examples: [Multi-objective routing](/decision-engine-api-reference/api-reference/guides/run-transactions/decide-gateway-multi-objective).
