---
title: "Legacy decision gateway"
method: POST
path: "/decision_gateway"
tags: ["Compatibility"]
---

# Legacy decision gateway

`POST /decision_gateway`

Legacy compatibility route. New integrations should use /decide-gateway.

## Request body

- LegacyDeciderRequest — Legacy decider payload built from full internal transaction objects. This is NOT the `/decide-gateway` shape. The endpoint rejects the `/decide-gateway` body with a 400. `orderMetadata`, `txnDetail` and `txnCardInfo` must each carry a `partitionKey` key (value may be null).
  - `orderReference` object, required — Full internal order object. `merchantId` inside it identifies the merchant.
  - `orderMetadata` object, required — Full internal order-metadata object. Required. Note: `partitionKey` must be PRESENT in this object (it may be `null`). It is an `Option` field with a custom `deserialize_with` and no `serde(default)`, so serde requires the key even though the value is nullable.
    - `partitionKey` string, nullable, required — Required key. May be null.
  - `txnDetail` object, required — Full internal transaction object. Note: `partitionKey` must be PRESENT in this object (it may be `null`). It is an `Option` field with a custom `deserialize_with` and no `serde(default)`, so serde requires the key even though the value is nullable.
    - `partitionKey` string, nullable, required — Required key. May be null.
  - `txnCardInfo` object, required — Full internal card/payment-method object. Note: `partitionKey` must be PRESENT in this object (it may be `null`). It is an `Option` field with a custom `deserialize_with` and no `serde(default)`, so serde requires the key even though the value is nullable.
    - `partitionKey` string, nullable, required — Required key. May be null.
  - `merchantAccount` object, required — Full internal merchant account object.
  - `txnOfferDetails` object[], nullable
  - `cardToken` string, nullable
  - `txnType` string, nullable
  - `shouldCreateMandate` boolean, nullable
  - `enforceGatewayList` string[], nullable
  - `priorityLogicOutput` object, nullable — Precomputed priority-logic output.
  - `priorityLogicScript` string, nullable
  - `isEdccApplied` boolean, nullable
  - `shouldConsumeResult` boolean, nullable

## Response `200`

Gateway decision result

- DecidedGateway
  - `decided_gateway` string
  - `fallback_gateways` string[]
  - `gateway_priority_map` object, nullable
  - `filter_wise_gateways` object, nullable
  - `priority_logic_tag` string, nullable
  - `routing_approach` string — SR_SELECTION_MULTI_OBJECTIVE indicates the multi-objective post-step promoted a cheaper gateway over the SR head.
  - `gateway_before_evaluation` string, nullable — Gateway the SR head selected before the multi-objective / debit-routing post-step replaced it.
  - `priority_logic_output` object, nullable
  - `debit_routing_output` DebitRoutingOutput
    - `co_badged_card_networks_info` object[]
      - `network` string
      - `saving_percentage` number
    - `issuer_country` string
    - `is_regulated` boolean
    - `regulated_name` string, nullable
    - `card_type` string
  - `reset_approach` 'ELIMINATION_RESET' | 'SRV2_RESET' | 'SRV3_RESET' | 'NO_RESET' | 'SRV2_ELIMINATION_RESET' | 'SRV3_ELIMINATION_RESET'
  - `routing_dimension` string, nullable
  - `routing_dimension_level` string, nullable
  - `is_scheduled_outage` boolean
  - `is_dynamic_mga_enabled` boolean
  - `gateway_mga_id_map` object, nullable
  - `is_rust_based_decider` boolean
  - `latency` integer, nullable
  - `multi_objective_info` MultiObjectiveInfo — Present when the multi-objective (cost-aware) post-step ran. Explains why the gateway was picked: the SR head was kept (AUTH_WON) or a higher economic-value PSP was promoted (COST_WON). Economic value is auth rate × settlement value, where settlement value = txn amount − cost of payment processing (acquirer, issuer & network fee).
    - `outcome` 'COST_WON' | 'AUTH_WON'
    - `reason` string
    - `srHead` PspSummary
      - `psp` string
      - `authRate` number
      - `costBps` number, nullable
    - `chosen` PspSummary
      - `psp` string
      - `authRate` number
      - `costBps` number, nullable
    - `costSavedBps` number, nullable — Fee saved in bps when outcome is COST_WON (srHead.costBps - chosen.costBps).
    - `qualifiedCount` integer — Number of PSPs that had cost data and were ranked on expected value.
    - `margin` number — Merchant margin (fraction of ticket) applied for this transaction. Configured via the successRate config margin field; defaults to 1.0.
    - `evGapTop2` number, nullable — Expected-value gap between the top-two EV-ranked PSPs, as a fraction of ticket. Null when fewer than two PSPs had cost data.

## Other responses

- `400` — Bad request

---

[API](https://skmtc.net/juspay/apis/decision-engine.md) · [All operations](https://skmtc.net/juspay/apis/decision-engine/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/juspay/decision-engine/versions/36e7a0972ee6/schema)
