v11

latestOpenAPI 3.1.0AGPL-3.0raw.githubusercontent.com2026-08-014635124.5 KB
Gateway Decision

Decide gateway

Core routing decision API. Given a payment context and a list of eligible gateways, returns the optimal gateway to route to.

The engine applies a sequence of filters (currency, card brand, auth type, EMI, etc.) then scores remaining gateways using success rate history, elimination status, and contract obligations.

Authentication: Requires either JWT Bearer token or API Key.

post/decide-gateway

Request body

merchantIdstring required
eligibleGatewayListstring[] required
rankingAlgorithm'SR_BASED_ROUTING' | 'PL_BASED_ROUTING' | 'NTW_BASED_ROUTING' | 'NTW_SR_HYBRID_ROUTING' required
eliminationEnabledboolean
enableMultiObjectiveboolean

Per-request override for the multi-objective (cost-aware) post-step. true forces it on, false forces it off; omitted falls back to the merchant's multi_objective_routing_enabled feature flag.

Example request

{
  "merchantId": "test_merchant",
  "paymentInfo": {
    "paymentId": "pay_001",
    "amount": 1000,
    "currency": "USD",
    "country": "US",
    "customerId": "cust_123",
    "paymentType": "ORDER_PAYMENT",
    "paymentMethodType": "CARD",
    "paymentMethod": "CREDIT",
    "authType": "THREE_DS",
    "cardIsin": "411111"
  },
  "eligibleGatewayList": [
    "stripe",
    "paypal",
    "adyen"
  ],
  "rankingAlgorithm": "SR_BASED_ROUTING"
}

Response

Gateway decision result

decided_gatewaystring
routing_approachstring

Routing approach used. SR_SELECTION_MULTI_OBJECTIVE indicates the multi-objective post-step promoted a cheaper gateway over the SR head.

gateway_priority_mapobject
routing_dimensionstring
routing_dimension_levelstring
reset_approachstring
is_scheduled_outageboolean
is_rust_based_deciderboolean
latencynumber

Example response

{
  "decided_gateway": "stripe",
  "routing_approach": "SR_SELECTION_V3_ROUTING",
  "gateway_priority_map": {
    "stripe": 0.94,
    "adyen": 0.87,
    "paypal": 0.72
  },
  "debit_routing_output": {
    "co_badged_card_networks_info": [
      {
        "network": "NYCE",
        "saving_percentage": 1.2
      }
    ],
    "issuer_country": "US",
    "card_type": "Debit"
  },
  "multi_objective_info": {
    "outcome": "COST_WON",
    "reason": "Promoted 'adyen' over 'stripe' on expected value — saves 80.00 bps for 3.00pp auth.",
    "srHead": {
      "psp": "adyen",
      "authRate": 0.91,
      "costBps": 100
    },
    "chosen": {
      "psp": "adyen",
      "authRate": 0.91,
      "costBps": 100
    },
    "costSavedBps": 80,
    "qualifiedCount": 3,
    "margin": 0.2,
    "evGapTop2": 0.00182
  }
}