Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

docs(routing): add openapi docs for create api (#10022)

Ankit Kumar Gupta351f2c45626a
diff --git a/api-reference/docs.json b/api-reference/docs.json
index 2e11595f36..e0b490378e 100644
--- a/api-reference/docs.json
+++ b/api-reference/docs.json
@@ -222,6 +222,8 @@
"pages": [
"v1/routing/routing--list",
"v1/routing/routing--create",
+ "v1/routing/routing--success-based",
+ "v1/routing/routing--elimination",
"v1/routing/routing--retrieve-config",
"v1/routing/routing--deactivate",
"v1/routing/routing--retrieve-default-config",
diff --git a/api-reference/v1/openapi_spec_v1.json b/api-reference/v1/openapi_spec_v1.json
index 96ba9a6630..31353354c4 100644
--- a/api-reference/v1/openapi_spec_v1.json
+++ b/api-reference/v1/openapi_spec_v1.json
@@ -5175,6 +5175,174 @@
]
}
},
+ "/account/{account_id}/business_profile/{profile_id}/dynamic_routing/success_based/create": {
+ "post": {
+ "tags": [
+ "Routing"
+ ],
+ "summary": "Routing - Auth Rate Based",
+ "description": "Create a success based dynamic routing algorithm",
+ "operationId": "Create success based dynamic routing algorithm",
+ "parameters": [
+ {
+ "name": "account_id",
+ "in": "path",
+ "description": "Merchant id",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "profile_id",
+ "in": "path",
+ "description": "Profile id under which Dynamic routing needs to be created",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "enable",
+ "in": "query",
+ "description": "Feature to enable for success based routing",
+ "required": true,
+ "schema": {
+ "$ref": "#/components/schemas/DynamicRoutingFeatures"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/SuccessBasedRoutingConfig"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "description": "Routing Algorithm created",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RoutingDictionaryRecord"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Request body is malformed"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Resource missing"
+ },
+ "422": {
+ "description": "Unprocessable request"
+ },
+ "500": {
+ "description": "Internal server error"
+ }
+ },
+ "security": [
+ {
+ "api_key": []
+ },
+ {
+ "jwt_key": []
+ }
+ ]
+ }
+ },
+ "/account/{account_id}/business_profile/{profile_id}/dynamic_routing/elimination/create": {
+ "post": {
+ "tags": [
+ "Routing"
+ ],
+ "summary": "Routing - Elimination",
+ "description": "Create a elimination based dynamic routing algorithm",
+ "operationId": "Create elimination routing algorithm",
+ "parameters": [
+ {
+ "name": "account_id",
+ "in": "path",
+ "description": "Merchant id",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "profile_id",
+ "in": "path",
+ "description": "Profile id under which Dynamic routing needs to be created",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "enable",
+ "in": "query",
+ "description": "Feature to enable for elimination based routing",
+ "required": true,
+ "schema": {
+ "$ref": "#/components/schemas/DynamicRoutingFeatures"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/EliminationRoutingConfig"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "description": "Routing Algorithm created",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/RoutingDictionaryRecord"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Request body is malformed"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Resource missing"
+ },
+ "422": {
+ "description": "Unprocessable request"
+ },
+ "500": {
+ "description": "Internal server error"
+ }
+ },
+ "security": [
+ {
+ "api_key": []
+ },
+ {
+ "jwt_key": []
+ }
+ ]
+ }
+ },
"/account/{account_id}/business_profile/{profile_id}/dynamic_routing/contracts/toggle": {
"post": {
"tags": [
diff --git a/api-reference/v1/routing/routing--elimination.mdx b/api-reference/v1/routing/routing--elimination.mdx
new file mode 100644
index 0000000000..cd25f6a007
--- /dev/null
+++ b/api-reference/v1/routing/routing--elimination.mdx
@@ -0,0 +1,3 @@
+---
+openapi: post /account/{account_id}/business_profile/{profile_id}/dynamic_routing/elimination/create
+---
diff --git a/api-reference/v1/routing/routing--success-based.mdx b/api-reference/v1/routing/routing--success-based.mdx
new file mode 100644
index 0000000000..601b5c7b3b
--- /dev/null
+++ b/api-reference/v1/routing/routing--success-based.mdx
@@ -0,0 +1,3 @@
+---
+openapi: post /account/{account_id}/business_profile/{profile_id}/dynamic_routing/success_based/create
+---
diff --git a/crates/openapi/src/openapi.rs b/crates/openapi/src/openapi.rs
index bff3c723e8..7cb0579600 100644
--- a/crates/openapi/src/openapi.rs
+++ b/crates/openapi/src/openapi.rs
@@ -172,6 +172,8 @@ Never share your secret api keys. Keep them guarded and secure.
routes::routing::success_based_routing_update_configs,
routes::routing::toggle_success_based_routing,
routes::routing::toggle_elimination_routing,
+ routes::routing::create_success_based_routing,
+ routes::routing::create_elimination_routing,
routes::routing::contract_based_routing_setup_config,
routes::routing::contract_based_routing_update_configs,
routes::routing::call_decide_gateway_open_router,
diff --git a/crates/openapi/src/routes/routing.rs b/crates/openapi/src/routes/routing.rs
index 234508de37..d7daf8b7db 100644
--- a/crates/openapi/src/routes/routing.rs
+++ b/crates/openapi/src/routes/routing.rs
@@ -280,6 +280,33 @@ pub async fn routing_update_default_config_for_profile() {}
)]
pub async fn toggle_success_based_routing() {}
+#[cfg(feature = "v1")]
+/// Routing - Auth Rate Based
+///
+/// Create a success based dynamic routing algorithm
+#[utoipa::path(
+ post,
+ path = "/account/{account_id}/business_profile/{profile_id}/dynamic_routing/success_based/create",
+ request_body = SuccessBasedRoutingConfig,
+ params(
+ ("account_id" = String, Path, description = "Merchant id"),
+ ("profile_id" = String, Path, description = "Profile id under which Dynamic routing needs to be created"),
+ ("enable" = DynamicRoutingFeatures, Query, description = "Feature to enable for success based routing"),
+ ),
+ responses(
+ (status = 200, description = "Routing Algorithm created", body = RoutingDictionaryRecord),
+ (status = 400, description = "Request body is malformed"),
+ (status = 500, description = "Internal server error"),
+ (status = 404, description = "Resource missing"),
+ (status = 422, description = "Unprocessable request"),
+ (status = 403, description = "Forbidden"),
+ ),
+ tag = "Routing",
+ operation_id = "Create success based dynamic routing algorithm",
+ security(("api_key" = []), ("jwt_key" = []))
+)]
+pub async fn create_success_based_routing() {}
+
#[cfg(feature = "v1")]
/// Routing - Update success based dynamic routing config for profile
///
@@ -333,6 +360,33 @@ pub async fn success_based_routing_update_configs() {}
)]
pub async fn toggle_elimination_routing() {}
+#[cfg(feature = "v1")]
+/// Routing - Elimination
+///
+/// Create a elimination based dynamic routing algorithm
+#[utoipa::path(
+ post,
+ path = "/account/{account_id}/business_profile/{profile_id}/dynamic_routing/elimination/create",
+ request_body = EliminationRoutingConfig,
+ params(
+ ("account_id" = String, Path, description = "Merchant id"),
+ ("profile_id" = String, Path, description = "Profile id under which Dynamic routing needs to be created"),
+ ("enable" = DynamicRoutingFeatures, Query, description = "Feature to enable for elimination based routing"),
+ ),
+ responses(
+ (status = 200, description = "Routing Algorithm created", body = RoutingDictionaryRecord),
+ (status = 400, description = "Request body is malformed"),
+ (status = 500, description = "Internal server error"),
+ (status = 404, description = "Resource missing"),
+ (status = 422, description = "Unprocessable request"),
+ (status = 403, description = "Forbidden"),
+ ),
+ tag = "Routing",
+ operation_id = "Create elimination routing algorithm",
+ security(("api_key" = []), ("jwt_key" = []))
+)]
+pub async fn create_elimination_routing() {}
+
#[cfg(feature = "v1")]
/// Routing - Toggle Contract routing for profile
///