Routing - Evaluate
curl --request POST \
--url https://sandbox.orchestratorx.com/routing/evaluate \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"paymentInfo": {
"paymentId": "pay_12345",
"amount": "100",
"currency": "USD",
"paymentType": "ORDER_PAYMENT",
"metadata": "metadata",
"paymentMethodType": "upi",
"paymentMethod": "upi",
"cardIsin": "424242"
},
"merchantId": "pro_aMoPnEkgCVnh2WVsFe32",
"eligibleGatewayList": "[\"stripe:mca_123\", \"adyen:mca_456\"]",
"eliminationEnabled": true
}
'import requests
url = "https://sandbox.orchestratorx.com/routing/evaluate"
payload = {
"paymentInfo": {
"paymentId": "pay_12345",
"amount": "100",
"currency": "USD",
"paymentType": "ORDER_PAYMENT",
"metadata": "metadata",
"paymentMethodType": "upi",
"paymentMethod": "upi",
"cardIsin": "424242"
},
"merchantId": "pro_aMoPnEkgCVnh2WVsFe32",
"eligibleGatewayList": "[\"stripe:mca_123\", \"adyen:mca_456\"]",
"eliminationEnabled": True
}
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
paymentInfo: {
paymentId: 'pay_12345',
amount: '100',
currency: 'USD',
paymentType: 'ORDER_PAYMENT',
metadata: 'metadata',
paymentMethodType: 'upi',
paymentMethod: 'upi',
cardIsin: '424242'
},
merchantId: 'pro_aMoPnEkgCVnh2WVsFe32',
eligibleGatewayList: '["stripe:mca_123", "adyen:mca_456"]',
eliminationEnabled: true
})
};
fetch('https://sandbox.orchestratorx.com/routing/evaluate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.orchestratorx.com/routing/evaluate",
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([
'paymentInfo' => [
'paymentId' => 'pay_12345',
'amount' => '100',
'currency' => 'USD',
'paymentType' => 'ORDER_PAYMENT',
'metadata' => 'metadata',
'paymentMethodType' => 'upi',
'paymentMethod' => 'upi',
'cardIsin' => '424242'
],
'merchantId' => 'pro_aMoPnEkgCVnh2WVsFe32',
'eligibleGatewayList' => '["stripe:mca_123", "adyen:mca_456"]',
'eliminationEnabled' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api-key: <api-key>"
],
]);
$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 := "https://sandbox.orchestratorx.com/routing/evaluate"
payload := strings.NewReader("{\n \"paymentInfo\": {\n \"paymentId\": \"pay_12345\",\n \"amount\": \"100\",\n \"currency\": \"USD\",\n \"paymentType\": \"ORDER_PAYMENT\",\n \"metadata\": \"metadata\",\n \"paymentMethodType\": \"upi\",\n \"paymentMethod\": \"upi\",\n \"cardIsin\": \"424242\"\n },\n \"merchantId\": \"pro_aMoPnEkgCVnh2WVsFe32\",\n \"eligibleGatewayList\": \"[\\\"stripe:mca_123\\\", \\\"adyen:mca_456\\\"]\",\n \"eliminationEnabled\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api-key", "<api-key>")
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("https://sandbox.orchestratorx.com/routing/evaluate")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"paymentInfo\": {\n \"paymentId\": \"pay_12345\",\n \"amount\": \"100\",\n \"currency\": \"USD\",\n \"paymentType\": \"ORDER_PAYMENT\",\n \"metadata\": \"metadata\",\n \"paymentMethodType\": \"upi\",\n \"paymentMethod\": \"upi\",\n \"cardIsin\": \"424242\"\n },\n \"merchantId\": \"pro_aMoPnEkgCVnh2WVsFe32\",\n \"eligibleGatewayList\": \"[\\\"stripe:mca_123\\\", \\\"adyen:mca_456\\\"]\",\n \"eliminationEnabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.orchestratorx.com/routing/evaluate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"paymentInfo\": {\n \"paymentId\": \"pay_12345\",\n \"amount\": \"100\",\n \"currency\": \"USD\",\n \"paymentType\": \"ORDER_PAYMENT\",\n \"metadata\": \"metadata\",\n \"paymentMethodType\": \"upi\",\n \"paymentMethod\": \"upi\",\n \"cardIsin\": \"424242\"\n },\n \"merchantId\": \"pro_aMoPnEkgCVnh2WVsFe32\",\n \"eligibleGatewayList\": \"[\\\"stripe:mca_123\\\", \\\"adyen:mca_456\\\"]\",\n \"eliminationEnabled\": true\n}"
response = http.request(request)
puts response.read_body{
"decided_gateway": "stripe:mca1",
"gateway_priority_map": {
"adyen:mca2": 1,
"stripe:mca1": 1
},
"filter_wise_gateways": {},
"priority_logic_tag": "<string>",
"routing_approach": "SR_SELECTION_V3_ROUTING",
"gateway_before_evaluation": "adyen:mca2",
"priority_logic_output": {
"isEnforcement": false,
"gws": [
"stripe:mca1",
"adyen:mca2"
],
"priorityLogicTag": "<string>",
"gatewayReferenceIds": {},
"primaryLogic": {
"name": "success_rate_logic",
"status": "success",
"failure_reason": "insufficient_data"
},
"fallbackLogic": {
"name": "success_rate_logic",
"status": "success",
"failure_reason": "insufficient_data"
}
},
"reset_approach": "NO_RESET",
"routing_dimension": "ORDER_PAYMENT, UPI, upi",
"routing_dimension_level": "PM_LEVEL",
"is_scheduled_outage": false,
"is_dynamic_mga_enabled": false,
"gateway_mga_id_map": {}
}Routing
Routing - Evaluate
Evaluate routing rules
POST
/
routing
/
evaluate
Routing - Evaluate
curl --request POST \
--url https://sandbox.orchestratorx.com/routing/evaluate \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"paymentInfo": {
"paymentId": "pay_12345",
"amount": "100",
"currency": "USD",
"paymentType": "ORDER_PAYMENT",
"metadata": "metadata",
"paymentMethodType": "upi",
"paymentMethod": "upi",
"cardIsin": "424242"
},
"merchantId": "pro_aMoPnEkgCVnh2WVsFe32",
"eligibleGatewayList": "[\"stripe:mca_123\", \"adyen:mca_456\"]",
"eliminationEnabled": true
}
'import requests
url = "https://sandbox.orchestratorx.com/routing/evaluate"
payload = {
"paymentInfo": {
"paymentId": "pay_12345",
"amount": "100",
"currency": "USD",
"paymentType": "ORDER_PAYMENT",
"metadata": "metadata",
"paymentMethodType": "upi",
"paymentMethod": "upi",
"cardIsin": "424242"
},
"merchantId": "pro_aMoPnEkgCVnh2WVsFe32",
"eligibleGatewayList": "[\"stripe:mca_123\", \"adyen:mca_456\"]",
"eliminationEnabled": True
}
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
paymentInfo: {
paymentId: 'pay_12345',
amount: '100',
currency: 'USD',
paymentType: 'ORDER_PAYMENT',
metadata: 'metadata',
paymentMethodType: 'upi',
paymentMethod: 'upi',
cardIsin: '424242'
},
merchantId: 'pro_aMoPnEkgCVnh2WVsFe32',
eligibleGatewayList: '["stripe:mca_123", "adyen:mca_456"]',
eliminationEnabled: true
})
};
fetch('https://sandbox.orchestratorx.com/routing/evaluate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.orchestratorx.com/routing/evaluate",
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([
'paymentInfo' => [
'paymentId' => 'pay_12345',
'amount' => '100',
'currency' => 'USD',
'paymentType' => 'ORDER_PAYMENT',
'metadata' => 'metadata',
'paymentMethodType' => 'upi',
'paymentMethod' => 'upi',
'cardIsin' => '424242'
],
'merchantId' => 'pro_aMoPnEkgCVnh2WVsFe32',
'eligibleGatewayList' => '["stripe:mca_123", "adyen:mca_456"]',
'eliminationEnabled' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api-key: <api-key>"
],
]);
$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 := "https://sandbox.orchestratorx.com/routing/evaluate"
payload := strings.NewReader("{\n \"paymentInfo\": {\n \"paymentId\": \"pay_12345\",\n \"amount\": \"100\",\n \"currency\": \"USD\",\n \"paymentType\": \"ORDER_PAYMENT\",\n \"metadata\": \"metadata\",\n \"paymentMethodType\": \"upi\",\n \"paymentMethod\": \"upi\",\n \"cardIsin\": \"424242\"\n },\n \"merchantId\": \"pro_aMoPnEkgCVnh2WVsFe32\",\n \"eligibleGatewayList\": \"[\\\"stripe:mca_123\\\", \\\"adyen:mca_456\\\"]\",\n \"eliminationEnabled\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api-key", "<api-key>")
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("https://sandbox.orchestratorx.com/routing/evaluate")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"paymentInfo\": {\n \"paymentId\": \"pay_12345\",\n \"amount\": \"100\",\n \"currency\": \"USD\",\n \"paymentType\": \"ORDER_PAYMENT\",\n \"metadata\": \"metadata\",\n \"paymentMethodType\": \"upi\",\n \"paymentMethod\": \"upi\",\n \"cardIsin\": \"424242\"\n },\n \"merchantId\": \"pro_aMoPnEkgCVnh2WVsFe32\",\n \"eligibleGatewayList\": \"[\\\"stripe:mca_123\\\", \\\"adyen:mca_456\\\"]\",\n \"eliminationEnabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.orchestratorx.com/routing/evaluate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"paymentInfo\": {\n \"paymentId\": \"pay_12345\",\n \"amount\": \"100\",\n \"currency\": \"USD\",\n \"paymentType\": \"ORDER_PAYMENT\",\n \"metadata\": \"metadata\",\n \"paymentMethodType\": \"upi\",\n \"paymentMethod\": \"upi\",\n \"cardIsin\": \"424242\"\n },\n \"merchantId\": \"pro_aMoPnEkgCVnh2WVsFe32\",\n \"eligibleGatewayList\": \"[\\\"stripe:mca_123\\\", \\\"adyen:mca_456\\\"]\",\n \"eliminationEnabled\": true\n}"
response = http.request(request)
puts response.read_body{
"decided_gateway": "stripe:mca1",
"gateway_priority_map": {
"adyen:mca2": 1,
"stripe:mca1": 1
},
"filter_wise_gateways": {},
"priority_logic_tag": "<string>",
"routing_approach": "SR_SELECTION_V3_ROUTING",
"gateway_before_evaluation": "adyen:mca2",
"priority_logic_output": {
"isEnforcement": false,
"gws": [
"stripe:mca1",
"adyen:mca2"
],
"priorityLogicTag": "<string>",
"gatewayReferenceIds": {},
"primaryLogic": {
"name": "success_rate_logic",
"status": "success",
"failure_reason": "insufficient_data"
},
"fallbackLogic": {
"name": "success_rate_logic",
"status": "success",
"failure_reason": "insufficient_data"
}
},
"reset_approach": "NO_RESET",
"routing_dimension": "ORDER_PAYMENT, UPI, upi",
"routing_dimension_level": "PM_LEVEL",
"is_scheduled_outage": false,
"is_dynamic_mga_enabled": false,
"gateway_mga_id_map": {}
}Authorizations
Body
application/json
Request to decide the optimal gateway for routing a payment
Response
Routing rules evaluated successfully