Legacy decision gateway
curl --request POST \
--url http://localhost:8080/decision_gateway \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"orderReference": {},
"orderMetadata": {
"partitionKey": "<string>"
},
"txnDetail": {
"partitionKey": "<string>"
},
"txnCardInfo": {
"partitionKey": "<string>"
},
"merchantAccount": {},
"txnOfferDetails": [
{}
],
"cardToken": "<string>",
"txnType": "<string>",
"shouldCreateMandate": true,
"enforceGatewayList": [
"stripe",
"adyen"
],
"priorityLogicOutput": {},
"priorityLogicScript": "<string>",
"isEdccApplied": true,
"shouldConsumeResult": true
}
'import requests
url = "http://localhost:8080/decision_gateway"
payload = {
"orderReference": {},
"orderMetadata": { "partitionKey": "<string>" },
"txnDetail": { "partitionKey": "<string>" },
"txnCardInfo": { "partitionKey": "<string>" },
"merchantAccount": {},
"txnOfferDetails": [{}],
"cardToken": "<string>",
"txnType": "<string>",
"shouldCreateMandate": True,
"enforceGatewayList": ["stripe", "adyen"],
"priorityLogicOutput": {},
"priorityLogicScript": "<string>",
"isEdccApplied": True,
"shouldConsumeResult": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
orderReference: {},
orderMetadata: {partitionKey: '<string>'},
txnDetail: {partitionKey: '<string>'},
txnCardInfo: {partitionKey: '<string>'},
merchantAccount: {},
txnOfferDetails: [{}],
cardToken: '<string>',
txnType: '<string>',
shouldCreateMandate: true,
enforceGatewayList: ['stripe', 'adyen'],
priorityLogicOutput: {},
priorityLogicScript: '<string>',
isEdccApplied: true,
shouldConsumeResult: true
})
};
fetch('http://localhost:8080/decision_gateway', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/decision_gateway",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'orderReference' => [
],
'orderMetadata' => [
'partitionKey' => '<string>'
],
'txnDetail' => [
'partitionKey' => '<string>'
],
'txnCardInfo' => [
'partitionKey' => '<string>'
],
'merchantAccount' => [
],
'txnOfferDetails' => [
[
]
],
'cardToken' => '<string>',
'txnType' => '<string>',
'shouldCreateMandate' => true,
'enforceGatewayList' => [
'stripe',
'adyen'
],
'priorityLogicOutput' => [
],
'priorityLogicScript' => '<string>',
'isEdccApplied' => true,
'shouldConsumeResult' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/decision_gateway"
payload := strings.NewReader("{\n \"orderReference\": {},\n \"orderMetadata\": {\n \"partitionKey\": \"<string>\"\n },\n \"txnDetail\": {\n \"partitionKey\": \"<string>\"\n },\n \"txnCardInfo\": {\n \"partitionKey\": \"<string>\"\n },\n \"merchantAccount\": {},\n \"txnOfferDetails\": [\n {}\n ],\n \"cardToken\": \"<string>\",\n \"txnType\": \"<string>\",\n \"shouldCreateMandate\": true,\n \"enforceGatewayList\": [\n \"stripe\",\n \"adyen\"\n ],\n \"priorityLogicOutput\": {},\n \"priorityLogicScript\": \"<string>\",\n \"isEdccApplied\": true,\n \"shouldConsumeResult\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8080/decision_gateway")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"orderReference\": {},\n \"orderMetadata\": {\n \"partitionKey\": \"<string>\"\n },\n \"txnDetail\": {\n \"partitionKey\": \"<string>\"\n },\n \"txnCardInfo\": {\n \"partitionKey\": \"<string>\"\n },\n \"merchantAccount\": {},\n \"txnOfferDetails\": [\n {}\n ],\n \"cardToken\": \"<string>\",\n \"txnType\": \"<string>\",\n \"shouldCreateMandate\": true,\n \"enforceGatewayList\": [\n \"stripe\",\n \"adyen\"\n ],\n \"priorityLogicOutput\": {},\n \"priorityLogicScript\": \"<string>\",\n \"isEdccApplied\": true,\n \"shouldConsumeResult\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/decision_gateway")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orderReference\": {},\n \"orderMetadata\": {\n \"partitionKey\": \"<string>\"\n },\n \"txnDetail\": {\n \"partitionKey\": \"<string>\"\n },\n \"txnCardInfo\": {\n \"partitionKey\": \"<string>\"\n },\n \"merchantAccount\": {},\n \"txnOfferDetails\": [\n {}\n ],\n \"cardToken\": \"<string>\",\n \"txnType\": \"<string>\",\n \"shouldCreateMandate\": true,\n \"enforceGatewayList\": [\n \"stripe\",\n \"adyen\"\n ],\n \"priorityLogicOutput\": {},\n \"priorityLogicScript\": \"<string>\",\n \"isEdccApplied\": true,\n \"shouldConsumeResult\": true\n}"
response = http.request(request)
puts response.read_body{
"decided_gateway": "stripe",
"routing_approach": "SR_SELECTION_V3_ROUTING",
"gateway_priority_map": {
"stripe": 0.94,
"adyen": 0.87,
"paypal": 0.72
},
"routing_dimension": "<string>",
"routing_dimension_level": "<string>",
"reset_approach": "<string>",
"is_scheduled_outage": true,
"is_rust_based_decider": true,
"debit_routing_output": {
"co_badged_card_networks_info": [
{
"network": "NYCE",
"saving_percentage": 1.2
}
],
"issuer_country": "US",
"is_regulated": false,
"regulated_name": "<string>",
"card_type": "Debit"
},
"latency": 123,
"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
},
"fallback_gateways": [
"adyen"
],
"filter_wise_gateways": {},
"priority_logic_tag": "<string>",
"priority_logic_output": {},
"gateway_mga_id_map": {},
"is_dynamic_mga_enabled": true,
"gateway_before_evaluation": "<string>"
}{
"status": "400",
"error_code": "DATA_NOT_FOUND",
"error_message": "merchant iframe preferences not found",
"priority_logic_tag": "<string>",
"routing_approach": "<string>",
"filter_wise_gateways": {},
"error_info": {
"code": "MERCHANT_IFRAME_PREFERENCES_NOT_FOUND",
"user_message": "<string>",
"developer_message": "<string>"
},
"priority_logic_output": {},
"is_dynamic_mga_enabled": true
}OpenAPI: Compatibility And Config
Legacy Decision Gateway
Legacy compatibility route. New integrations should use /decide-gateway.
POST
/
decision_gateway
Legacy decision gateway
curl --request POST \
--url http://localhost:8080/decision_gateway \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"orderReference": {},
"orderMetadata": {
"partitionKey": "<string>"
},
"txnDetail": {
"partitionKey": "<string>"
},
"txnCardInfo": {
"partitionKey": "<string>"
},
"merchantAccount": {},
"txnOfferDetails": [
{}
],
"cardToken": "<string>",
"txnType": "<string>",
"shouldCreateMandate": true,
"enforceGatewayList": [
"stripe",
"adyen"
],
"priorityLogicOutput": {},
"priorityLogicScript": "<string>",
"isEdccApplied": true,
"shouldConsumeResult": true
}
'import requests
url = "http://localhost:8080/decision_gateway"
payload = {
"orderReference": {},
"orderMetadata": { "partitionKey": "<string>" },
"txnDetail": { "partitionKey": "<string>" },
"txnCardInfo": { "partitionKey": "<string>" },
"merchantAccount": {},
"txnOfferDetails": [{}],
"cardToken": "<string>",
"txnType": "<string>",
"shouldCreateMandate": True,
"enforceGatewayList": ["stripe", "adyen"],
"priorityLogicOutput": {},
"priorityLogicScript": "<string>",
"isEdccApplied": True,
"shouldConsumeResult": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
orderReference: {},
orderMetadata: {partitionKey: '<string>'},
txnDetail: {partitionKey: '<string>'},
txnCardInfo: {partitionKey: '<string>'},
merchantAccount: {},
txnOfferDetails: [{}],
cardToken: '<string>',
txnType: '<string>',
shouldCreateMandate: true,
enforceGatewayList: ['stripe', 'adyen'],
priorityLogicOutput: {},
priorityLogicScript: '<string>',
isEdccApplied: true,
shouldConsumeResult: true
})
};
fetch('http://localhost:8080/decision_gateway', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/decision_gateway",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'orderReference' => [
],
'orderMetadata' => [
'partitionKey' => '<string>'
],
'txnDetail' => [
'partitionKey' => '<string>'
],
'txnCardInfo' => [
'partitionKey' => '<string>'
],
'merchantAccount' => [
],
'txnOfferDetails' => [
[
]
],
'cardToken' => '<string>',
'txnType' => '<string>',
'shouldCreateMandate' => true,
'enforceGatewayList' => [
'stripe',
'adyen'
],
'priorityLogicOutput' => [
],
'priorityLogicScript' => '<string>',
'isEdccApplied' => true,
'shouldConsumeResult' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/decision_gateway"
payload := strings.NewReader("{\n \"orderReference\": {},\n \"orderMetadata\": {\n \"partitionKey\": \"<string>\"\n },\n \"txnDetail\": {\n \"partitionKey\": \"<string>\"\n },\n \"txnCardInfo\": {\n \"partitionKey\": \"<string>\"\n },\n \"merchantAccount\": {},\n \"txnOfferDetails\": [\n {}\n ],\n \"cardToken\": \"<string>\",\n \"txnType\": \"<string>\",\n \"shouldCreateMandate\": true,\n \"enforceGatewayList\": [\n \"stripe\",\n \"adyen\"\n ],\n \"priorityLogicOutput\": {},\n \"priorityLogicScript\": \"<string>\",\n \"isEdccApplied\": true,\n \"shouldConsumeResult\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8080/decision_gateway")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"orderReference\": {},\n \"orderMetadata\": {\n \"partitionKey\": \"<string>\"\n },\n \"txnDetail\": {\n \"partitionKey\": \"<string>\"\n },\n \"txnCardInfo\": {\n \"partitionKey\": \"<string>\"\n },\n \"merchantAccount\": {},\n \"txnOfferDetails\": [\n {}\n ],\n \"cardToken\": \"<string>\",\n \"txnType\": \"<string>\",\n \"shouldCreateMandate\": true,\n \"enforceGatewayList\": [\n \"stripe\",\n \"adyen\"\n ],\n \"priorityLogicOutput\": {},\n \"priorityLogicScript\": \"<string>\",\n \"isEdccApplied\": true,\n \"shouldConsumeResult\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/decision_gateway")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orderReference\": {},\n \"orderMetadata\": {\n \"partitionKey\": \"<string>\"\n },\n \"txnDetail\": {\n \"partitionKey\": \"<string>\"\n },\n \"txnCardInfo\": {\n \"partitionKey\": \"<string>\"\n },\n \"merchantAccount\": {},\n \"txnOfferDetails\": [\n {}\n ],\n \"cardToken\": \"<string>\",\n \"txnType\": \"<string>\",\n \"shouldCreateMandate\": true,\n \"enforceGatewayList\": [\n \"stripe\",\n \"adyen\"\n ],\n \"priorityLogicOutput\": {},\n \"priorityLogicScript\": \"<string>\",\n \"isEdccApplied\": true,\n \"shouldConsumeResult\": true\n}"
response = http.request(request)
puts response.read_body{
"decided_gateway": "stripe",
"routing_approach": "SR_SELECTION_V3_ROUTING",
"gateway_priority_map": {
"stripe": 0.94,
"adyen": 0.87,
"paypal": 0.72
},
"routing_dimension": "<string>",
"routing_dimension_level": "<string>",
"reset_approach": "<string>",
"is_scheduled_outage": true,
"is_rust_based_decider": true,
"debit_routing_output": {
"co_badged_card_networks_info": [
{
"network": "NYCE",
"saving_percentage": 1.2
}
],
"issuer_country": "US",
"is_regulated": false,
"regulated_name": "<string>",
"card_type": "Debit"
},
"latency": 123,
"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
},
"fallback_gateways": [
"adyen"
],
"filter_wise_gateways": {},
"priority_logic_tag": "<string>",
"priority_logic_output": {},
"gateway_mga_id_map": {},
"is_dynamic_mga_enabled": true,
"gateway_before_evaluation": "<string>"
}{
"status": "400",
"error_code": "DATA_NOT_FOUND",
"error_message": "merchant iframe preferences not found",
"priority_logic_tag": "<string>",
"routing_approach": "<string>",
"filter_wise_gateways": {},
"error_info": {
"code": "MERCHANT_IFRAME_PREFERENCES_NOT_FOUND",
"user_message": "<string>",
"developer_message": "<string>"
},
"priority_logic_output": {},
"is_dynamic_mga_enabled": true
}Authorizations
BearerAuthApiKeyAuth
Body
application/json
Legacy decider payload built from full internal transaction objects. This is NOT the /decide-gateway shape - posting that body here is rejected with a 400. orderMetadata, txnDetail and txnCardInfo must each carry a partitionKey key (value may be null).
Response
Gateway decision result
Was this page helpful?