Legacy Decision Gateway
August 4, 2026 ยท View on GitHub
Use case
Compatibility endpoint for older integrations that still call /decision_gateway.
Authentication
Protected. Send either Authorization: Bearer <jwt_token> or x-api-key: <api_key>. In sandbox, also send x-feature: decision-engine.
For local development, start with:
export BASE_URL=http://localhost:8080
export AUTH_HEADER="Authorization: Bearer <jwt_token>"
# Sandbox only:
# export BASE_URL=https://sandbox.hyperswitch.io
# export FEATURE_HEADER="x-feature: decision-engine"
Request
- Method and path:
POST /decision_gateway - Parameters: none.
- Body: The legacy decider payload built from full internal transaction objects (
orderReference,orderMetadata,txnDetail,txnCardInfo,merchantAccount). This is not the/decide-gatewayshape - the endpoint rejects the/decide-gatewaybody with a 400.
All five objects are required and each has its own required fields. Note in particular:
orderReference.udfsis an array of strings (indexed positionally), not an object.- The
idfields (orderReference.id,orderMetadata.id,txnDetail.id,txnCardInfo.id,txnCardInfo.txnDetailId,merchantAccount.id) are integers, not strings. merchantAccount.gatewaySuccessRateBasedDeciderInputis a required string, sonullis rejected.orderMetadata,txnDetailandtxnCardInfomust each carry apartitionKeykey. The value may benull, but omitting the key fails withmissing field \partitionKey`. These areOptionfields with a custom deserializer and noserde(default)`, so serde requires the key to be present even though the value is nullable.- Timestamps are ISO 8601.
Example
Legacy decision call
curl --location "$BASE_URL/decision_gateway" \
--header "$AUTH_HEADER" \
--header "Content-Type: application/json" \
--data '{
"orderReference": {
"id": 1,
"orderId": "order_001",
"amount": 1000.0,
"currency": "USD",
"dateCreated": "2026-04-30T00:00:00.000000000Z",
"merchantId": "merchant_demo",
"status": "NEW",
"orderType": "ORDER_PAYMENT",
"udfs": [],
"customerId": "cust_123",
"preferredGateway": null,
"metadata": null
},
"orderMetadata": {
"id": 1,
"dateCreated": "2026-04-30T00:00:00.000000000Z",
"lastUpdated": "2026-04-30T00:00:00.000000000Z",
"orderReferenceId": 1,
"partitionKey": null
},
"txnDetail": {
"id": 1,
"dateCreated": "2026-04-30T00:00:00.000000000Z",
"orderId": "order_001",
"status": "PENDING_VBV",
"txnId": "txn_001",
"merchantId": "merchant_demo",
"txnUuid": "pay_001",
"currency": "USD",
"txnAmount": 1000.0,
"txnObjectType": "ORDER_PAYMENT",
"txnType": "ORDER_PAYMENT",
"gateway": "stripe",
"sourceObject": "CREDIT",
"isEmi": false,
"partitionKey": null
},
"txnCardInfo": {
"id": 1,
"txnId": "txn_001",
"txnDetailId": 1,
"dateCreated": "2026-04-30T00:00:00.000000000Z",
"paymentMethodType": "CARD",
"paymentMethod": "CREDIT",
"authType": "THREE_DS",
"cardIsin": "411111",
"cardType": "CREDIT",
"partitionKey": null
},
"merchantAccount": {
"id": 1,
"merchantId": "merchant_demo",
"gatewayPriorityLogic": "",
"useCodeForGatewayPriority": true,
"gatewaySuccessRateBasedDeciderInput": "{}"
},
"enforceGatewayList": ["stripe", "adyen", "checkout"],
"priorityLogicScript": null,
"priorityLogicOutput": null
}'
Response
{
"decided_gateway": "stripe",
"gateway_priority_map": {
"stripe": 0.94,
"adyen": 0.91
},
"routing_approach": "SR_SELECTION_V3_ROUTING"
}
Notes
- New integrations should use
/decide-gateway. - Keep this route for migration compatibility only.