POST
/
routing
/
evaluate
Routing - Evaluate
curl --request POST \
  --url https://sandbox.hyperswitch.io/routing/evaluate \
  --header 'Content-Type: application/json' \
  --header 'api-key: <api-key>' \
  --data '{
  "paymentInfo": {
    "paymentId": "<string>",
    "amount": 123,
    "currency": "AED",
    "paymentType": "<string>",
    "metadata": "<string>",
    "paymentMethodType": "<string>",
    "paymentMethod": "card",
    "cardIsin": "<string>"
  },
  "merchantId": "<string>",
  "eligibleGatewayList": [
    "<string>"
  ],
  "rankingAlgorithm": "SR_BASED_ROUTING",
  "eliminationEnabled": true
}'
{
  "decided_gateway": "<string>",
  "gateway_priority_map": "<any>",
  "filter_wise_gateways": "<any>",
  "priority_logic_tag": "<string>",
  "routing_approach": "<string>",
  "gateway_before_evaluation": "<string>",
  "priority_logic_output": {
    "isEnforcement": true,
    "gws": [
      "<string>"
    ],
    "priorityLogicTag": "<string>",
    "gatewayReferenceIds": {},
    "primaryLogic": {
      "name": "<string>",
      "status": "<string>",
      "failure_reason": "<string>"
    },
    "fallbackLogic": {
      "name": "<string>",
      "status": "<string>",
      "failure_reason": "<string>"
    }
  },
  "reset_approach": "<string>",
  "routing_dimension": "<string>",
  "routing_dimension_level": "<string>",
  "is_scheduled_outage": true,
  "is_dynamic_mga_enabled": true,
  "gateway_mga_id_map": "<any>"
}

Authorizations

api-key
string
header
required

Use the API key created under your merchant account from the HyperSwitch dashboard. API key is used to authenticate API requests from your merchant server only. Don't expose this key on a website or embed it in a mobile application.

Body

application/json
paymentInfo
object
required
merchantId
string
required
eligibleGatewayList
string[] | null
rankingAlgorithm
enum<string>
Available options:
SR_BASED_ROUTING,
PL_BASED_ROUTING,
NTW_BASED_ROUTING
eliminationEnabled
boolean | null

Response

Routing rules evaluated successfully

decided_gateway
string | null
gateway_priority_map
any
filter_wise_gateways
any
priority_logic_tag
string | null
routing_approach
string | null
gateway_before_evaluation
string | null
priority_logic_output
object
reset_approach
string | null
routing_dimension
string | null
routing_dimension_level
string | null
is_scheduled_outage
boolean | null
is_dynamic_mga_enabled
boolean | null
gateway_mga_id_map
any