Profile - Activate routing algorithm
curl --request PATCH \
--url https://sandbox.hyperswitch.io/v2/profiles/{id}/activate-routing-algorithm \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"routing_algorithm_id": "routing_algorithm_123"
}
'import requests
url = "https://sandbox.hyperswitch.io/v2/profiles/{id}/activate-routing-algorithm"
payload = { "routing_algorithm_id": "routing_algorithm_123" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({routing_algorithm_id: 'routing_algorithm_123'})
};
fetch('https://sandbox.hyperswitch.io/v2/profiles/{id}/activate-routing-algorithm', 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.hyperswitch.io/v2/profiles/{id}/activate-routing-algorithm",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'routing_algorithm_id' => 'routing_algorithm_123'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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 := "https://sandbox.hyperswitch.io/v2/profiles/{id}/activate-routing-algorithm"
payload := strings.NewReader("{\n \"routing_algorithm_id\": \"routing_algorithm_123\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<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.patch("https://sandbox.hyperswitch.io/v2/profiles/{id}/activate-routing-algorithm")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"routing_algorithm_id\": \"routing_algorithm_123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.hyperswitch.io/v2/profiles/{id}/activate-routing-algorithm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"routing_algorithm_id\": \"routing_algorithm_123\"\n}"
response = http.request(request)
puts response.read_body{
"id": "routing_abc123",
"profile_id": "profile_123",
"name": "india_card_routing",
"kind": "single",
"description": "Volume split routing for domestic transactions",
"created_at": 1718000000000,
"modified_at": 1718050000000,
"algorithm_for": "payment",
"decision_engine_routing_id": "de_route_456"
}Profile
Profile - Activate routing algorithm
Activates a routing algorithm under a profile
PATCH
/
v2
/
profiles
/
{id}
/
activate-routing-algorithm
Profile - Activate routing algorithm
curl --request PATCH \
--url https://sandbox.hyperswitch.io/v2/profiles/{id}/activate-routing-algorithm \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"routing_algorithm_id": "routing_algorithm_123"
}
'import requests
url = "https://sandbox.hyperswitch.io/v2/profiles/{id}/activate-routing-algorithm"
payload = { "routing_algorithm_id": "routing_algorithm_123" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({routing_algorithm_id: 'routing_algorithm_123'})
};
fetch('https://sandbox.hyperswitch.io/v2/profiles/{id}/activate-routing-algorithm', 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.hyperswitch.io/v2/profiles/{id}/activate-routing-algorithm",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'routing_algorithm_id' => 'routing_algorithm_123'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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 := "https://sandbox.hyperswitch.io/v2/profiles/{id}/activate-routing-algorithm"
payload := strings.NewReader("{\n \"routing_algorithm_id\": \"routing_algorithm_123\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<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.patch("https://sandbox.hyperswitch.io/v2/profiles/{id}/activate-routing-algorithm")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"routing_algorithm_id\": \"routing_algorithm_123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.hyperswitch.io/v2/profiles/{id}/activate-routing-algorithm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"routing_algorithm_id\": \"routing_algorithm_123\"\n}"
response = http.request(request)
puts response.read_body{
"id": "routing_abc123",
"profile_id": "profile_123",
"name": "india_card_routing",
"kind": "single",
"description": "Volume split routing for domestic transactions",
"created_at": 1718000000000,
"modified_at": 1718050000000,
"algorithm_for": "payment",
"decision_engine_routing_id": "de_route_456"
}Authorizations
api_keyjwt_key
Response
Routing Algorithm is activated
Metadata record representing a stored routing configuration.
Used in routing dictionary listings.
Was this page helpful?