Evaluate routing rules
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.
Request body used to evaluate routing rules.
This API evaluates routing logic based on dynamic parameters like payment method, amount, country, card_bin, etc.
Identifier of the user/system triggering routing evaluation.
Example:
"created_by": "some_id""profile_123"
Dynamic parameters used during routing evaluation.
Each key represents a routing attribute.
Example fields:
payment_methodpayment_method_typeamountcurrencyauthentication_typecard_bincapture_methodbusiness_countrybilling_countrybusiness_labelsetup_future_usagecard_networkpayment_typemandate_typemandate_acceptance_typemetadataExample:
{
"payment_method": { "type": "enum_variant", "value": "card" },
"amount": { "type": "number", "value": 10 },
"currency": { "type": "str_value", "value": "INR" },
"authentication_type": { "type": "enum_variant", "value": "three_ds" },
"card_bin": { "type": "str_value", "value": "424242" },
"business_country": { "type": "str_value", "value": "IN" },
"setup_future_usage": { "type": "enum_variant", "value": "off_session" },
"card_network": { "type": "enum_variant", "value": "visa" },
"metadata": {
"type": "metadata_variant",
"value": { "key": "key1", "value": "value1" }
}
}For the complete superset of supported routing keys,
refer to routing_configs.keys in:
https://github.com/juspay/decision-engine/blob/main/config/development.toml
Fallback connectors used if routing rule evaluation fails.
These connectors will be returned if no rule matches.
Example:
[
{
"gateway_name": "stripe",
"gateway_id": "mca_123"
}
]Routing rules evaluated successfully
Response returned after routing evaluation.
Contains:
Status of routing evaluation.
Example:
"success""success"
Raw routing output returned by routing engine.
Possible structures:
{
"type": "volume_split",
"splits": [
{
"connector": { "gateway_name": "adyen", "gateway_id": "mca_124" },
"split": 60
},
{
"connector": { "gateway_name": "stripe", "gateway_id": "mca_123" },
"split": 40
}
]
}{
"type": "priority",
"connectors": [
{ "gateway_name": "stripe", "gateway_id": "mca_123" },
{ "gateway_name": "adyen", "gateway_id": "mca_124" }
]
}Final connector(s) selected after evaluation.
Example:
[
{
"connector": "stripe",
"merchant_connector_id": "mca_123"
}
]