Bug: refactor(routing): receive json value instead of string




diff --git a/crates/router/src/core/routing/helpers.rs b/crates/router/src/core/routing/helpers.rs
index 0b1395ed4ba..98b71748b35 100644
--- a/crates/router/src/core/routing/helpers.rs
+++ b/crates/router/src/core/routing/helpers.rs
@@ -2481,7 +2481,7 @@ pub async fn enable_decision_engine_dynamic_routing_setup(
     create_merchant_in_decision_engine_if_not_exists(state, profile_id, dynamic_routing_algo_ref)
         .await;
 
-    routing_utils::ConfigApiClient::send_decision_engine_request::<_, String>(
+    routing_utils::ConfigApiClient::send_decision_engine_request::<_, serde_json::Value>(
         state,
         services::Method::Post,
         DECISION_ENGINE_RULE_CREATE_ENDPOINT,
@@ -2559,7 +2559,7 @@ pub async fn update_decision_engine_dynamic_routing_setup(
     create_merchant_in_decision_engine_if_not_exists(state, profile_id, dynamic_routing_algo_ref)
         .await;
 
-    routing_utils::ConfigApiClient::send_decision_engine_request::<_, String>(
+    routing_utils::ConfigApiClient::send_decision_engine_request::<_, serde_json::Value>(
         state,
         services::Method::Post,
         DECISION_ENGINE_RULE_UPDATE_ENDPOINT,
@@ -2640,7 +2640,7 @@ pub async fn disable_decision_engine_dynamic_routing_setup(
     create_merchant_in_decision_engine_if_not_exists(state, profile_id, dynamic_routing_algo_ref)
         .await;
 
-    routing_utils::ConfigApiClient::send_decision_engine_request::<_, String>(
+    routing_utils::ConfigApiClient::send_decision_engine_request::<_, serde_json::Value>(
         state,
         services::Method::Post,
         DECISION_ENGINE_RULE_DELETE_ENDPOINT,
@@ -2691,7 +2691,7 @@ pub async fn create_decision_engine_merchant(
         gateway_success_rate_based_decider_input: None,
     };
 
-    routing_utils::ConfigApiClient::send_decision_engine_request::<_, String>(
+    routing_utils::ConfigApiClient::send_decision_engine_request::<_, serde_json::Value>(
         state,
         services::Method::Post,
         DECISION_ENGINE_MERCHANT_CREATE_ENDPOINT,
@@ -2717,7 +2717,7 @@ pub async fn delete_decision_engine_merchant(
         DECISION_ENGINE_MERCHANT_BASE_ENDPOINT,
         profile_id.get_string_repr()
     );
-    routing_utils::ConfigApiClient::send_decision_engine_request::<_, String>(
+    routing_utils::ConfigApiClient::send_decision_engine_request::<_, serde_json::Value>(
         state,
         services::Method::Delete,
         &path,

## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [ ] Bugfix
- [ ] New feature
- [ ] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Description
Refactoring to recieve json response instead of string


Updated `ConfigApiClient::send_decision_engine_request` calls in `crates/router/src/core/routing/helpers.rs` to return `serde_json::Value` instead of `String`.
This ensures the response is parsed as JSON for better type safety and avoids manual string-to-JSON conversions in downstream logic.

### Changes Made

* Replaced generic type parameter `String` with `serde_json::Value` in the following functions:

  * `enable_decision_engine_dynamic_routing_setup`
  * `update_decision_engine_dynamic_routing_setup`
  * `disable_decision_engine_dynamic_routing_setup`
  * `create_decision_engine_merchant`
  * `delete_decision_engine_merchant`

### Purpose

Switching to `serde_json::Value` directly improves clarity, reduces redundant parsing, and enforces better response handling.

### Screenshot

create
<img width="1717" height="93" alt="Screenshot 2025-08-21 at 4 11 10 PM" src="https://github.com/user-attachments/assets/68f8bc6a-ffa4-48fc-b030-68fc0a98da2c" />


update
<img width="1709" height="141" alt="Screenshot 2025-08-21 at 4 30 10 PM" src="https://github.com/user-attachments/assets/1dbf40ea-87d9-40fc-83dc-ac39036262db" />


delete
<img width="1725" height="71" alt="Screenshot 2025-08-21 at 4 31 25 PM" src="https://github.com/user-attachments/assets/bffe1bc7-28ac-43ab-9e4f-e1403dd6bca7" />





<img width="1612" height="992" alt="Screenshot 2025-08-19 at 6 23 55 PM" src="https://github.com/user-attachments/assets/14d788c3-9645-456f-a924-7988e46e9b10" />

<img width="1299" height="962" alt="Screenshot 2025-08-19 at 6 24 33 PM" src="https://github.com/user-attachments/assets/1ef46ebd-e286-4ae4-afcd-a33e3d505d7e" />

<img width="1335" height="637" alt="Screenshot 2025-08-19 at 6 25 46 PM" src="https://github.com/user-attachments/assets/c3a52c37-bbc4-4574-877b-e952406730c8" />

Curls and responses

create

```
curl --location 'http://localhost:8080/account/merchant_1756381962/business_profile/pro_nbWFu0RUhkjNIV4YgAJF/dynamic_routing/success_based/create?enable=dynamic_connector_selection' \
--header 'Content-Type: application/json' \
--header 'api-key:****' \
--data '{
    "decision_engine_configs": {
        "defaultLatencyThreshold": 90,
        "defaultBucketSize": 200,
        "defaultHedgingPercent": 5,
        "subLevelInputConfig": [
            {
                "paymentMethodType": "card",
                "paymentMethod": "credit",
                "bucketSize": 250,
                "hedgingPercent": 1
            }
        ]
    }
}'
```

```
{
    "id": "routing_51b92mSgs0B0PJz5xM9R",
    "profile_id": "pro_nbWFu0RUhkjNIV4YgAJF",
    "name": "Success rate based dynamic routing algorithm",
    "kind": "dynamic",
    "description": "",
    "created_at": 1756381971,
    "modified_at": 1756381971,
    "algorithm_for": "payment",
    "decision_engine_routing_id": null
}

```
update

```
curl --location --request PATCH 'http://localhost:8080/account/merchant_1756381962/business_profile/pro_nbWFu0RUhkjNIV4YgAJF/dynamic_routing/success_based/config/routing_51b92mSgs0B0PJz5xM9R' \
--header 'api-key:****' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
    "decision_engine_configs": {
        "defaultLatencyThreshold": 90,
        "defaultBucketSize": 100,
        "defaultHedgingPercent": 5,
        "subLevelInputConfig": [
            {
                "paymentMethodType": "card",
                "paymentMethod": "credit",
                "bucketSize": 250,
                "hedgingPercent": 1
            }
        ]
    }
}'

```
```
{
    "id": "routing_PTySs5RDUL22VinElTAn",
    "profile_id": "pro_nbWFu0RUhkjNIV4YgAJF",
    "name": "Success rate based dynamic routing algorithm",
    "kind": "dynamic",
    "description": "",
    "created_at": 1756382062,
    "modified_at": 1756382062,
    "algorithm_for": "payment",
    "decision_engine_routing_id": null
}

```

activate 

```
curl --location 'http://localhost:8080/routing/routing_51b92mSgs0B0PJz5xM9R/activate' \
--header 'Content-Type: application/json' \
--header 'api-key:****' \
--data '{}'
```

```
{
    "id": "routing_51b92mSgs0B0PJz5xM9R",
    "profile_id": "pro_nbWFu0RUhkjNIV4YgAJF",
    "name": "Success rate based dynamic routing algorithm",
    "kind": "dynamic",
    "description": "",
    "created_at": 1756381971,
    "modified_at": 1756381971,
    "algorithm_for": "payment",
    "decision_engine_routing_id": null
}
```

deactivate(deletion)

```
curl --location 'http://localhost:8080/account/merchant_1756381962/business_profile/pro_nbWFu0RUhkjNIV4YgAJF/dynamic_routing/success_based/create?enable=none' \
--header 'Content-Type: application/json' \
--header 'api-key:****' \
--data '{
    "decision_engine_configs": {
        "defaultLatencyThreshold": 90,
        "defaultBucketSize": 200,
        "defaultHedgingPercent": 5,
        "subLevelInputConfig": [
            {
                "paymentMethodType": "card",
                "paymentMethod": "credit",
                "bucketSize": 250,
                "hedgingPercent": 1
            }
        ]
    }
}'
```

```
{
    "id": "routing_51b92mSgs0B0PJz5xM9R",
    "profile_id": "pro_nbWFu0RUhkjNIV4YgAJF",
    "name": "Success rate based dynamic routing algorithm",
    "kind": "dynamic",
    "description": "",
    "created_at": 1756381971,
    "modified_at": 1756381971,
    "algorithm_for": "payment",
    "decision_engine_routing_id": null
}
```