Skip to content

Latest commit

 

History

History
75 lines (67 loc) · 2.18 KB

File metadata and controls

75 lines (67 loc) · 2.18 KB
title Decide Gateway: SR Based Routing
description 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

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,
    "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

{
  "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
}

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.