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

fix(openapi): Standardise API naming scheme for V2 (#6510)

Anurag Thakur96393ff3d6b1
diff --git a/api-reference-v2/api-reference/api-key/api-key--create.mdx b/api-reference-v2/api-reference/api-key/api-key--create.mdx
index a92a8ea77f..abc1dcda10 100644
--- a/api-reference-v2/api-reference/api-key/api-key--create.mdx
+++ b/api-reference-v2/api-reference/api-key/api-key--create.mdx
@@ -1,3 +1,3 @@
---
-openapi: post /v2/api_keys
+openapi: post /v2/api-keys
---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/api-key/api-key--list.mdx b/api-reference-v2/api-reference/api-key/api-key--list.mdx
index 5975e9bd6c..fb84b35fbc 100644
--- a/api-reference-v2/api-reference/api-key/api-key--list.mdx
+++ b/api-reference-v2/api-reference/api-key/api-key--list.mdx
@@ -1,3 +1,3 @@
---
-openapi: get /v2/api_keys/list
+openapi: get /v2/api-keys/list
---
diff --git a/api-reference-v2/api-reference/api-key/api-key--retrieve.mdx b/api-reference-v2/api-reference/api-key/api-key--retrieve.mdx
index ee7970122d..7286436335 100644
--- a/api-reference-v2/api-reference/api-key/api-key--retrieve.mdx
+++ b/api-reference-v2/api-reference/api-key/api-key--retrieve.mdx
@@ -1,3 +1,3 @@
---
-openapi: get /v2/api_keys/{id}
+openapi: get /v2/api-keys/{id}
---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/api-key/api-key--revoke.mdx b/api-reference-v2/api-reference/api-key/api-key--revoke.mdx
index 9362743088..b7ffd42e44 100644
--- a/api-reference-v2/api-reference/api-key/api-key--revoke.mdx
+++ b/api-reference-v2/api-reference/api-key/api-key--revoke.mdx
@@ -1,3 +1,3 @@
---
-openapi: delete /v2/api_keys/{id}
+openapi: delete /v2/api-keys/{id}
---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/api-key/api-key--update.mdx b/api-reference-v2/api-reference/api-key/api-key--update.mdx
index c682cf1ee9..2434e4981f 100644
--- a/api-reference-v2/api-reference/api-key/api-key--update.mdx
+++ b/api-reference-v2/api-reference/api-key/api-key--update.mdx
@@ -1,3 +1,3 @@
---
-openapi: put /v2/api_keys/{id}
+openapi: put /v2/api-keys/{id}
---
diff --git a/api-reference-v2/api-reference/business-profile/merchant-connector--list.mdx b/api-reference-v2/api-reference/business-profile/merchant-connector--list.mdx
index 6560f45e5f..93c5a980c2 100644
--- a/api-reference-v2/api-reference/business-profile/merchant-connector--list.mdx
+++ b/api-reference-v2/api-reference/business-profile/merchant-connector--list.mdx
@@ -1,3 +1,3 @@
---
-openapi: get /v2/profiles/{profile_id}/connector_accounts
+openapi: get /v2/profiles/{profile_id}/connector-accounts
---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/connector-account/connector-account--create.mdx b/api-reference-v2/api-reference/connector-account/connector-account--create.mdx
index d8cac2bab3..d672d6fa34 100644
--- a/api-reference-v2/api-reference/connector-account/connector-account--create.mdx
+++ b/api-reference-v2/api-reference/connector-account/connector-account--create.mdx
@@ -1,3 +1,3 @@
---
-openapi: post /v2/connector_accounts
+openapi: post /v2/connector-accounts
---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/connector-account/connector-account--delete.mdx b/api-reference-v2/api-reference/connector-account/connector-account--delete.mdx
index 5c959648ff..15fdd66441 100644
--- a/api-reference-v2/api-reference/connector-account/connector-account--delete.mdx
+++ b/api-reference-v2/api-reference/connector-account/connector-account--delete.mdx
@@ -1,3 +1,3 @@
---
-openapi: delete /v2/connector_accounts/{id}
+openapi: delete /v2/connector-accounts/{id}
---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/connector-account/connector-account--retrieve.mdx b/api-reference-v2/api-reference/connector-account/connector-account--retrieve.mdx
index 918de03127..dbd26b9b10 100644
--- a/api-reference-v2/api-reference/connector-account/connector-account--retrieve.mdx
+++ b/api-reference-v2/api-reference/connector-account/connector-account--retrieve.mdx
@@ -1,3 +1,3 @@
---
-openapi: get /v2/connector_accounts/{id}
+openapi: get /v2/connector-accounts/{id}
---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/connector-account/connector-account--update.mdx b/api-reference-v2/api-reference/connector-account/connector-account--update.mdx
index 6ccd052fb9..fe864d538f 100644
--- a/api-reference-v2/api-reference/connector-account/connector-account--update.mdx
+++ b/api-reference-v2/api-reference/connector-account/connector-account--update.mdx
@@ -1,3 +1,3 @@
---
-openapi: put /v2/connector_accounts/{id}
+openapi: put /v2/connector-accounts/{id}
---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/merchant-account/business-profile--list.mdx b/api-reference-v2/api-reference/merchant-account/business-profile--list.mdx
index 97deb0832c..069bd602dd 100644
--- a/api-reference-v2/api-reference/merchant-account/business-profile--list.mdx
+++ b/api-reference-v2/api-reference/merchant-account/business-profile--list.mdx
@@ -1,3 +1,3 @@
---
-openapi: get /v2/merchant_accounts/{id}/profiles
+openapi: get /v2/merchant-accounts/{id}/profiles
---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/merchant-account/merchant-account--create.mdx b/api-reference-v2/api-reference/merchant-account/merchant-account--create.mdx
index d870b811aa..38aed603f6 100644
--- a/api-reference-v2/api-reference/merchant-account/merchant-account--create.mdx
+++ b/api-reference-v2/api-reference/merchant-account/merchant-account--create.mdx
@@ -1,3 +1,3 @@
---
-openapi: post /v2/merchant_accounts
+openapi: post /v2/merchant-accounts
---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/merchant-account/merchant-account--retrieve.mdx b/api-reference-v2/api-reference/merchant-account/merchant-account--retrieve.mdx
index d082565234..3b744fb140 100644
--- a/api-reference-v2/api-reference/merchant-account/merchant-account--retrieve.mdx
+++ b/api-reference-v2/api-reference/merchant-account/merchant-account--retrieve.mdx
@@ -1,3 +1,3 @@
---
-openapi: get /v2/merchant_accounts/{id}
+openapi: get /v2/merchant-accounts/{id}
---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/merchant-account/merchant-account--update.mdx b/api-reference-v2/api-reference/merchant-account/merchant-account--update.mdx
index 51f80ceea3..eb2e92d065 100644
--- a/api-reference-v2/api-reference/merchant-account/merchant-account--update.mdx
+++ b/api-reference-v2/api-reference/merchant-account/merchant-account--update.mdx
@@ -1,3 +1,3 @@
---
-openapi: put /v2/merchant_accounts/{id}
+openapi: put /v2/merchant-accounts/{id}
---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/merchant-account/profile--list.mdx b/api-reference-v2/api-reference/merchant-account/profile--list.mdx
deleted file mode 100644
index e14bc0d6ef..0000000000
--- a/api-reference-v2/api-reference/merchant-account/profile--list.mdx
+++ /dev/null
@@ -1,3 +0,0 @@
----
-openapi: get /v2/merchant_accounts/{account_id}/profiles
----
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/organization/organization--merchant-account--list.mdx b/api-reference-v2/api-reference/organization/organization--merchant-account--list.mdx
index 58d467dc57..9a03e8713d 100644
--- a/api-reference-v2/api-reference/organization/organization--merchant-account--list.mdx
+++ b/api-reference-v2/api-reference/organization/organization--merchant-account--list.mdx
@@ -1,3 +1,3 @@
---
-openapi: get /v2/organization/{id}/merchant_accounts
+openapi: get /v2/organization/{id}/merchant-accounts
---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/payment-methods/list-customer-saved-payment-methods-for-a-payment.mdx b/api-reference-v2/api-reference/payment-methods/list-customer-saved-payment-methods-for-a-payment.mdx
new file mode 100644
index 0000000000..7809830b82
--- /dev/null
+++ b/api-reference-v2/api-reference/payment-methods/list-customer-saved-payment-methods-for-a-payment.mdx
@@ -0,0 +1,3 @@
+---
+openapi: get /v2/payments/{id}/saved-payment-methods
+---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/payment-methods/list-payment-methods-for-a-customer.mdx b/api-reference-v2/api-reference/payment-methods/list-payment-methods-for-a-customer.mdx
new file mode 100644
index 0000000000..ef5a27f960
--- /dev/null
+++ b/api-reference-v2/api-reference/payment-methods/list-payment-methods-for-a-customer.mdx
@@ -0,0 +1,3 @@
+---
+openapi: get /v2/customers/{id}/saved-payment-methods
+---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/payment-methods/payment-method--confirm-intent.mdx b/api-reference-v2/api-reference/payment-methods/payment-method--confirm-intent.mdx
new file mode 100644
index 0000000000..134374a7b6
--- /dev/null
+++ b/api-reference-v2/api-reference/payment-methods/payment-method--confirm-intent.mdx
@@ -0,0 +1,3 @@
+---
+openapi: post /v2/payment-methods/{id}/confirm-intent
+---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/payment-methods/payment-method--create-intent.mdx b/api-reference-v2/api-reference/payment-methods/payment-method--create-intent.mdx
new file mode 100644
index 0000000000..42cf716f2a
--- /dev/null
+++ b/api-reference-v2/api-reference/payment-methods/payment-method--create-intent.mdx
@@ -0,0 +1,3 @@
+---
+openapi: post /v2/payment-methods/create-intent
+---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/payment-methods/payment-method--create.mdx b/api-reference-v2/api-reference/payment-methods/payment-method--create.mdx
new file mode 100644
index 0000000000..1dce5179a9
--- /dev/null
+++ b/api-reference-v2/api-reference/payment-methods/payment-method--create.mdx
@@ -0,0 +1,3 @@
+---
+openapi: post /v2/payment-methods
+---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/payment-methods/payment-method--delete.mdx b/api-reference-v2/api-reference/payment-methods/payment-method--delete.mdx
new file mode 100644
index 0000000000..210bf843f9
--- /dev/null
+++ b/api-reference-v2/api-reference/payment-methods/payment-method--delete.mdx
@@ -0,0 +1,3 @@
+---
+openapi: delete /v2/payment-methods/{id}
+---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/payment-methods/payment-method--retrieve.mdx b/api-reference-v2/api-reference/payment-methods/payment-method--retrieve.mdx
new file mode 100644
index 0000000000..957d9760b3
--- /dev/null
+++ b/api-reference-v2/api-reference/payment-methods/payment-method--retrieve.mdx
@@ -0,0 +1,3 @@
+---
+openapi: get /v2/payment-methods/{id}
+---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/payment-methods/payment-method--update.mdx b/api-reference-v2/api-reference/payment-methods/payment-method--update.mdx
new file mode 100644
index 0000000000..0adee195a6
--- /dev/null
+++ b/api-reference-v2/api-reference/payment-methods/payment-method--update.mdx
@@ -0,0 +1,3 @@
+---
+openapi: patch /v2/payment-methods/{id}/update-saved-payment-method
+---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/profile/merchant-connector--list.mdx b/api-reference-v2/api-reference/profile/merchant-connector--list.mdx
index 81f640436f..55218be7c0 100644
--- a/api-reference-v2/api-reference/profile/merchant-connector--list.mdx
+++ b/api-reference-v2/api-reference/profile/merchant-connector--list.mdx
@@ -1,3 +1,3 @@
---
-openapi: get /v2/profiles/{id}/connector_accounts
+openapi: get /v2/profiles/{id}/connector-accounts
---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/profile/profile--activate-routing-algorithm.mdx b/api-reference-v2/api-reference/profile/profile--activate-routing-algorithm.mdx
index 7225f422e5..ea9ee7596a 100644
--- a/api-reference-v2/api-reference/profile/profile--activate-routing-algorithm.mdx
+++ b/api-reference-v2/api-reference/profile/profile--activate-routing-algorithm.mdx
@@ -1,3 +1,3 @@
---
-openapi: patch /v2/profiles/{id}/activate_routing_algorithm
+openapi: patch /v2/profiles/{id}/activate-routing-algorithm
---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/profile/profile--deactivate-routing-algorithm.mdx b/api-reference-v2/api-reference/profile/profile--deactivate-routing-algorithm.mdx
index 87aac8b937..4d6b2d620c 100644
--- a/api-reference-v2/api-reference/profile/profile--deactivate-routing-algorithm.mdx
+++ b/api-reference-v2/api-reference/profile/profile--deactivate-routing-algorithm.mdx
@@ -1,3 +1,3 @@
---
-openapi: patch /v2/profiles/{id}/deactivate_routing_algorithm
+openapi: patch /v2/profiles/{id}/deactivate-routing-algorithm
---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/profile/profile--retrieve-active-routing-algorithm.mdx b/api-reference-v2/api-reference/profile/profile--retrieve-active-routing-algorithm.mdx
index 86d2d35d57..143837676c 100644
--- a/api-reference-v2/api-reference/profile/profile--retrieve-active-routing-algorithm.mdx
+++ b/api-reference-v2/api-reference/profile/profile--retrieve-active-routing-algorithm.mdx
@@ -1,3 +1,3 @@
---
-openapi: get /v2/profiles/{id}/routing_algorithm
+openapi: get /v2/profiles/{id}/routing-algorithm
---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/profile/profile--retrieve-default-fallback-routing-algorithm.mdx b/api-reference-v2/api-reference/profile/profile--retrieve-default-fallback-routing-algorithm.mdx
index 1bc383c278..ebaad7c53a 100644
--- a/api-reference-v2/api-reference/profile/profile--retrieve-default-fallback-routing-algorithm.mdx
+++ b/api-reference-v2/api-reference/profile/profile--retrieve-default-fallback-routing-algorithm.mdx
@@ -1,3 +1,3 @@
---
-openapi: get /v2/profiles/{id}/fallback_routing
+openapi: get /v2/profiles/{id}/fallback-routing
---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/profile/profile--update-default-fallback-routing-algorithm.mdx b/api-reference-v2/api-reference/profile/profile--update-default-fallback-routing-algorithm.mdx
index 76f4d4fa77..b5df6a57ef 100644
--- a/api-reference-v2/api-reference/profile/profile--update-default-fallback-routing-algorithm.mdx
+++ b/api-reference-v2/api-reference/profile/profile--update-default-fallback-routing-algorithm.mdx
@@ -1,3 +1,3 @@
---
-openapi: patch /v2/profiles/{id}/fallback_routing
+openapi: patch /v2/profiles/{id}/fallback-routing
---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/routing/routing--create.mdx b/api-reference-v2/api-reference/routing/routing--create.mdx
index 65ef15008f..438abd8e23 100644
--- a/api-reference-v2/api-reference/routing/routing--create.mdx
+++ b/api-reference-v2/api-reference/routing/routing--create.mdx
@@ -1,3 +1,3 @@
---
-openapi: post /v2/routing_algorithm
+openapi: post /v2/routing-algorithm
---
\ No newline at end of file
diff --git a/api-reference-v2/api-reference/routing/routing--retrieve.mdx b/api-reference-v2/api-reference/routing/routing--retrieve.mdx
index 776ff69e00..10db0200e1 100644
--- a/api-reference-v2/api-reference/routing/routing--retrieve.mdx
+++ b/api-reference-v2/api-reference/routing/routing--retrieve.mdx
@@ -1,3 +1,3 @@
---
-openapi: get /v2/routing_algorithm/{id}
+openapi: get /v2/routing-algorithm/{id}
---
\ No newline at end of file
diff --git a/api-reference-v2/mint.json b/api-reference-v2/mint.json
index c0723a63f3..aed8949244 100644
--- a/api-reference-v2/mint.json
+++ b/api-reference-v2/mint.json
@@ -23,7 +23,9 @@
"navigation": [
{
"group": "Get Started",
- "pages": ["introduction"]
+ "pages": [
+ "introduction"
+ ]
},
{
"group": "Essentials",
@@ -43,6 +45,19 @@
"api-reference/payments/payments--get"
]
},
+ {
+ "group": "Payment Methods",
+ "pages": [
+ "api-reference/payment-methods/payment-method--create",
+ "api-reference/payment-methods/payment-method--retrieve",
+ "api-reference/payment-methods/payment-method--update",
+ "api-reference/payment-methods/payment-method--delete",
+ "api-reference/payment-methods/payment-method--create-intent",
+ "api-reference/payment-methods/payment-method--confirm-intent",
+ "api-reference/payment-methods/list-customer-saved-payment-methods-for-a-payment",
+ "api-reference/payment-methods/list-payment-methods-for-a-customer"
+ ]
+ },
{
"group": "Organization",
"pages": [
@@ -119,8 +134,10 @@
"github": "https://github.com/juspay/hyperswitch",
"linkedin": "https://www.linkedin.com/company/hyperswitch"
},
- "openapi": ["openapi_spec.json"],
+ "openapi": [
+ "openapi_spec.json"
+ ],
"api": {
"maintainOrder": true
}
-}
+}
\ No newline at end of file
diff --git a/api-reference-v2/openapi_spec.json b/api-reference-v2/openapi_spec.json
index 15103188df..2b66d1755f 100644
--- a/api-reference-v2/openapi_spec.json
+++ b/api-reference-v2/openapi_spec.json
@@ -164,7 +164,7 @@
]
}
},
- "/v2/organization/{id}/merchant_accounts": {
+ "/v2/organization/{id}/merchant-accounts": {
"get": {
"tags": [
"Organization"
@@ -208,7 +208,7 @@
]
}
},
- "/v2/connector_accounts": {
+ "/v2/connector-accounts": {
"post": {
"tags": [
"Merchant Connector Account"
@@ -285,7 +285,7 @@
]
}
},
- "/v2/connector_accounts/{id}": {
+ "/v2/connector-accounts/{id}": {
"get": {
"tags": [
"Merchant Connector Account"
@@ -445,7 +445,7 @@
]
}
},
- "/v2/merchant_accounts": {
+ "/v2/merchant-accounts": {
"post": {
"tags": [
"Merchant Account"
@@ -524,7 +524,7 @@
]
}
},
- "/v2/merchant_accounts/{id}": {
+ "/v2/merchant-accounts/{id}": {
"get": {
"tags": [
"Merchant Account"
@@ -630,7 +630,7 @@
]
}
},
- "/v2/merchant_accounts/{id}/profiles": {
+ "/v2/merchant-accounts/{id}/profiles": {
"get": {
"tags": [
"Merchant Account"
@@ -907,7 +907,7 @@
]
}
},
- "/v2/profiles/{id}/connector_accounts": {
+ "/v2/profiles/{id}/connector-accounts": {
"get": {
"tags": [
"Business Profile"
@@ -966,7 +966,7 @@
]
}
},
- "/v2/profiles/{id}/activate_routing_algorithm": {
+ "/v2/profiles/{id}/activate-routing-algorithm": {
"patch": {
"tags": [
"Profile"
@@ -1033,7 +1033,7 @@
]
}
},
- "/v2/profiles/{id}/deactivate_routing_algorithm": {
+ "/v2/profiles/{id}/deactivate-routing-algorithm": {
"patch": {
"tags": [
"Profile"
@@ -1086,7 +1086,7 @@
]
}
},
- "/v2/profiles/{id}/fallback_routing": {
+ "/v2/profiles/{id}/fallback-routing": {
"patch": {
"tags": [
"Profile"
@@ -1197,13 +1197,13 @@
]
}
},
- "/v2/profiles/{id}/routing_algorithm": {
+ "/v2/profiles/{id}/routing-algorithm": {
"get": {
"tags": [
"Profile"
],
"summary": "Profile - Retrieve Active Routing Algorithm",
- "description": "Retrieve active routing algorithm under the profile",
+ "description": "_\nRetrieve active routing algorithm under the profile",
"operationId": "Retrieve the active routing algorithm under the profile",
"parameters": [
{
@@ -1271,7 +1271,7 @@
]
}
},
- "/v2/routing_algorithm": {
+ "/v2/routing-algorithm": {
"post": {
"tags": [
"Routing"
@@ -1326,7 +1326,7 @@
]
}
},
- "/v2/routing_algorithm/{id}": {
+ "/v2/routing-algorithm/{id}": {
"get": {
"tags": [
"Routing"
@@ -1376,7 +1376,7 @@
]
}
},
- "/v2/api_keys": {
+ "/v2/api-keys": {
"post": {
"tags": [
"API Key"
@@ -1416,7 +1416,7 @@
]
}
},
- "/v2/api_keys/{id}": {
+ "/v2/api-keys/{id}": {
"get": {
"tags": [
"API Key"
@@ -1545,7 +1545,7 @@
]
}
},
- "/v2/api_keys/list": {
+ "/v2/api-keys/list": {
"get": {
"tags": [
"API Key"
@@ -2017,6 +2017,332 @@
]
}
},
+ "/v2/payments/{id}/saved-payment-methods": {
+ "get": {
+ "tags": [
+ "Payment Methods"
+ ],
+ "summary": "List customer saved payment methods for a payment",
+ "description": "To filter and list the applicable payment methods for a particular Customer ID, is to be associated with a payment",
+ "operationId": "List all Payment Methods for a Customer",
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/PaymentMethodListRequest"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "description": "Payment Methods retrieved for customer tied to its respective client-secret passed in the param",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CustomerPaymentMethodsListResponse"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Invalid Data"
+ },
+ "404": {
+ "description": "Payment Methods does not exist in records"
+ }
+ },
+ "security": [
+ {
+ "publishable_key": []
+ }
+ ]
+ }
+ },
+ "/v2/customers/{id}/saved-payment-methods": {
+ "get": {
+ "tags": [
+ "Payment Methods"
+ ],
+ "summary": "List saved payment methods for a Customer",
+ "description": "To filter and list the applicable payment methods for a particular Customer ID, to be used in a non-payments context",
+ "operationId": "List all Payment Methods for a Customer",
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/PaymentMethodListRequest"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "description": "Payment Methods retrieved",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CustomerPaymentMethodsListResponse"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Invalid Data"
+ },
+ "404": {
+ "description": "Payment Methods does not exist in records"
+ }
+ },
+ "security": [
+ {
+ "api_key": []
+ }
+ ]
+ }
+ },
+ "/v2/payment-methods": {
+ "post": {
+ "tags": [
+ "Payment Methods"
+ ],
+ "summary": "Payment Method - Create",
+ "description": "Creates and stores a payment method against a customer. In case of cards, this API should be used only by PCI compliant merchants.",
+ "operationId": "Create Payment Method",
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/PaymentMethodCreate"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "description": "Payment Method Created",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/PaymentMethodResponse"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Invalid Data"
+ }
+ },
+ "security": [
+ {
+ "api_key": []
+ }
+ ]
+ }
+ },
+ "/v2/payment-methods/create-intent": {
+ "post": {
+ "tags": [
+ "Payment Methods"
+ ],
+ "summary": "Payment Method - Create Intent",
+ "description": "Creates a payment method for customer with billing information and other metadata.",
+ "operationId": "Create Payment Method Intent",
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/PaymentMethodIntentCreate"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "description": "Payment Method Intent Created",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/PaymentMethodResponse"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Invalid Data"
+ }
+ },
+ "security": [
+ {
+ "api_key": []
+ }
+ ]
+ }
+ },
+ "/v2/payment-methods/{id}/confirm-intent": {
+ "post": {
+ "tags": [
+ "Payment Methods"
+ ],
+ "summary": "Payment Method - Confirm Intent",
+ "description": "Update a payment method with customer's payment method related information.",
+ "operationId": "Confirm Payment Method Intent",
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/PaymentMethodIntentConfirm"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "description": "Payment Method Intent Confirmed",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/PaymentMethodResponse"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Invalid Data"
+ }
+ },
+ "security": [
+ {
+ "api_key": []
+ }
+ ]
+ }
+ },
+ "/v2/payment-methods/{id}/update-saved-payment-method": {
+ "patch": {
+ "tags": [
+ "Payment Methods"
+ ],
+ "summary": "Payment Method - Update",
+ "description": "Update an existing payment method of a customer.",
+ "operationId": "Update Payment Method",
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/PaymentMethodUpdate"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "description": "Payment Method Update",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/PaymentMethodResponse"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Invalid Data"
+ }
+ },
+ "security": [
+ {
+ "api_key": []
+ }
+ ]
+ }
+ },
+ "/v2/payment-methods/{id}": {
+ "get": {
+ "tags": [
+ "Payment Methods"
+ ],
+ "summary": "Payment Method - Retrieve",
+ "description": "Retrieves a payment method of a customer.",
+ "operationId": "Retrieve Payment Method",
+ "parameters": [
+ {
+ "name": "id",
+ "in": "path",
+ "description": "The unique identifier for the Payment Method",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Payment Method Retrieved",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/PaymentMethodResponse"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Payment Method Not Found"
+ }
+ },
+ "security": [
+ {
+ "api_key": []
+ }
+ ]
+ },
+ "delete": {
+ "tags": [
+ "Payment Methods"
+ ],
+ "summary": "Payment Method - Delete",
+ "description": "Deletes a payment method of a customer.",
+ "operationId": "Delete Payment Method",
+ "parameters": [
+ {
+ "name": "id",
+ "in": "path",
+ "description": "The unique identifier for the Payment Method",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Payment Method Retrieved",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/PaymentMethodDeleteResponse"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Payment Method Not Found"
+ }
+ },
+ "security": [
+ {
+ "api_key": []
+ }
+ ]
+ }
+ },
"/v2/refunds": {
"post": {
"tags": [
@@ -11255,14 +11581,17 @@
],
"properties": {
"organization_name": {
- "type": "string"
+ "type": "string",
+ "description": "Name of the organization"
},
"organization_details": {
"type": "object",
+ "description": "Details about the organization",
"nullable": true
},
"metadata": {
"type": "object",
+ "description": "Metadata is useful for storing additional, unstructured information on an object.",
"nullable": true
}
},
@@ -11271,27 +11600,31 @@
"OrganizationResponse": {
"type": "object",
"required": [
- "organization_id",
+ "id",
"modified_at",
"created_at"
],
"properties": {
- "organization_id": {
+ "id": {
"type": "string",
+ "description": "The unique identifier for the Organization",
"example": "org_q98uSGAYbjEwqs0mJwnz",
"maxLength": 64,
"minLength": 1
},
"organization_name": {
"type": "string",
+ "description": "Name of the Organization",
"nullable": true
},
"organization_details": {
"type": "object",
+ "description": "Details about the organization",
"nullable": true
},
"metadata": {
"type": "object",
+ "description": "Metadata is useful for storing additional, unstructured information on an object.",
"nullable": true
},
"modified_at": {
@@ -11309,14 +11642,17 @@
"properties": {
"organization_name": {
"type": "string",
+ "description": "Name of the organization",
"nullable": true
},
"organization_details": {
"type": "object",
+ "description": "Details about the organization",
"nullable": true
},
"metadata": {
"type": "object",
+ "description": "Metadata is useful for storing additional, unstructured information on an object.",
"nullable": true
}
},
@@ -12918,6 +13254,68 @@
}
}
},
+ "PaymentMethodIntentConfirm": {
+ "type": "object",
+ "required": [
+ "client_secret",
+ "payment_method_data",
+ "payment_method_type",
+ "payment_method_subtype"
+ ],
+ "properties": {
+ "client_secret": {
+ "type": "string",
+ "description": "For SDK based calls, client_secret would be required"
+ },
+ "customer_id": {
+ "type": "string",
+ "description": "The unique identifier of the customer.",
+ "example": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
+ "nullable": true,
+ "maxLength": 64,
+ "minLength": 1
+ },
+ "payment_method_data": {
+ "$ref": "#/components/schemas/PaymentMethodCreateData"
+ },
+ "payment_method_type": {
+ "$ref": "#/components/schemas/PaymentMethod"
+ },
+ "payment_method_subtype": {
+ "$ref": "#/components/schemas/PaymentMethodType"
+ }
+ },
+ "additionalProperties": false
+ },
+ "PaymentMethodIntentCreate": {
+ "type": "object",
+ "required": [
+ "customer_id"
+ ],
+ "properties": {
+ "metadata": {
+ "type": "object",
+ "description": "You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.",
+ "nullable": true
+ },
+ "billing": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Address"
+ }
+ ],
+ "nullable": true
+ },
+ "customer_id": {
+ "type": "string",
+ "description": "The unique identifier of the customer.",
+ "example": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
+ "maxLength": 64,
+ "minLength": 1
+ }
+ },
+ "additionalProperties": false
+ },
"PaymentMethodIssuerCode": {
"type": "string",
"enum": [
@@ -12959,6 +13357,78 @@
}
]
},
+ "PaymentMethodListRequest": {
+ "type": "object",
+ "properties": {
+ "client_secret": {
+ "type": "string",
+ "description": "This is a 15 minute expiry token which shall be used from the client to authenticate and perform sessions from the SDK",
+ "example": "secret_k2uj3he2893eiu2d",
+ "nullable": true,
+ "maxLength": 30,
+ "minLength": 30
+ },
+ "accepted_countries": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/CountryAlpha2"
+ },
+ "description": "The two-letter ISO currency code",
+ "example": [
+ "US",
+ "UK",
+ "IN"
+ ],
+ "nullable": true
+ },
+ "amount": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/MinorUnit"
+ }
+ ],
+ "nullable": true
+ },
+ "accepted_currencies": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Currency"
+ },
+ "description": "The three-letter ISO currency code",
+ "example": [
+ "USD",
+ "EUR"
+ ],
+ "nullable": true
+ },
+ "recurring_enabled": {
+ "type": "boolean",
+ "description": "Indicates whether the payment method is eligible for recurring payments",
+ "example": true,
+ "nullable": true
+ },
+ "card_networks": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/CardNetwork"
+ },
+ "description": "Indicates whether the payment method is eligible for card netwotks",
+ "example": [
+ "visa",
+ "mastercard"
+ ],
+ "nullable": true
+ },
+ "limit": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Indicates the limit of last used payment methods",
+ "example": 1,
+ "nullable": true
+ }
+ },
+ "additionalProperties": false
+ },
"PaymentMethodListResponse": {
"type": "object",
"required": [
diff --git a/api-reference/openapi_spec.json b/api-reference/openapi_spec.json
index ecce327d7f..d2133a3e68 100644
--- a/api-reference/openapi_spec.json
+++ b/api-reference/openapi_spec.json
@@ -14432,14 +14432,17 @@
],
"properties": {
"organization_name": {
- "type": "string"
+ "type": "string",
+ "description": "Name of the organization"
},
"organization_details": {
"type": "object",
+ "description": "Details about the organization",
"nullable": true
},
"metadata": {
"type": "object",
+ "description": "Metadata is useful for storing additional, unstructured information on an object.",
"nullable": true
}
},
@@ -14455,20 +14458,24 @@
"properties": {
"organization_id": {
"type": "string",
+ "description": "The unique identifier for the Organization",
"example": "org_q98uSGAYbjEwqs0mJwnz",
"maxLength": 64,
"minLength": 1
},
"organization_name": {
"type": "string",
+ "description": "Name of the Organization",
"nullable": true
},
"organization_details": {
"type": "object",
+ "description": "Details about the organization",
"nullable": true
},
"metadata": {
"type": "object",
+ "description": "Metadata is useful for storing additional, unstructured information on an object.",
"nullable": true
},
"modified_at": {
@@ -14486,14 +14493,17 @@
"properties": {
"organization_name": {
"type": "string",
+ "description": "Name of the organization",
"nullable": true
},
"organization_details": {
"type": "object",
+ "description": "Details about the organization",
"nullable": true
},
"metadata": {
"type": "object",
+ "description": "Metadata is useful for storing additional, unstructured information on an object.",
"nullable": true
}
},
diff --git a/crates/api_models/src/organization.rs b/crates/api_models/src/organization.rs
index f95a159511..c6bc3924d1 100644
--- a/crates/api_models/src/organization.rs
+++ b/crates/api_models/src/organization.rs
@@ -22,9 +22,14 @@ pub struct OrganizationId {
#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, ToSchema)]
#[serde(deny_unknown_fields)]
pub struct OrganizationCreateRequest {
+ /// Name of the organization
pub organization_name: String,
+
+ /// Details about the organization
#[schema(value_type = Option<Object>)]
pub organization_details: Option<pii::SecretSerdeValue>,
+
+ /// Metadata is useful for storing additional, unstructured information on an object.
#[schema(value_type = Option<Object>)]
pub metadata: Option<pii::SecretSerdeValue>,
}
@@ -32,20 +37,53 @@ pub struct OrganizationCreateRequest {
#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, ToSchema)]
#[serde(deny_unknown_fields)]
pub struct OrganizationUpdateRequest {
+ /// Name of the organization
pub organization_name: Option<String>,
+
+ /// Details about the organization
#[schema(value_type = Option<Object>)]
pub organization_details: Option<pii::SecretSerdeValue>,
+
+ /// Metadata is useful for storing additional, unstructured information on an object.
#[schema(value_type = Option<Object>)]
pub metadata: Option<pii::SecretSerdeValue>,
}
-
+#[cfg(feature = "v1")]
#[derive(Debug, serde::Serialize, Clone, ToSchema)]
pub struct OrganizationResponse {
+ /// The unique identifier for the Organization
#[schema(value_type = String, max_length = 64, min_length = 1, example = "org_q98uSGAYbjEwqs0mJwnz")]
pub organization_id: id_type::OrganizationId,
+
+ /// Name of the Organization
pub organization_name: Option<String>,
+
+ /// Details about the organization
#[schema(value_type = Option<Object>)]
pub organization_details: Option<pii::SecretSerdeValue>,
+
+ /// Metadata is useful for storing additional, unstructured information on an object.
+ #[schema(value_type = Option<Object>)]
+ pub metadata: Option<pii::SecretSerdeValue>,
+ pub modified_at: time::PrimitiveDateTime,
+ pub created_at: time::PrimitiveDateTime,
+}
+
+#[cfg(feature = "v2")]
+#[derive(Debug, serde::Serialize, Clone, ToSchema)]
+pub struct OrganizationResponse {
+ /// The unique identifier for the Organization
+ #[schema(value_type = String, max_length = 64, min_length = 1, example = "org_q98uSGAYbjEwqs0mJwnz")]
+ pub id: id_type::OrganizationId,
+
+ /// Name of the Organization
+ pub organization_name: Option<String>,
+
+ /// Details about the organization
+ #[schema(value_type = Option<Object>)]
+ pub organization_details: Option<pii::SecretSerdeValue>,
+
+ /// Metadata is useful for storing additional, unstructured information on an object.
#[schema(value_type = Option<Object>)]
pub metadata: Option<pii::SecretSerdeValue>,
pub modified_at: time::PrimitiveDateTime,
diff --git a/crates/api_models/src/payment_methods.rs b/crates/api_models/src/payment_methods.rs
index 0bb5e65213..2c2aa4861c 100644
--- a/crates/api_models/src/payment_methods.rs
+++ b/crates/api_models/src/payment_methods.rs
@@ -778,7 +778,7 @@ pub struct PaymentMethodResponse {
#[derive(Debug, serde::Deserialize, serde::Serialize, ToSchema, Clone)]
pub struct PaymentMethodResponse {
/// Unique identifier for a merchant
- #[schema(example = "merchant_1671528864", value_type = String)]
+ #[schema(value_type = String, example = "merchant_1671528864")]
pub merchant_id: id_type::MerchantId,
/// The unique identifier of the customer.
diff --git a/crates/hyperswitch_domain_models/src/payments.rs b/crates/hyperswitch_domain_models/src/payments.rs
index b7a6c12500..006d78e2f7 100644
--- a/crates/hyperswitch_domain_models/src/payments.rs
+++ b/crates/hyperswitch_domain_models/src/payments.rs
@@ -125,7 +125,7 @@ impl PaymentIntent {
publishable_key: String,
) -> CustomResult<url::Url, errors::api_error_response::ApiErrorResponse> {
let start_redirection_url = &format!(
- "{}/v2/payments/{}/start_redirection?publishable_key={}&profile_id={}",
+ "{}/v2/payments/{}/start-redirection?publishable_key={}&profile_id={}",
base_url,
self.get_id().get_string_repr(),
publishable_key,
@@ -144,7 +144,7 @@ impl PaymentIntent {
publishable_key: &str,
) -> CustomResult<url::Url, errors::api_error_response::ApiErrorResponse> {
let finish_redirection_url = format!(
- "{base_url}/v2/payments/{}/finish_redirection/{publishable_key}/{}",
+ "{base_url}/v2/payments/{}/finish-redirection/{publishable_key}/{}",
self.id.get_string_repr(),
self.profile_id.get_string_repr()
);
diff --git a/crates/openapi/src/openapi_v2.rs b/crates/openapi/src/openapi_v2.rs
index 4198e90882..a756d9fb1b 100644
--- a/crates/openapi/src/openapi_v2.rs
+++ b/crates/openapi/src/openapi_v2.rs
@@ -127,6 +127,17 @@ Never share your secret api keys. Keep them guarded and secure.
routes::payments::payments_confirm_intent,
routes::payments::payment_status,
+ //Routes for payment methods
+ routes::payment_method::list_customer_payment_method_for_payment,
+ routes::payment_method::list_customer_payment_method_api,
+ routes::payment_method::create_payment_method_api,
+ routes::payment_method::create_payment_method_intent_api,
+ routes::payment_method::confirm_payment_method_intent_api,
+ routes::payment_method::payment_method_update_api,
+ routes::payment_method::payment_method_retrieve_api,
+ routes::payment_method::payment_method_delete_api,
+
+
//Routes for refunds
routes::refunds::refunds_create,
),
@@ -170,9 +181,12 @@ Never share your secret api keys. Keep them guarded and secure.
api_models::customers::CustomerRequest,
api_models::customers::CustomerDeleteResponse,
api_models::payment_methods::PaymentMethodCreate,
+ api_models::payment_methods::PaymentMethodIntentCreate,
+ api_models::payment_methods::PaymentMethodIntentConfirm,
api_models::payment_methods::PaymentMethodResponse,
api_models::payment_methods::PaymentMethodResponseData,
api_models::payment_methods::CustomerPaymentMethod,
+ api_models::payment_methods::PaymentMethodListRequest,
api_models::payment_methods::PaymentMethodListResponse,
api_models::payment_methods::ResponsePaymentMethodsEnabled,
api_models::payment_methods::ResponsePaymentMethodTypes,
@@ -189,6 +203,7 @@ Never share your secret api keys. Keep them guarded and secure.
api_models::payment_methods::PaymentMethodCreateData,
api_models::payment_methods::CardDetail,
api_models::payment_methods::CardDetailUpdate,
+ api_models::payment_methods::CardType,
api_models::payment_methods::RequestPaymentMethodTypes,
api_models::payment_methods::CardType,
api_models::payment_methods::PaymentMethodListData,
diff --git a/crates/openapi/src/routes/api_keys.rs b/crates/openapi/src/routes/api_keys.rs
index cfc4c09ce4..964fa60fcf 100644
--- a/crates/openapi/src/routes/api_keys.rs
+++ b/crates/openapi/src/routes/api_keys.rs
@@ -25,7 +25,7 @@ pub async fn api_key_create() {}
/// displayed only once on creation, so ensure you store it securely.
#[utoipa::path(
post,
- path = "/v2/api_keys",
+ path = "/v2/api-keys",
request_body= CreateApiKeyRequest,
responses(
(status = 200, description = "API Key created", body = CreateApiKeyResponse),
@@ -64,7 +64,7 @@ pub async fn api_key_retrieve() {}
/// Retrieve information about the specified API Key.
#[utoipa::path(
get,
- path = "/v2/api_keys/{id}",
+ path = "/v2/api-keys/{id}",
params (
("id" = String, Path, description = "The unique identifier for the API Key")
),
@@ -106,7 +106,7 @@ pub async fn api_key_update() {}
/// Update information for the specified API Key.
#[utoipa::path(
put,
- path = "/v2/api_keys/{id}",
+ path = "/v2/api-keys/{id}",
request_body = UpdateApiKeyRequest,
params (
("id" = String, Path, description = "The unique identifier for the API Key")
@@ -150,7 +150,7 @@ pub async fn api_key_revoke() {}
/// authenticating with our APIs.
#[utoipa::path(
delete,
- path = "/v2/api_keys/{id}",
+ path = "/v2/api-keys/{id}",
params (
("id" = String, Path, description = "The unique identifier for the API Key")
),
@@ -191,7 +191,7 @@ pub async fn api_key_list() {}
/// List all the API Keys associated to a merchant account.
#[utoipa::path(
get,
- path = "/v2/api_keys/list",
+ path = "/v2/api-keys/list",
params(
("limit" = Option<i64>, Query, description = "The maximum number of API Keys to include in the response"),
("skip" = Option<i64>, Query, description = "The number of API Keys to skip when retrieving the list of API keys."),
diff --git a/crates/openapi/src/routes/merchant_account.rs b/crates/openapi/src/routes/merchant_account.rs
index 022a5e6c00..a3bf96ab89 100644
--- a/crates/openapi/src/routes/merchant_account.rs
+++ b/crates/openapi/src/routes/merchant_account.rs
@@ -50,7 +50,7 @@ pub async fn merchant_account_create() {}
/// Before creating the merchant account, it is mandatory to create an organization.
#[utoipa::path(
post,
- path = "/v2/merchant_accounts",
+ path = "/v2/merchant-accounts",
params(
(
"X-Organization-Id" = String, Header,
@@ -128,7 +128,7 @@ pub async fn retrieve_merchant_account() {}
/// Retrieve a *merchant* account details.
#[utoipa::path(
get,
- path = "/v2/merchant_accounts/{id}",
+ path = "/v2/merchant-accounts/{id}",
params (("id" = String, Path, description = "The unique identifier for the merchant account")),
responses(
(status = 200, description = "Merchant Account Retrieved", body = MerchantAccountResponse),
@@ -190,7 +190,7 @@ pub async fn update_merchant_account() {}
/// Updates details of an existing merchant account. Helpful in updating merchant details such as email, contact details, or other configuration details like webhook, routing algorithm etc
#[utoipa::path(
put,
- path = "/v2/merchant_accounts/{id}",
+ path = "/v2/merchant-accounts/{id}",
request_body (
content = MerchantAccountUpdate,
examples(
@@ -300,7 +300,7 @@ pub async fn payment_connector_list_profile() {}
/// List profiles for an Merchant
#[utoipa::path(
get,
- path = "/v2/merchant_accounts/{id}/profiles",
+ path = "/v2/merchant-accounts/{id}/profiles",
params (("id" = String, Path, description = "The unique identifier for the Merchant")),
responses(
(status = 200, description = "profile list retrieved successfully", body = Vec<ProfileResponse>),
diff --git a/crates/openapi/src/routes/merchant_connector_account.rs b/crates/openapi/src/routes/merchant_connector_account.rs
index 29092b5bba..372f8688a2 100644
--- a/crates/openapi/src/routes/merchant_connector_account.rs
+++ b/crates/openapi/src/routes/merchant_connector_account.rs
@@ -67,7 +67,7 @@ pub async fn connector_create() {}
#[cfg(feature = "v2")]
#[utoipa::path(
post,
- path = "/v2/connector_accounts",
+ path = "/v2/connector-accounts",
request_body(
content = MerchantConnectorCreate,
examples(
@@ -152,7 +152,7 @@ pub async fn connector_retrieve() {}
#[cfg(feature = "v2")]
#[utoipa::path(
get,
- path = "/v2/connector_accounts/{id}",
+ path = "/v2/connector-accounts/{id}",
params(
("id" = i32, Path, description = "The unique identifier for the Merchant Connector")
),
@@ -241,7 +241,7 @@ pub async fn connector_update() {}
#[cfg(feature = "v2")]
#[utoipa::path(
put,
- path = "/v2/connector_accounts/{id}",
+ path = "/v2/connector-accounts/{id}",
request_body(
content = MerchantConnectorUpdate,
examples(
@@ -310,7 +310,7 @@ pub async fn connector_delete() {}
#[cfg(feature = "v2")]
#[utoipa::path(
delete,
- path = "/v2/connector_accounts/{id}",
+ path = "/v2/connector-accounts/{id}",
params(
("id" = i32, Path, description = "The unique identifier for the Merchant Connector")
),
diff --git a/crates/openapi/src/routes/organization.rs b/crates/openapi/src/routes/organization.rs
index ce3199343c..d677131d5d 100644
--- a/crates/openapi/src/routes/organization.rs
+++ b/crates/openapi/src/routes/organization.rs
@@ -150,7 +150,7 @@ pub async fn organization_update() {}
/// List merchant accounts for an Organization
#[utoipa::path(
get,
- path = "/v2/organization/{id}/merchant_accounts",
+ path = "/v2/organization/{id}/merchant-accounts",
params (("id" = String, Path, description = "The unique identifier for the Organization")),
responses(
(status = 200, description = "Merchant Account list retrieved successfully", body = Vec<MerchantAccountResponse>),
diff --git a/crates/openapi/src/routes/payment_method.rs b/crates/openapi/src/routes/payment_method.rs
index 3bc593aa5b..b38a234267 100644
--- a/crates/openapi/src/routes/payment_method.rs
+++ b/crates/openapi/src/routes/payment_method.rs
@@ -31,6 +31,7 @@
operation_id = "Create a Payment Method",
security(("api_key" = []))
)]
+#[cfg(feature = "v1")]
pub async fn create_payment_method_api() {}
/// List payment methods for a Merchant
@@ -84,6 +85,7 @@ pub async fn list_payment_method_api() {}
operation_id = "List all Payment Methods for a Customer",
security(("api_key" = []))
)]
+#[cfg(feature = "v1")]
pub async fn list_customer_payment_method_api() {}
/// List customer saved payment methods for a Payment
@@ -130,6 +132,7 @@ pub async fn list_customer_payment_method_api_client() {}
operation_id = "Retrieve a Payment method",
security(("api_key" = []))
)]
+#[cfg(feature = "v1")]
pub async fn payment_method_retrieve_api() {}
/// Payment Method - Update
@@ -151,6 +154,7 @@ pub async fn payment_method_retrieve_api() {}
operation_id = "Update a Payment method",
security(("api_key" = []), ("publishable_key" = []))
)]
+#[cfg(feature = "v1")]
pub async fn payment_method_update_api() {}
/// Payment Method - Delete
@@ -170,6 +174,7 @@ pub async fn payment_method_update_api() {}
operation_id = "Delete a Payment method",
security(("api_key" = []))
)]
+#[cfg(feature = "v1")]
pub async fn payment_method_delete_api() {}
/// Payment Method - Set Default Payment Method for Customer
@@ -192,3 +197,171 @@ pub async fn payment_method_delete_api() {}
security(("ephemeral_key" = []))
)]
pub async fn default_payment_method_set_api() {}
+
+/// Payment Method - Create Intent
+///
+/// Creates a payment method for customer with billing information and other metadata.
+#[utoipa::path(
+ post,
+ path = "/v2/payment-methods/create-intent",
+ request_body(
+ content = PaymentMethodIntentCreate,
+ // TODO: Add examples
+ ),
+ responses(
+ (status = 200, description = "Payment Method Intent Created", body = PaymentMethodResponse),
+ (status = 400, description = "Invalid Data"),
+ ),
+ tag = "Payment Methods",
+ operation_id = "Create Payment Method Intent",
+ security(("api_key" = []))
+)]
+#[cfg(feature = "v2")]
+pub async fn create_payment_method_intent_api() {}
+
+/// Payment Method - Confirm Intent
+///
+/// Update a payment method with customer's payment method related information.
+#[utoipa::path(
+ post,
+ path = "/v2/payment-methods/{id}/confirm-intent",
+ request_body(
+ content = PaymentMethodIntentConfirm,
+ // TODO: Add examples
+ ),
+ responses(
+ (status = 200, description = "Payment Method Intent Confirmed", body = PaymentMethodResponse),
+ (status = 400, description = "Invalid Data"),
+ ),
+ tag = "Payment Methods",
+ operation_id = "Confirm Payment Method Intent",
+ security(("api_key" = []))
+)]
+#[cfg(feature = "v2")]
+pub async fn confirm_payment_method_intent_api() {}
+
+/// Payment Method - Create
+///
+/// Creates and stores a payment method against a customer. In case of cards, this API should be used only by PCI compliant merchants.
+#[utoipa::path(
+ post,
+ path = "/v2/payment-methods",
+ request_body(
+ content = PaymentMethodCreate,
+ // TODO: Add examples
+ ),
+ responses(
+ (status = 200, description = "Payment Method Created", body = PaymentMethodResponse),
+ (status = 400, description = "Invalid Data"),
+ ),
+ tag = "Payment Methods",
+ operation_id = "Create Payment Method",
+ security(("api_key" = []))
+)]
+#[cfg(feature = "v2")]
+pub async fn create_payment_method_api() {}
+
+/// Payment Method - Retrieve
+///
+/// Retrieves a payment method of a customer.
+#[utoipa::path(
+ get,
+ path = "/v2/payment-methods/{id}",
+ params (
+ ("id" = String, Path, description = "The unique identifier for the Payment Method"),
+ ),
+ responses(
+ (status = 200, description = "Payment Method Retrieved", body = PaymentMethodResponse),
+ (status = 404, description = "Payment Method Not Found"),
+ ),
+ tag = "Payment Methods",
+ operation_id = "Retrieve Payment Method",
+ security(("api_key" = []))
+)]
+#[cfg(feature = "v2")]
+pub async fn payment_method_retrieve_api() {}
+
+/// Payment Method - Update
+///
+/// Update an existing payment method of a customer.
+#[utoipa::path(
+ patch,
+ path = "/v2/payment-methods/{id}/update-saved-payment-method",
+ request_body(
+ content = PaymentMethodUpdate,
+ // TODO: Add examples
+ ),
+ responses(
+ (status = 200, description = "Payment Method Update", body = PaymentMethodResponse),
+ (status = 400, description = "Invalid Data"),
+ ),
+ tag = "Payment Methods",
+ operation_id = "Update Payment Method",
+ security(("api_key" = []))
+)]
+#[cfg(feature = "v2")]
+pub async fn payment_method_update_api() {}
+
+/// Payment Method - Delete
+///
+/// Deletes a payment method of a customer.
+#[utoipa::path(
+ delete,
+ path = "/v2/payment-methods/{id}",
+ params (
+ ("id" = String, Path, description = "The unique identifier for the Payment Method"),
+ ),
+ responses(
+ (status = 200, description = "Payment Method Retrieved", body = PaymentMethodDeleteResponse),
+ (status = 404, description = "Payment Method Not Found"),
+ ),
+ tag = "Payment Methods",
+ operation_id = "Delete Payment Method",
+ security(("api_key" = []))
+)]
+#[cfg(feature = "v2")]
+pub async fn payment_method_delete_api() {}
+
+/// List customer saved payment methods for a payment
+///
+/// To filter and list the applicable payment methods for a particular Customer ID, is to be associated with a payment
+#[utoipa::path(
+ get,
+ path = "/v2/payments/{id}/saved-payment-methods",
+ request_body(
+ content = PaymentMethodListRequest,
+ // TODO: Add examples and add param for customer_id
+ ),
+ responses(
+ (status = 200, description = "Payment Methods retrieved for customer tied to its respective client-secret passed in the param", body = CustomerPaymentMethodsListResponse),
+ (status = 400, description = "Invalid Data"),
+ (status = 404, description = "Payment Methods does not exist in records")
+ ),
+ tag = "Payment Methods",
+ operation_id = "List all Payment Methods for a Customer",
+ security(("publishable_key" = []))
+)]
+#[cfg(feature = "v2")]
+pub async fn list_customer_payment_method_for_payment() {}
+
+/// List saved payment methods for a Customer
+///
+/// To filter and list the applicable payment methods for a particular Customer ID, to be used in a non-payments context
+#[utoipa::path(
+ get,
+ path = "/v2/customers/{id}/saved-payment-methods",
+ request_body(
+ content = PaymentMethodListRequest,
+ // TODO: Add examples and add param for customer_id
+ ),
+ responses(
+ (status = 200, description = "Payment Methods retrieved", body = CustomerPaymentMethodsListResponse),
+ (status = 400, description = "Invalid Data"),
+ (status = 404, description = "Payment Methods does not exist in records")
+ ),
+ tag = "Payment Methods",
+ operation_id = "List all Payment Methods for a Customer",
+ security(("api_key" = []))
+)]
+#[cfg(feature = "v2")]
+pub async fn list_customer_payment_method_api() {}
diff --git a/crates/openapi/src/routes/profile.rs b/crates/openapi/src/routes/profile.rs
index d88568653a..cc484aa3f9 100644
--- a/crates/openapi/src/routes/profile.rs
+++ b/crates/openapi/src/routes/profile.rs
@@ -210,7 +210,7 @@ pub async fn profile_update() {}
/// Activates a routing algorithm under a profile
#[utoipa::path(
patch,
- path = "/v2/profiles/{id}/activate_routing_algorithm",
+ path = "/v2/profiles/{id}/activate-routing-algorithm",
request_body ( content = RoutingAlgorithmId,
examples( (
"Activate a routing algorithm" = (
@@ -240,7 +240,7 @@ pub async fn routing_link_config() {}
/// Deactivates a routing algorithm under a profile
#[utoipa::path(
patch,
- path = "/v2/profiles/{id}/deactivate_routing_algorithm",
+ path = "/v2/profiles/{id}/deactivate-routing-algorithm",
params(
("id" = String, Path, description = "The unique identifier for the profile"),
),
@@ -263,7 +263,7 @@ pub async fn routing_unlink_config() {}
/// Update the default fallback routing algorithm for the profile
#[utoipa::path(
patch,
- path = "/v2/profiles/{id}/fallback_routing",
+ path = "/v2/profiles/{id}/fallback-routing",
request_body = Vec<RoutableConnectorChoice>,
params(
("id" = String, Path, description = "The unique identifier for the profile"),
@@ -307,11 +307,11 @@ pub async fn profile_retrieve() {}
#[cfg(feature = "v2")]
/// Profile - Retrieve Active Routing Algorithm
-///
+///_
/// Retrieve active routing algorithm under the profile
#[utoipa::path(
get,
- path = "/v2/profiles/{id}/routing_algorithm",
+ path = "/v2/profiles/{id}/routing-algorithm",
params(
("id" = String, Path, description = "The unique identifier for the profile"),
("limit" = Option<u16>, Query, description = "The number of records of the algorithms to be returned"),
@@ -334,7 +334,7 @@ pub async fn routing_retrieve_linked_config() {}
/// Retrieve the default fallback routing algorithm for the profile
#[utoipa::path(
get,
- path = "/v2/profiles/{id}/fallback_routing",
+ path = "/v2/profiles/{id}/fallback-routing",
params(
("id" = String, Path, description = "The unique identifier for the profile"),
),
@@ -353,7 +353,7 @@ pub async fn routing_retrieve_default_config() {}
/// List Connector Accounts for the profile
#[utoipa::path(
get,
- path = "/v2/profiles/{id}/connector_accounts",
+ path = "/v2/profiles/{id}/connector-accounts",
params(
("id" = String, Path, description = "The unique identifier for the business profile"),
(
diff --git a/crates/openapi/src/routes/routing.rs b/crates/openapi/src/routes/routing.rs
index 67a22c2ca6..b144fd046a 100644
--- a/crates/openapi/src/routes/routing.rs
+++ b/crates/openapi/src/routes/routing.rs
@@ -26,7 +26,7 @@ pub async fn routing_create_config() {}
/// Create a routing algorithm
#[utoipa::path(
post,
- path = "/v2/routing_algorithm",
+ path = "/v2/routing-algorithm",
request_body = RoutingConfigRequest,
responses(
(status = 200, description = "Routing Algorithm created", body = RoutingDictionaryRecord),
@@ -94,7 +94,7 @@ pub async fn routing_retrieve_config() {}
#[utoipa::path(
get,
- path = "/v2/routing_algorithm/{id}",
+ path = "/v2/routing-algorithm/{id}",
params(
("id" = String, Path, description = "The unique identifier for a routing algorithm"),
),
diff --git a/crates/router/src/routes/app.rs b/crates/router/src/routes/app.rs
index 0f13e08d53..bb0c547d7f 100644
--- a/crates/router/src/routes/app.rs
+++ b/crates/router/src/routes/app.rs
@@ -556,11 +556,15 @@ impl Payments {
)
.service(web::resource("").route(web::get().to(payments::payment_status)))
.service(
- web::resource("/start_redirection")
+ web::resource("/start-redirection")
.route(web::get().to(payments::payments_start_redirection)),
)
.service(
- web::resource("/finish_redirection/{publishable_key}/{profile_id}")
+ web::resource("/saved-payment-methods")
+ .route(web::get().to(list_customer_payment_method_for_payment)),
+ )
+ .service(
+ web::resource("/finish-redirection/{publishable_key}/{profile_id}")
.route(web::get().to(payments::payments_finish_redirection)),
),
);
@@ -715,7 +719,7 @@ pub struct Routing;
#[cfg(all(feature = "olap", feature = "v2"))]
impl Routing {
pub fn server(state: AppState) -> Scope {
- web::scope("/v2/routing_algorithm")
+ web::scope("/v2/routing-algorithm")
.app_data(web::Data::new(state.clone()))
.service(
web::resource("").route(web::post().to(|state, req, payload| {
@@ -968,7 +972,7 @@ impl Customers {
#[cfg(all(feature = "oltp", feature = "v2", feature = "payment_methods_v2"))]
{
route = route.service(
- web::resource("/{customer_id}/saved_payment_methods")
+ web::resource("/{customer_id}/saved-payment-methods")
.route(web::get().to(list_customer_payment_method_api)),
);
}
@@ -1113,7 +1117,7 @@ impl Payouts {
#[cfg(all(feature = "oltp", feature = "v2", feature = "payment_methods_v2",))]
impl PaymentMethods {
pub fn server(state: AppState) -> Scope {
- let mut route = web::scope("/v2/payment_methods").app_data(web::Data::new(state));
+ let mut route = web::scope("/v2/payment-methods").app_data(web::Data::new(state));
route = route
.service(web::resource("").route(web::post().to(create_payment_method_api)))
.service(
@@ -1125,7 +1129,7 @@ impl PaymentMethods {
.route(web::post().to(confirm_payment_method_intent_api)),
)
.service(
- web::resource("/{id}/update_saved_payment_method")
+ web::resource("/{id}/update-saved-payment-method")
.route(web::patch().to(payment_method_update_api)),
)
.service(web::resource("/{id}").route(web::get().to(payment_method_retrieve_api)))
@@ -1267,7 +1271,7 @@ impl Organization {
.route(web::put().to(admin::organization_update)),
)
.service(
- web::resource("/merchant_accounts")
+ web::resource("/merchant-accounts")
.route(web::get().to(admin::merchant_account_list)),
),
)
@@ -1279,7 +1283,7 @@ pub struct MerchantAccount;
#[cfg(all(feature = "v2", feature = "olap"))]
impl MerchantAccount {
pub fn server(state: AppState) -> Scope {
- web::scope("/v2/merchant_accounts")
+ web::scope("/v2/merchant-accounts")
.app_data(web::Data::new(state))
.service(web::resource("").route(web::post().to(admin::merchant_account_create)))
.service(
@@ -1329,7 +1333,7 @@ pub struct MerchantConnectorAccount;
#[cfg(all(any(feature = "olap", feature = "oltp"), feature = "v2"))]
impl MerchantConnectorAccount {
pub fn server(state: AppState) -> Scope {
- let mut route = web::scope("/v2/connector_accounts").app_data(web::Data::new(state));
+ let mut route = web::scope("/v2/connector-accounts").app_data(web::Data::new(state));
#[cfg(feature = "olap")]
{
@@ -1526,7 +1530,7 @@ pub struct ApiKeys;
#[cfg(all(feature = "olap", feature = "v2"))]
impl ApiKeys {
pub fn server(state: AppState) -> Scope {
- web::scope("/v2/api_keys")
+ web::scope("/v2/api-keys")
.app_data(web::Data::new(state))
.service(web::resource("").route(web::post().to(api_keys::api_key_create)))
.service(web::resource("/list").route(web::get().to(api_keys::api_key_list)))
@@ -1691,16 +1695,16 @@ impl Profile {
.route(web::put().to(profiles::profile_update)),
)
.service(
- web::resource("/connector_accounts")
+ web::resource("/connector-accounts")
.route(web::get().to(admin::connector_list)),
)
.service(
- web::resource("/fallback_routing")
+ web::resource("/fallback-routing")
.route(web::get().to(routing::routing_retrieve_default_config))
.route(web::patch().to(routing::routing_update_default_config)),
)
.service(
- web::resource("/activate_routing_algorithm").route(web::patch().to(
+ web::resource("/activate-routing-algorithm").route(web::patch().to(
|state, req, path, payload| {
routing::routing_link_config(
state,
@@ -1713,7 +1717,7 @@ impl Profile {
)),
)
.service(
- web::resource("/deactivate_routing_algorithm").route(web::patch().to(
+ web::resource("/deactivate-routing-algorithm").route(web::patch().to(
|state, req, path| {
routing::routing_unlink_config(
state,
@@ -1724,7 +1728,7 @@ impl Profile {
},
)),
)
- .service(web::resource("/routing_algorithm").route(web::get().to(
+ .service(web::resource("/routing-algorithm").route(web::get().to(
|state, req, query_params, path| {
routing::routing_retrieve_linked_config(
state,
@@ -1999,7 +2003,7 @@ impl User {
)
.service(web::resource("/verify_email").route(web::post().to(user::verify_email)))
.service(
- web::resource("/v2/verify_email").route(web::post().to(user::verify_email)),
+ web::resource("/v2/verify-email").route(web::post().to(user::verify_email)),
)
.service(
web::resource("/verify_email_request")
@@ -2053,7 +2057,7 @@ impl User {
.route(web::post().to(user_role::accept_invitations_v2)),
)
.service(
- web::resource("/pre_auth").route(
+ web::resource("/pre-auth").route(
web::post().to(user_role::accept_invitations_pre_auth),
),
),
diff --git a/crates/router/src/routes/payment_methods.rs b/crates/router/src/routes/payment_methods.rs
index 7296a51024..8ee31ecf94 100644
--- a/crates/router/src/routes/payment_methods.rs
+++ b/crates/router/src/routes/payment_methods.rs
@@ -508,30 +508,6 @@ pub async fn list_customer_payment_method_api(
}
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
-/// List payment methods for a Customer v2
-///
-/// To filter and list the applicable payment methods for a particular Customer ID, is to be associated with a payment
-#[utoipa::path(
- get,
- path = "v2/payments/{payment_id}/saved_payment_methods",
- params (
- ("client-secret" = String, Path, description = "A secret known only to your application and the authorization server"),
- ("accepted_country" = Vec<String>, Query, description = "The two-letter ISO currency code"),
- ("accepted_currency" = Vec<Currency>, Path, description = "The three-letter ISO currency code"),
- ("minimum_amount" = i64, Query, description = "The minimum amount accepted for processing by the particular payment method."),
- ("maximum_amount" = i64, Query, description = "The maximum amount amount accepted for processing by the particular payment method."),
- ("recurring_payment_enabled" = bool, Query, description = "Indicates whether the payment method is eligible for recurring payments"),
- ("installment_payment_enabled" = bool, Query, description = "Indicates whether the payment method is eligible for installment payments"),
- ),
- responses(
- (status = 200, description = "Payment Methods retrieved for customer tied to its respective client-secret passed in the param", body = CustomerPaymentMethodsListResponse),
- (status = 400, description = "Invalid Data"),
- (status = 404, description = "Payment Methods does not exist in records")
- ),
- tag = "Payment Methods",
- operation_id = "List all Payment Methods for a Customer",
- security(("publishable_key" = []))
-)]
#[instrument(skip_all, fields(flow = ?Flow::CustomerPaymentMethodsList))]
pub async fn list_customer_payment_method_for_payment(
state: web::Data<AppState>,
@@ -575,29 +551,6 @@ pub async fn list_customer_payment_method_for_payment(
feature = "payment_methods_v2",
feature = "customer_v2"
))]
-/// List payment methods for a Customer v2
-///
-/// To filter and list the applicable payment methods for a particular Customer ID, to be used in a non-payments context
-#[utoipa::path(
- get,
- path = "v2/customers/{customer_id}/saved_payment_methods",
- params (
- ("accepted_country" = Vec<String>, Query, description = "The two-letter ISO currency code"),
- ("accepted_currency" = Vec<Currency>, Path, description = "The three-letter ISO currency code"),
- ("minimum_amount" = i64, Query, description = "The minimum amount accepted for processing by the particular payment method."),
- ("maximum_amount" = i64, Query, description = "The maximum amount amount accepted for processing by the particular payment method."),
- ("recurring_payment_enabled" = bool, Query, description = "Indicates whether the payment method is eligible for recurring payments"),
- ("installment_payment_enabled" = bool, Query, description = "Indicates whether the payment method is eligible for installment payments"),
- ),
- responses(
- (status = 200, description = "Payment Methods retrieved", body = CustomerPaymentMethodsListResponse),
- (status = 400, description = "Invalid Data"),
- (status = 404, description = "Payment Methods does not exist in records")
- ),
- tag = "Payment Methods",
- operation_id = "List all Payment Methods for a Customer",
- security(("api_key" = []))
-)]
#[instrument(skip_all, fields(flow = ?Flow::CustomerPaymentMethodsList))]
pub async fn list_customer_payment_method_api(
state: web::Data<AppState>,
diff --git a/crates/router/src/types/api/admin.rs b/crates/router/src/types/api/admin.rs
index c81fc7ceb4..85275a768d 100644
--- a/crates/router/src/types/api/admin.rs
+++ b/crates/router/src/types/api/admin.rs
@@ -34,6 +34,10 @@ use crate::{
impl ForeignFrom<diesel_models::organization::Organization> for OrganizationResponse {
fn foreign_from(org: diesel_models::organization::Organization) -> Self {
Self {
+ #[cfg(feature = "v2")]
+ id: org.get_organization_id(),
+
+ #[cfg(feature = "v1")]
organization_id: org.get_organization_id(),
organization_name: org.get_organization_name(),
organization_details: org.organization_details,
diff --git a/cypress-tests-v2/cypress/support/commands.js b/cypress-tests-v2/cypress/support/commands.js
index eb4ca3423e..b6955c542a 100644
--- a/cypress-tests-v2/cypress/support/commands.js
+++ b/cypress-tests-v2/cypress/support/commands.js
@@ -64,10 +64,10 @@ Cypress.Commands.add(
if (response.status === 200) {
expect(response.body)
- .to.have.property("organization_id")
+ .to.have.property("id")
.and.to.include("org_")
.and.to.be.a("string").and.not.be.empty;
- globalState.set("organizationId", response.body.organization_id);
+ globalState.set("organizationId", response.body.id);
cy.task("setGlobalState", globalState.data);
expect(response.body).to.have.property("metadata").and.to.equal(null);
} else {
@@ -99,7 +99,7 @@ Cypress.Commands.add("organizationRetrieveCall", (globalState) => {
if (response.status === 200) {
expect(response.body)
- .to.have.property("organization_id")
+ .to.have.property("id")
.and.to.include("org_")
.and.to.be.a("string").and.not.be.empty;
expect(response.body.organization_name)
@@ -107,7 +107,7 @@ Cypress.Commands.add("organizationRetrieveCall", (globalState) => {
.and.to.be.a("string").and.not.be.empty;
if (organization_id === undefined || organization_id === null) {
- globalState.set("organizationId", response.body.organization_id);
+ globalState.set("organizationId", response.body.id);
cy.task("setGlobalState", globalState.data);
}
} else {
@@ -144,14 +144,14 @@ Cypress.Commands.add(
if (response.status === 200) {
expect(response.body)
- .to.have.property("organization_id")
+ .to.have.property("id")
.and.to.include("org_")
.and.to.be.a("string").and.not.be.empty;
expect(response.body).to.have.property("metadata").and.to.be.a("object")
.and.not.be.empty;
if (organization_id === undefined || organization_id === null) {
- globalState.set("organizationId", response.body.organization_id);
+ globalState.set("organizationId", response.body.id);
cy.task("setGlobalState", globalState.data);
}
} else {
@@ -174,7 +174,7 @@ Cypress.Commands.add(
const key_id_type = "publishable_key";
const key_id = validateEnv(base_url, key_id_type);
const organization_id = globalState.get("organizationId");
- const url = `${base_url}/v2/merchant_accounts`;
+ const url = `${base_url}/v2/merchant-accounts`;
const merchant_name = merchantAccountCreateBody.merchant_name
.replaceAll(" ", "")
@@ -223,7 +223,7 @@ Cypress.Commands.add("merchantAccountRetrieveCall", (globalState) => {
const key_id_type = "publishable_key";
const key_id = validateEnv(base_url, key_id_type);
const merchant_id = globalState.get("merchantId");
- const url = `${base_url}/v2/merchant_accounts/${merchant_id}`;
+ const url = `${base_url}/v2/merchant-accounts/${merchant_id}`;
cy.request({
method: "GET",
@@ -265,7 +265,7 @@ Cypress.Commands.add(
const key_id_type = "publishable_key";
const key_id = validateEnv(base_url, key_id_type);
const merchant_id = globalState.get("merchantId");
- const url = `${base_url}/v2/merchant_accounts/${merchant_id}`;
+ const url = `${base_url}/v2/merchant-accounts/${merchant_id}`;
const merchant_name = merchantAccountUpdateBody.merchant_name;
@@ -456,7 +456,7 @@ Cypress.Commands.add(
const base_url = globalState.get("baseUrl");
const merchant_id = globalState.get("merchantId");
const profile_id = globalState.get("profileId");
- const url = `${base_url}/v2/connector_accounts`;
+ const url = `${base_url}/v2/connector-accounts`;
const customHeaders = {
"x-merchant-id": merchant_id,
@@ -536,7 +536,7 @@ Cypress.Commands.add("mcaRetrieveCall", (globalState) => {
const connector_name = globalState.get("connectorId");
const merchant_connector_id = globalState.get("merchantConnectorId");
const merchant_id = globalState.get("merchantId");
- const url = `${base_url}/v2/connector_accounts/${merchant_connector_id}`;
+ const url = `${base_url}/v2/connector-accounts/${merchant_connector_id}`;
const customHeaders = {
"x-merchant-id": merchant_id,
@@ -590,7 +590,7 @@ Cypress.Commands.add(
const merchant_connector_id = globalState.get("merchantConnectorId");
const merchant_id = globalState.get("merchantId");
const profile_id = globalState.get("profileId");
- const url = `${base_url}/v2/connector_accounts/${merchant_connector_id}`;
+ const url = `${base_url}/v2/connector-accounts/${merchant_connector_id}`;
const customHeaders = {
"x-merchant-id": merchant_id,
@@ -653,7 +653,7 @@ Cypress.Commands.add("apiKeyCreateCall", (apiKeyCreateBody, globalState) => {
const key_id_type = "key_id";
const key_id = validateEnv(base_url, key_id_type);
const merchant_id = globalState.get("merchantId");
- const url = `${base_url}/v2/api_keys`;
+ const url = `${base_url}/v2/api-keys`;
const customHeaders = {
"x-merchant-id": merchant_id,
@@ -703,7 +703,7 @@ Cypress.Commands.add("apiKeyRetrieveCall", (globalState) => {
const key_id = validateEnv(base_url, key_id_type);
const merchant_id = globalState.get("merchantId");
const api_key_id = globalState.get("apiKeyId");
- const url = `${base_url}/v2/api_keys/${api_key_id}`;
+ const url = `${base_url}/v2/api-keys/${api_key_id}`;
const customHeaders = {
"x-merchant-id": merchant_id,
@@ -750,7 +750,7 @@ Cypress.Commands.add("apiKeyUpdateCall", (apiKeyUpdateBody, globalState) => {
const key_id_type = "key_id";
const key_id = validateEnv(base_url, key_id_type);
const merchant_id = globalState.get("merchantId");
- const url = `${base_url}/v2/api_keys/${api_key_id}`;
+ const url = `${base_url}/v2/api-keys/${api_key_id}`;
const customHeaders = {
"x-merchant-id": merchant_id,
@@ -801,7 +801,7 @@ Cypress.Commands.add(
const api_key = globalState.get("userInfoToken");
const base_url = globalState.get("baseUrl");
const profile_id = globalState.get("profileId");
- const url = `${base_url}/v2/routing_algorithm`;
+ const url = `${base_url}/v2/routing-algorithm`;
// Update request body
routingSetupBody.algorithm.data = payload.data;
@@ -847,7 +847,7 @@ Cypress.Commands.add(
const base_url = globalState.get("baseUrl");
const profile_id = globalState.get("profileId");
const routing_algorithm_id = globalState.get("routingAlgorithmId");
- const url = `${base_url}/v2/profiles/${profile_id}/activate_routing_algorithm`;
+ const url = `${base_url}/v2/profiles/${profile_id}/activate-routing-algorithm`;
// Update request body
routingActivationBody.routing_algorithm_id = routing_algorithm_id;
@@ -885,7 +885,7 @@ Cypress.Commands.add("routingActivationRetrieveCall", (globalState) => {
const profile_id = globalState.get("profileId");
const query_params = "limit=10";
const routing_algorithm_id = globalState.get("routingAlgorithmId");
- const url = `${base_url}/v2/profiles/${profile_id}/routing_algorithm?${query_params}`;
+ const url = `${base_url}/v2/profiles/${profile_id}/routing-algorithm?${query_params}`;
cy.request({
method: "GET",
@@ -922,7 +922,7 @@ Cypress.Commands.add("routingDeactivateCall", (globalState) => {
const base_url = globalState.get("baseUrl");
const profile_id = globalState.get("profileId");
const routing_algorithm_id = globalState.get("routingAlgorithmId");
- const url = `${base_url}/v2/profiles/${profile_id}/deactivate_routing_algorithm`;
+ const url = `${base_url}/v2/profiles/${profile_id}/deactivate-routing-algorithm`;
cy.request({
method: "PATCH",
@@ -957,7 +957,7 @@ Cypress.Commands.add("routingRetrieveCall", (globalState) => {
const base_url = globalState.get("baseUrl");
const profile_id = globalState.get("profileId");
const routing_algorithm_id = globalState.get("routingAlgorithmId");
- const url = `${base_url}/v2/routing_algorithm/${routing_algorithm_id}`;
+ const url = `${base_url}/v2/routing-algorithm/${routing_algorithm_id}`;
cy.request({
method: "GET",
@@ -996,7 +996,7 @@ Cypress.Commands.add(
const base_url = globalState.get("baseUrl");
const profile_id = globalState.get("profileId");
const routing_algorithm_id = globalState.get("routingAlgorithmId");
- const url = `${base_url}/v2/profiles/${profile_id}/fallback_routing`;
+ const url = `${base_url}/v2/profiles/${profile_id}/fallback-routing`;
// Update request body
routingDefaultFallbackBody = payload;
@@ -1029,7 +1029,7 @@ Cypress.Commands.add("routingFallbackRetrieveCall", (globalState) => {
const api_key = globalState.get("userInfoToken");
const base_url = globalState.get("baseUrl");
const profile_id = globalState.get("profileId");
- const url = `${base_url}/v2/profiles/${profile_id}/fallback_routing`;
+ const url = `${base_url}/v2/profiles/${profile_id}/fallback-routing`;
cy.request({
method: "GET",
@@ -1166,7 +1166,7 @@ Cypress.Commands.add("merchantAccountsListCall", (globalState) => {
const key_id_type = "publishable_key";
const key_id = validateEnv(base_url, key_id_type);
const organization_id = globalState.get("organizationId");
- const url = `${base_url}/v2/organization/${organization_id}/merchant_accounts`;
+ const url = `${base_url}/v2/organization/${organization_id}/merchant-accounts`;
cy.request({
method: "GET",
@@ -1204,7 +1204,7 @@ Cypress.Commands.add("businessProfilesListCall", (globalState) => {
const api_key = globalState.get("adminApiKey");
const base_url = globalState.get("baseUrl");
const merchant_id = globalState.get("merchantId");
- const url = `${base_url}/v2/merchant_accounts/${merchant_id}/profiles`;
+ const url = `${base_url}/v2/merchant-accounts/${merchant_id}/profiles`;
const customHeaders = {
"x-merchant-id": merchant_id,
@@ -1246,7 +1246,7 @@ Cypress.Commands.add("mcaListCall", (globalState, service_type) => {
const base_url = globalState.get("baseUrl");
const merchant_id = globalState.get("merchantId");
const profile_id = globalState.get("profileId");
- const url = `${base_url}/v2/profiles/${profile_id}/connector_accounts`;
+ const url = `${base_url}/v2/profiles/${profile_id}/connector-accounts`;
const customHeaders = {
"x-merchant-id": merchant_id,
@@ -1308,7 +1308,7 @@ Cypress.Commands.add("apiKeysListCall", (globalState) => {
const key_id_type = "key_id";
const key_id = validateEnv(base_url, key_id_type);
const merchant_id = globalState.get("merchantId");
- const url = `${base_url}/v2/api_keys/list`;
+ const url = `${base_url}/v2/api-keys/list`;
const customHeaders = {
"x-merchant-id": merchant_id,