curl --location "$BASE_URL/routing/create" \
--header "$AUTH_HEADER" \
--header "Content-Type: application/json" \
--data '{
"name": "advanced card routing",
"created_by": "merchant_demo",
"description": "Route Visa card traffic by priority, otherwise fallback to stripe",
"algorithm_for": "payment",
"algorithm": {
"type": "advanced",
"data": {
"globals": {},
"default_selection": {
"priority": [
{ "gateway_name": "stripe", "gateway_id": "mca_stripe" }
]
},
"rules": [
{
"name": "visa_card_rule",
"routing_type": "priority",
"output": {
"priority": [
{ "gateway_name": "adyen", "gateway_id": "mca_adyen" },
{ "gateway_name": "stripe", "gateway_id": "mca_stripe" }
]
},
"statements": [
{
"condition": [
{
"lhs": "payment_method_type",
"comparison": "equal",
"value": { "type": "enum_variant", "value": "CARD" },
"metadata": {}
},
{
"lhs": "card_network",
"comparison": "equal",
"value": { "type": "enum_variant", "value": "Visa" },
"metadata": {}
}
],
"nested": null
}
]
}
],
"metadata": {}
}
}
}'