Bug: feat(router): Unify Auth in single layer (V2)



In-efficiency in design

* Currently we have many types of auth and auth is evaluated in multiple places, with multiple ways.
* This indeed required multiple approaches and solution needs to be maintained
* More cognitive load
* We can’t authenticate a request in one infra component/layer

Unify Auth in single layer

* Make Authentication header like,
    * authorization: key=value, keyN=valueN
    * Examples:
        * authorization: api-key=<api-key>
        * authorization: publishable-key=<publishable-key>, client-secret=<client-secret>
        * authorization: publishable-key=<publishable-key>, ephemeral-key=<ephemeral-key>
        * authorization: jwt=<jwt-token>
* Lineage also should be added in headers, when we can’t inferable from authorization
    *  `profile_id` should be added in headers not in body
    * If `api-key` not passed or the passed `api-key` has different scope, then `merchant-id` also should be passed.


diff --git a/api-reference-v2/openapi_spec.json b/api-reference-v2/openapi_spec.json
index 041cae13ca6..0be5dd8ec2b 100644
--- a/api-reference-v2/openapi_spec.json
+++ b/api-reference-v2/openapi_spec.json
@@ -6705,6 +6705,42 @@
           }
         }
       },
+      "ClientSecretResponse": {
+        "type": "object",
+        "description": "client_secret for the resource_id mentioned",
+        "required": [
+          "id",
+          "resource_id",
+          "created_at",
+          "expires",
+          "secret"
+        ],
+        "properties": {
+          "id": {
+            "type": "string",
+            "description": "Client Secret id",
+            "maxLength": 32,
+            "minLength": 1
+          },
+          "resource_id": {
+            "$ref": "#/components/schemas/ResourceId"
+          },
+          "created_at": {
+            "type": "string",
+            "format": "date-time",
+            "description": "time at which this client secret was created"
+          },
+          "expires": {
+            "type": "string",
+            "format": "date-time",
+            "description": "time at which this client secret would expire"
+          },
+          "secret": {
+            "type": "string",
+            "description": "client secret"
+          }
+        }
+      },
       "Comparison": {
         "type": "object",
         "description": "Represents a single comparison condition.",
@@ -8413,39 +8449,6 @@
           }
         }
       },
-      "EphemeralKeyCreateResponse": {
-        "type": "object",
-        "description": "ephemeral_key for the customer_id mentioned",
-        "required": [
-          "customer_id",
-          "created_at",
-          "expires",
-          "secret"
-        ],
-        "properties": {
-          "customer_id": {
-            "type": "string",
-            "description": "customer_id to which this ephemeral key belongs to",
-            "example": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
-            "maxLength": 64,
-            "minLength": 1
-          },
-          "created_at": {
-            "type": "integer",
-            "format": "int64",
-            "description": "time at which this ephemeral key was created"
-          },
-          "expires": {
-            "type": "integer",
-            "format": "int64",
-            "description": "time at which this ephemeral key would expire"
-          },
-          "secret": {
-            "type": "string",
-            "description": "ephemeral key"
-          }
-        }
-      },
       "ErrorCategory": {
         "type": "string",
         "enum": [
@@ -12297,7 +12300,7 @@
                 ]
               },
               "object": {
-                "$ref": "#/components/schemas/PaymentsResponse"
+                "$ref": "#/components/schemas/PaymentsRetrieveResponse"
               }
             }
           },
@@ -13327,26 +13330,6 @@
         },
         "additionalProperties": false
       },
-      "PaymentListResponse": {
-        "type": "object",
-        "required": [
-          "size",
-          "data"
-        ],
-        "properties": {
-          "size": {
-            "type": "integer",
-            "description": "The number of payments included in the list",
-            "minimum": 0
-          },
-          "data": {
-            "type": "array",
-            "items": {
-              "$ref": "#/components/schemas/PaymentsResponse"
-            }
-          }
-        }
-      },
       "PaymentMethod": {
         "type": "string",
         "description": "Indicates the type of payment method. Eg: 'card', 'wallet', etc.",
@@ -14553,7 +14536,8 @@
         "required": [
           "id",
           "customer_id",
-          "expires_at"
+          "expires_at",
+          "client_secret"
         ],
         "properties": {
           "id": {
@@ -14594,6 +14578,10 @@
             "format": "date-time",
             "description": "The iso timestamp when the session will expire\nTrying to retrieve the session or any operations on the session after this time will result in an error",
             "example": "2023-01-18T11:04:09.922Z"
+          },
+          "client_secret": {
+            "type": "string",
+            "description": "Client Secret"
           }
         }
       },
@@ -15094,1278 +15082,294 @@
         },
         "additionalProperties": false
       },
-      "PaymentsCreateResponseOpenApi": {
+      "PaymentsDynamicTaxCalculationRequest": {
+        "type": "object",
+        "required": [
+          "shipping",
+          "client_secret",
+          "payment_method_type"
+        ],
+        "properties": {
+          "shipping": {
+            "$ref": "#/components/schemas/Address"
+          },
+          "client_secret": {
+            "type": "string",
+            "description": "Client Secret"
+          },
+          "payment_method_type": {
+            "$ref": "#/components/schemas/PaymentMethodType"
+          },
+          "session_id": {
+            "type": "string",
+            "description": "Session Id",
+            "nullable": true
+          }
+        }
+      },
+      "PaymentsDynamicTaxCalculationResponse": {
         "type": "object",
         "required": [
           "payment_id",
-          "merchant_id",
-          "status",
-          "amount",
           "net_amount",
-          "amount_capturable",
-          "currency",
-          "payment_method",
-          "attempt_count"
+          "display_amount"
         ],
         "properties": {
           "payment_id": {
             "type": "string",
-            "description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant.",
-            "example": "pay_mbabizu24mvu3mela5njyhpit4",
-            "maxLength": 30,
-            "minLength": 30
+            "description": "The identifier for the payment"
           },
-          "merchant_id": {
-            "type": "string",
-            "description": "This is an identifier for the merchant account. This is inferred from the API key\nprovided during the request",
-            "example": "merchant_1668273825",
-            "maxLength": 255
+          "net_amount": {
+            "$ref": "#/components/schemas/MinorUnit"
           },
-          "status": {
+          "order_tax_amount": {
             "allOf": [
               {
-                "$ref": "#/components/schemas/IntentStatus"
+                "$ref": "#/components/schemas/MinorUnit"
               }
             ],
-            "default": "requires_confirmation"
-          },
-          "amount": {
-            "type": "integer",
-            "format": "int64",
-            "description": "The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,",
-            "example": 6540
-          },
-          "net_amount": {
-            "type": "integer",
-            "format": "int64",
-            "description": "The payment net amount. net_amount = amount + surcharge_details.surcharge_amount + surcharge_details.tax_amount + shipping_cost + order_tax_amount,\nIf no surcharge_details, shipping_cost, order_tax_amount, net_amount = amount",
-            "example": 6540
-          },
-          "shipping_cost": {
-            "type": "integer",
-            "format": "int64",
-            "description": "The shipping cost for the payment.",
-            "example": 6540,
-            "nullable": true
-          },
-          "amount_capturable": {
-            "type": "integer",
-            "format": "int64",
-            "description": "The maximum amount that could be captured from the payment",
-            "example": 6540,
-            "minimum": 100
-          },
-          "amount_received": {
-            "type": "integer",
-            "format": "int64",
-            "description": "The amount which is already captured from the payment, this helps in the cases where merchants can't capture all capturable amount at once.",
-            "example": 6540,
             "nullable": true
           },
-          "connector": {
-            "type": "string",
-            "description": "The connector used for the payment",
-            "example": "stripe",
+          "shipping_cost": {
+            "allOf": [
+              {
+                "$ref": "#/components/schemas/MinorUnit"
+              }
+            ],
             "nullable": true
           },
+          "display_amount": {
+            "$ref": "#/components/schemas/DisplayAmountOnSdk"
+          }
+        }
+      },
+      "PaymentsExternalAuthenticationRequest": {
+        "type": "object",
+        "required": [
+          "client_secret",
+          "device_channel",
+          "threeds_method_comp_ind"
+        ],
+        "properties": {
           "client_secret": {
             "type": "string",
-            "description": "It's a token used for client side verification.",
-            "example": "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo",
-            "nullable": true
+            "description": "Client Secret"
           },
-          "created": {
-            "type": "string",
-            "format": "date-time",
-            "description": "Time when the payment was created",
-            "example": "2022-09-10T10:11:12Z",
+          "sdk_information": {
+            "allOf": [
+              {
+                "$ref": "#/components/schemas/SdkInformation"
+              }
+            ],
             "nullable": true
           },
-          "currency": {
-            "$ref": "#/components/schemas/Currency"
+          "device_channel": {
+            "$ref": "#/components/schemas/DeviceChannel"
           },
-          "customer_id": {
-            "type": "string",
-            "description": "The identifier for the customer object. If not provided the customer ID will be autogenerated.\nThis field will be deprecated soon. Please refer to `customer.id`",
-            "deprecated": true,
-            "example": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
-            "nullable": true,
-            "maxLength": 64,
-            "minLength": 1
+          "threeds_method_comp_ind": {
+            "$ref": "#/components/schemas/ThreeDsCompletionIndicator"
+          }
+        }
+      },
+      "PaymentsExternalAuthenticationResponse": {
+        "type": "object",
+        "required": [
+          "trans_status",
+          "three_ds_requestor_url"
+        ],
+        "properties": {
+          "trans_status": {
+            "$ref": "#/components/schemas/TransactionStatus"
           },
-          "description": {
+          "acs_url": {
             "type": "string",
-            "description": "A description of the payment",
-            "example": "It's my first payment request",
+            "description": "Access Server URL to be used for challenge submission",
             "nullable": true
           },
-          "refunds": {
-            "type": "array",
-            "items": {
-              "$ref": "#/components/schemas/RefundResponse"
-            },
-            "description": "List of refunds that happened on this intent, as same payment intent can have multiple refund requests depending on the nature of order",
+          "challenge_request": {
+            "type": "string",
+            "description": "Challenge request which should be sent to acs_url",
             "nullable": true
           },
-          "disputes": {
-            "type": "array",
-            "items": {
-              "$ref": "#/components/schemas/DisputeResponsePaymentsRetrieve"
-            },
-            "description": "List of disputes that happened on this intent",
+          "acs_reference_number": {
+            "type": "string",
+            "description": "Unique identifier assigned by the EMVCo(Europay, Mastercard and Visa)",
             "nullable": true
           },
-          "attempts": {
-            "type": "array",
-            "items": {
-              "$ref": "#/components/schemas/PaymentAttemptResponse"
-            },
-            "description": "List of attempts that happened on this intent",
+          "acs_trans_id": {
+            "type": "string",
+            "description": "Unique identifier assigned by the ACS to identify a single transaction",
             "nullable": true
           },
-          "captures": {
-            "type": "array",
-            "items": {
-              "$ref": "#/components/schemas/CaptureResponse"
-            },
-            "description": "List of captures done on latest attempt",
+          "three_dsserver_trans_id": {
+            "type": "string",
+            "description": "Unique identifier assigned by the 3DS Server to identify a single transaction",
             "nullable": true
           },
-          "mandate_id": {
+          "acs_signed_content": {
             "type": "string",
-            "description": "A unique identifier to link the payment to a mandate, can be used instead of payment_method_data, in case of setting up recurring payments",
-            "example": "mandate_iwer89rnjef349dni3",
-            "nullable": true,
-            "maxLength": 255
-          },
-          "mandate_data": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/MandateData"
-              }
-            ],
+            "description": "Contains the JWS object created by the ACS for the ARes(Authentication Response) message",
             "nullable": true
           },
-          "setup_future_usage": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/FutureUsage"
-              }
-            ],
-            "nullable": true
-          },
-          "off_session": {
-            "type": "boolean",
-            "description": "Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.",
-            "example": true,
-            "nullable": true
-          },
-          "capture_method": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/CaptureMethod"
-              }
-            ],
-            "nullable": true
-          },
-          "payment_method": {
-            "$ref": "#/components/schemas/PaymentMethod"
-          },
-          "payment_method_data": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/PaymentMethodDataResponseWithBilling"
-              }
-            ],
-            "nullable": true
-          },
-          "payment_token": {
-            "type": "string",
-            "description": "Provide a reference to a stored payment method",
-            "example": "187282ab-40ef-47a9-9206-5099ba31e432",
-            "nullable": true
-          },
-          "shipping": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/Address"
-              }
-            ],
-            "nullable": true
-          },
-          "billing": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/Address"
-              }
-            ],
-            "nullable": true
-          },
-          "order_details": {
-            "type": "array",
-            "items": {
-              "$ref": "#/components/schemas/OrderDetailsWithAmount"
-            },
-            "description": "Information about the product , quantity and amount for connectors. (e.g. Klarna)",
-            "example": "[{\n        \"product_name\": \"gillete creme\",\n        \"quantity\": 15,\n        \"amount\" : 900\n    }]",
-            "nullable": true
-          },
-          "email": {
-            "type": "string",
-            "description": "description: The customer's email address\nThis field will be deprecated soon. Please refer to `customer.email` object",
-            "deprecated": true,
-            "example": "johntest@test.com",
-            "nullable": true,
-            "maxLength": 255
-          },
-          "name": {
-            "type": "string",
-            "description": "description: The customer's name\nThis field will be deprecated soon. Please refer to `customer.name` object",
-            "deprecated": true,
-            "example": "John Test",
-            "nullable": true,
-            "maxLength": 255
-          },
-          "phone": {
-            "type": "string",
-            "description": "The customer's phone number\nThis field will be deprecated soon. Please refer to `customer.phone` object",
-            "deprecated": true,
-            "example": "9123456789",
-            "nullable": true,
-            "maxLength": 255
-          },
-          "return_url": {
-            "type": "string",
-            "description": "The URL to redirect after the completion of the operation",
-            "example": "https://hyperswitch.io",
-            "nullable": true
-          },
-          "authentication_type": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/AuthenticationType"
-              }
-            ],
-            "default": "three_ds",
-            "nullable": true
-          },
-          "statement_descriptor_name": {
-            "type": "string",
-            "description": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.",
-            "example": "Hyperswitch Router",
-            "nullable": true,
-            "maxLength": 255
-          },
-          "statement_descriptor_suffix": {
-            "type": "string",
-            "description": "Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 255 characters for the concatenated descriptor.",
-            "example": "Payment for shoes purchase",
-            "nullable": true,
-            "maxLength": 255
-          },
-          "next_action": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/NextActionData"
-              }
-            ],
-            "nullable": true
-          },
-          "cancellation_reason": {
-            "type": "string",
-            "description": "If the payment was cancelled the reason will be provided here",
-            "nullable": true
-          },
-          "error_code": {
-            "type": "string",
-            "description": "If there was an error while calling the connectors the code is received here",
-            "example": "E0001",
-            "nullable": true
-          },
-          "error_message": {
-            "type": "string",
-            "description": "If there was an error while calling the connector the error message is received here",
-            "example": "Failed while verifying the card",
-            "nullable": true
-          },
-          "payment_experience": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/PaymentExperience"
-              }
-            ],
-            "nullable": true
-          },
-          "payment_method_type": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/PaymentMethodType"
-              }
-            ],
-            "nullable": true
-          },
-          "connector_label": {
-            "type": "string",
-            "description": "The connector used for this payment along with the country and business details",
-            "example": "stripe_US_food",
-            "nullable": true
-          },
-          "business_country": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/CountryAlpha2"
-              }
-            ],
-            "nullable": true
-          },
-          "business_label": {
-            "type": "string",
-            "description": "The business label of merchant for this payment",
-            "nullable": true
-          },
-          "business_sub_label": {
-            "type": "string",
-            "description": "The business_sub_label for this payment",
-            "nullable": true
-          },
-          "allowed_payment_method_types": {
-            "type": "array",
-            "items": {
-              "$ref": "#/components/schemas/PaymentMethodType"
-            },
-            "description": "Allowed Payment Method Types for a given PaymentIntent",
-            "nullable": true
-          },
-          "ephemeral_key": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/EphemeralKeyCreateResponse"
-              }
-            ],
-            "nullable": true
-          },
-          "manual_retry_allowed": {
-            "type": "boolean",
-            "description": "If true the payment can be retried with same or different payment method which means the confirm call can be made again.",
-            "nullable": true
-          },
-          "connector_transaction_id": {
-            "type": "string",
-            "description": "A unique identifier for a payment provided by the connector",
-            "example": "993672945374576J",
-            "nullable": true
-          },
-          "frm_message": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/FrmMessage"
-              }
-            ],
-            "nullable": true
-          },
-          "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
-          },
-          "connector_metadata": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/ConnectorMetadata"
-              }
-            ],
-            "nullable": true
-          },
-          "feature_metadata": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/FeatureMetadata"
-              }
-            ],
-            "nullable": true
-          },
-          "reference_id": {
-            "type": "string",
-            "description": "reference(Identifier) to the payment at connector side",
-            "example": "993672945374576J",
-            "nullable": true
-          },
-          "payment_link": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/PaymentLinkResponse"
-              }
-            ],
-            "nullable": true
-          },
-          "profile_id": {
-            "type": "string",
-            "description": "The business profile that is associated with this payment",
-            "nullable": true
-          },
-          "surcharge_details": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/RequestSurchargeDetails"
-              }
-            ],
-            "nullable": true
-          },
-          "attempt_count": {
-            "type": "integer",
-            "format": "int32",
-            "description": "Total number of attempts associated with this payment"
-          },
-          "merchant_decision": {
-            "type": "string",
-            "description": "Denotes the action(approve or reject) taken by merchant in case of manual review. Manual review can occur when the transaction is marked as risky by the frm_processor, payment processor or when there is underpayment/over payment incase of crypto payment",
-            "nullable": true
-          },
-          "merchant_connector_id": {
-            "type": "string",
-            "description": "Identifier of the connector ( merchant connector account ) which was chosen to make the payment",
-            "nullable": true
-          },
-          "incremental_authorization_allowed": {
-            "type": "boolean",
-            "description": "If true, incremental authorization can be performed on this payment, in case the funds authorized initially fall short.",
-            "nullable": true
-          },
-          "authorization_count": {
-            "type": "integer",
-            "format": "int32",
-            "description": "Total number of authorizations happened in an incremental_authorization payment",
-            "nullable": true
-          },
-          "incremental_authorizations": {
-            "type": "array",
-            "items": {
-              "$ref": "#/components/schemas/IncrementalAuthorizationResponse"
-            },
-            "description": "List of incremental authorizations happened to the payment",
-            "nullable": true
-          },
-          "external_authentication_details": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/ExternalAuthenticationDetailsResponse"
-              }
-            ],
-            "nullable": true
-          },
-          "external_3ds_authentication_attempted": {
-            "type": "boolean",
-            "description": "Flag indicating if external 3ds authentication is made or not",
-            "nullable": true
-          },
-          "expires_on": {
-            "type": "string",
-            "format": "date-time",
-            "description": "Date Time for expiry of the payment",
-            "example": "2022-09-10T10:11:12Z",
-            "nullable": true
-          },
-          "fingerprint": {
-            "type": "string",
-            "description": "Payment Fingerprint, to identify a particular card.\nIt is a 20 character long alphanumeric code.",
-            "nullable": true
-          },
-          "browser_info": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/BrowserInformation"
-              }
-            ],
-            "nullable": true
-          },
-          "payment_method_id": {
-            "type": "string",
-            "description": "Identifier for Payment Method used for the payment",
-            "nullable": true
-          },
-          "payment_method_status": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/PaymentMethodStatus"
-              }
-            ],
-            "nullable": true
-          },
-          "updated": {
-            "type": "string",
-            "format": "date-time",
-            "description": "Date time at which payment was updated",
-            "example": "2022-09-10T10:11:12Z",
-            "nullable": true
-          },
-          "split_payments": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/SplitPaymentsResponse"
-              }
-            ],
-            "nullable": true
-          },
-          "frm_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. FRM Metadata is useful for storing additional, structured information on an object related to FRM.",
-            "nullable": true
-          },
-          "merchant_order_reference_id": {
-            "type": "string",
-            "description": "Merchant's identifier for the payment/invoice. This will be sent to the connector\nif the connector provides support to accept multiple reference ids.\nIn case the connector supports only one reference id, Hyperswitch's Payment ID will be sent as reference.",
-            "example": "Custom_Order_id_123",
-            "nullable": true,
-            "maxLength": 255
-          },
-          "order_tax_amount": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/MinorUnit"
-              }
-            ],
-            "nullable": true
-          },
-          "connector_mandate_id": {
-            "type": "string",
-            "description": "Connector Identifier for the payment method",
-            "nullable": true
-          }
-        }
-      },
-      "PaymentsDynamicTaxCalculationRequest": {
-        "type": "object",
-        "required": [
-          "shipping",
-          "client_secret",
-          "payment_method_type"
-        ],
-        "properties": {
-          "shipping": {
-            "$ref": "#/components/schemas/Address"
-          },
-          "client_secret": {
-            "type": "string",
-            "description": "Client Secret"
-          },
-          "payment_method_type": {
-            "$ref": "#/components/schemas/PaymentMethodType"
-          },
-          "session_id": {
-            "type": "string",
-            "description": "Session Id",
-            "nullable": true
-          }
-        }
-      },
-      "PaymentsDynamicTaxCalculationResponse": {
-        "type": "object",
-        "required": [
-          "payment_id",
-          "net_amount",
-          "display_amount"
-        ],
-        "properties": {
-          "payment_id": {
-            "type": "string",
-            "description": "The identifier for the payment"
-          },
-          "net_amount": {
-            "$ref": "#/components/schemas/MinorUnit"
-          },
-          "order_tax_amount": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/MinorUnit"
-              }
-            ],
-            "nullable": true
-          },
-          "shipping_cost": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/MinorUnit"
-              }
-            ],
-            "nullable": true
-          },
-          "display_amount": {
-            "$ref": "#/components/schemas/DisplayAmountOnSdk"
-          }
-        }
-      },
-      "PaymentsExternalAuthenticationRequest": {
-        "type": "object",
-        "required": [
-          "client_secret",
-          "device_channel",
-          "threeds_method_comp_ind"
-        ],
-        "properties": {
-          "client_secret": {
-            "type": "string",
-            "description": "Client Secret"
-          },
-          "sdk_information": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/SdkInformation"
-              }
-            ],
-            "nullable": true
-          },
-          "device_channel": {
-            "$ref": "#/components/schemas/DeviceChannel"
-          },
-          "threeds_method_comp_ind": {
-            "$ref": "#/components/schemas/ThreeDsCompletionIndicator"
-          }
-        }
-      },
-      "PaymentsExternalAuthenticationResponse": {
-        "type": "object",
-        "required": [
-          "trans_status",
-          "three_ds_requestor_url"
-        ],
-        "properties": {
-          "trans_status": {
-            "$ref": "#/components/schemas/TransactionStatus"
-          },
-          "acs_url": {
-            "type": "string",
-            "description": "Access Server URL to be used for challenge submission",
-            "nullable": true
-          },
-          "challenge_request": {
-            "type": "string",
-            "description": "Challenge request which should be sent to acs_url",
-            "nullable": true
-          },
-          "acs_reference_number": {
-            "type": "string",
-            "description": "Unique identifier assigned by the EMVCo(Europay, Mastercard and Visa)",
-            "nullable": true
-          },
-          "acs_trans_id": {
-            "type": "string",
-            "description": "Unique identifier assigned by the ACS to identify a single transaction",
-            "nullable": true
-          },
-          "three_dsserver_trans_id": {
-            "type": "string",
-            "description": "Unique identifier assigned by the 3DS Server to identify a single transaction",
-            "nullable": true
-          },
-          "acs_signed_content": {
-            "type": "string",
-            "description": "Contains the JWS object created by the ACS for the ARes(Authentication Response) message",
-            "nullable": true
-          },
-          "three_ds_requestor_url": {
-            "type": "string",
-            "description": "Three DS Requestor URL"
-          }
-        }
-      },
-      "PaymentsIncrementalAuthorizationRequest": {
-        "type": "object",
-        "required": [
-          "amount"
-        ],
-        "properties": {
-          "amount": {
-            "type": "integer",
-            "format": "int64",
-            "description": "The total amount including previously authorized amount and additional amount",
-            "example": 6540
-          },
-          "reason": {
-            "type": "string",
-            "description": "Reason for incremental authorization",
-            "nullable": true
-          }
-        }
-      },
-      "PaymentsIntentResponse": {
-        "type": "object",
-        "required": [
-          "id",
-          "status",
-          "amount_details",
-          "client_secret",
-          "profile_id",
-          "capture_method",
-          "authentication_type",
-          "customer_id",
-          "customer_present",
-          "setup_future_usage",
-          "apply_mit_exemption",
-          "payment_link_enabled",
-          "request_incremental_authorization",
-          "expires_on",
-          "request_external_three_ds_authentication"
-        ],
-        "properties": {
-          "id": {
-            "type": "string",
-            "description": "Global Payment Id for the payment"
-          },
-          "status": {
-            "$ref": "#/components/schemas/IntentStatus"
-          },
-          "amount_details": {
-            "$ref": "#/components/schemas/AmountDetailsResponse"
-          },
-          "client_secret": {
-            "type": "string",
-            "description": "It's a token used for client side verification.",
-            "example": "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo"
-          },
-          "profile_id": {
-            "type": "string",
-            "description": "The identifier for the profile. This is inferred from the `x-profile-id` header"
-          },
-          "merchant_reference_id": {
-            "type": "string",
-            "description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant.",
-            "example": "pay_mbabizu24mvu3mela5njyhpit4",
-            "nullable": true,
-            "maxLength": 30,
-            "minLength": 30
-          },
-          "routing_algorithm_id": {
-            "type": "string",
-            "description": "The routing algorithm id to be used for the payment",
-            "nullable": true
-          },
-          "capture_method": {
-            "$ref": "#/components/schemas/CaptureMethod"
-          },
-          "authentication_type": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/AuthenticationType"
-              }
-            ],
-            "default": "no_three_ds"
-          },
-          "billing": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/Address"
-              }
-            ],
-            "nullable": true
-          },
-          "shipping": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/Address"
-              }
-            ],
-            "nullable": true
-          },
-          "customer_id": {
-            "type": "string",
-            "description": "The identifier for the customer",
-            "example": "12345_cus_01926c58bc6e77c09e809964e72af8c8",
-            "maxLength": 64,
-            "minLength": 32
-          },
-          "customer_present": {
-            "$ref": "#/components/schemas/PresenceOfCustomerDuringPayment"
-          },
-          "description": {
-            "type": "string",
-            "description": "A description for the payment",
-            "example": "It's my first payment request",
-            "nullable": true
-          },
-          "return_url": {
-            "type": "string",
-            "description": "The URL to which you want the user to be redirected after the completion of the payment operation",
-            "example": "https://hyperswitch.io",
-            "nullable": true
-          },
-          "setup_future_usage": {
-            "$ref": "#/components/schemas/FutureUsage"
-          },
-          "apply_mit_exemption": {
-            "$ref": "#/components/schemas/MitExemptionRequest"
-          },
-          "statement_descriptor": {
-            "type": "string",
-            "description": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.",
-            "example": "Hyperswitch Router",
-            "nullable": true,
-            "maxLength": 22
-          },
-          "order_details": {
-            "type": "array",
-            "items": {
-              "$ref": "#/components/schemas/OrderDetailsWithAmount"
-            },
-            "description": "Use this object to capture the details about the different products for which the payment is being made. The sum of amount across different products here should be equal to the overall payment amount",
-            "example": "[{\n        \"product_name\": \"Apple iPhone 16\",\n        \"quantity\": 1,\n        \"amount\" : 69000\n        \"product_img_link\" : \"https://dummy-img-link.com\"\n    }]",
-            "nullable": true
-          },
-          "allowed_payment_method_types": {
-            "type": "array",
-            "items": {
-              "$ref": "#/components/schemas/PaymentMethodType"
-            },
-            "description": "Use this parameter to restrict the Payment Method Types to show for a given PaymentIntent",
-            "nullable": true
-          },
-          "metadata": {
-            "type": "object",
-            "description": "Metadata is useful for storing additional, unstructured information on an object.",
-            "nullable": true
-          },
-          "connector_metadata": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/ConnectorMetadata"
-              }
-            ],
-            "nullable": true
-          },
-          "feature_metadata": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/FeatureMetadata"
-              }
-            ],
-            "nullable": true
-          },
-          "payment_link_enabled": {
-            "$ref": "#/components/schemas/EnablePaymentLinkRequest"
-          },
-          "payment_link_config": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/PaymentLinkConfigRequest"
-              }
-            ],
-            "nullable": true
-          },
-          "request_incremental_authorization": {
-            "$ref": "#/components/schemas/RequestIncrementalAuthorization"
-          },
-          "expires_on": {
-            "type": "string",
-            "format": "date-time",
-            "description": "Will be used to expire client secret after certain amount of time to be supplied in seconds"
-          },
-          "frm_metadata": {
-            "type": "object",
-            "description": "Additional data related to some frm(Fraud Risk Management) connectors",
-            "nullable": true
-          },
-          "request_external_three_ds_authentication": {
-            "$ref": "#/components/schemas/External3dsAuthenticationRequest"
+          "three_ds_requestor_url": {
+            "type": "string",
+            "description": "Three DS Requestor URL"
           }
-        },
-        "additionalProperties": false
+        }
       },
-      "PaymentsResponse": {
+      "PaymentsIncrementalAuthorizationRequest": {
         "type": "object",
         "required": [
-          "payment_id",
-          "merchant_id",
-          "status",
-          "amount",
-          "net_amount",
-          "amount_capturable",
-          "currency",
-          "payment_method",
-          "attempt_count"
+          "amount"
         ],
         "properties": {
-          "payment_id": {
-            "type": "string",
-            "description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant.",
-            "example": "pay_mbabizu24mvu3mela5njyhpit4",
-            "maxLength": 30,
-            "minLength": 30
-          },
-          "merchant_id": {
-            "type": "string",
-            "description": "This is an identifier for the merchant account. This is inferred from the API key\nprovided during the request",
-            "example": "merchant_1668273825",
-            "maxLength": 255
-          },
-          "status": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/IntentStatus"
-              }
-            ],
-            "default": "requires_confirmation"
-          },
           "amount": {
             "type": "integer",
             "format": "int64",
-            "description": "The payment amount. Amount for the payment in lowest denomination of the currency. (i.e) in cents for USD denomination, in paisa for INR denomination etc.,",
-            "example": 6540
-          },
-          "net_amount": {
-            "type": "integer",
-            "format": "int64",
-            "description": "The payment net amount. net_amount = amount + surcharge_details.surcharge_amount + surcharge_details.tax_amount + shipping_cost + order_tax_amount,\nIf no surcharge_details, shipping_cost, order_tax_amount, net_amount = amount",
+            "description": "The total amount including previously authorized amount and additional amount",
             "example": 6540
           },
-          "shipping_cost": {
-            "type": "integer",
-            "format": "int64",
-            "description": "The shipping cost for the payment.",
-            "example": 6540,
-            "nullable": true
-          },
-          "amount_capturable": {
-            "type": "integer",
-            "format": "int64",
-            "description": "The maximum amount that could be captured from the payment",
-            "example": 6540,
-            "minimum": 100
-          },
-          "amount_received": {
-            "type": "integer",
-            "format": "int64",
-            "description": "The amount which is already captured from the payment, this helps in the cases where merchants can't capture all capturable amount at once.",
-            "example": 6540,
-            "nullable": true
-          },
-          "connector": {
-            "type": "string",
-            "description": "The connector used for the payment",
-            "example": "stripe",
-            "nullable": true
-          },
-          "client_secret": {
-            "type": "string",
-            "description": "It's a token used for client side verification.",
-            "example": "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo",
-            "nullable": true
-          },
-          "created": {
-            "type": "string",
-            "format": "date-time",
-            "description": "Time when the payment was created",
-            "example": "2022-09-10T10:11:12Z",
-            "nullable": true
-          },
-          "currency": {
-            "$ref": "#/components/schemas/Currency"
-          },
-          "customer_id": {
-            "type": "string",
-            "description": "The identifier for the customer object. If not provided the customer ID will be autogenerated.\nThis field will be deprecated soon. Please refer to `customer.id`",
-            "deprecated": true,
-            "example": "cus_y3oqhf46pyzuxjbcn2giaqnb44",
-            "nullable": true,
-            "maxLength": 64,
-            "minLength": 1
-          },
-          "customer": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/CustomerDetailsResponse"
-              }
-            ],
-            "nullable": true
-          },
-          "description": {
-            "type": "string",
-            "description": "A description of the payment",
-            "example": "It's my first payment request",
-            "nullable": true
-          },
-          "refunds": {
-            "type": "array",
-            "items": {
-              "$ref": "#/components/schemas/RefundResponse"
-            },
-            "description": "List of refunds that happened on this intent, as same payment intent can have multiple refund requests depending on the nature of order",
-            "nullable": true
-          },
-          "disputes": {
-            "type": "array",
-            "items": {
-              "$ref": "#/components/schemas/DisputeResponsePaymentsRetrieve"
-            },
-            "description": "List of disputes that happened on this intent",
-            "nullable": true
-          },
-          "attempts": {
-            "type": "array",
-            "items": {
-              "$ref": "#/components/schemas/PaymentAttemptResponse"
-            },
-            "description": "List of attempts that happened on this intent",
-            "nullable": true
-          },
-          "captures": {
-            "type": "array",
-            "items": {
-              "$ref": "#/components/schemas/CaptureResponse"
-            },
-            "description": "List of captures done on latest attempt",
-            "nullable": true
-          },
-          "mandate_id": {
-            "type": "string",
-            "description": "A unique identifier to link the payment to a mandate, can be used instead of payment_method_data, in case of setting up recurring payments",
-            "example": "mandate_iwer89rnjef349dni3",
-            "nullable": true,
-            "maxLength": 255
-          },
-          "mandate_data": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/MandateData"
-              }
-            ],
-            "nullable": true
-          },
-          "setup_future_usage": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/FutureUsage"
-              }
-            ],
-            "nullable": true
-          },
-          "off_session": {
-            "type": "boolean",
-            "description": "Set to true to indicate that the customer is not in your checkout flow during this payment, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later. This parameter can only be used with confirm=true.",
-            "example": true,
-            "nullable": true
-          },
-          "capture_on": {
-            "type": "string",
-            "format": "date-time",
-            "description": "A timestamp (ISO 8601 code) that determines when the payment should be captured.\nProviding this field will automatically set `capture` to true",
-            "example": "2022-09-10T10:11:12Z",
-            "nullable": true
-          },
-          "capture_method": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/CaptureMethod"
-              }
-            ],
-            "nullable": true
-          },
-          "payment_method": {
-            "$ref": "#/components/schemas/PaymentMethod"
-          },
-          "payment_method_data": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/PaymentMethodDataResponseWithBilling"
-              }
-            ],
-            "nullable": true
-          },
-          "payment_token": {
-            "type": "string",
-            "description": "Provide a reference to a stored payment method",
-            "example": "187282ab-40ef-47a9-9206-5099ba31e432",
-            "nullable": true
-          },
-          "shipping": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/Address"
-              }
-            ],
-            "nullable": true
-          },
-          "billing": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/Address"
-              }
-            ],
-            "nullable": true
-          },
-          "order_details": {
-            "type": "array",
-            "items": {
-              "$ref": "#/components/schemas/OrderDetailsWithAmount"
-            },
-            "description": "Information about the product , quantity and amount for connectors. (e.g. Klarna)",
-            "example": "[{\n        \"product_name\": \"gillete creme\",\n        \"quantity\": 15,\n        \"amount\" : 900\n    }]",
-            "nullable": true
-          },
-          "email": {
-            "type": "string",
-            "description": "description: The customer's email address\nThis field will be deprecated soon. Please refer to `customer.email` object",
-            "deprecated": true,
-            "example": "johntest@test.com",
-            "nullable": true,
-            "maxLength": 255
-          },
-          "name": {
-            "type": "string",
-            "description": "description: The customer's name\nThis field will be deprecated soon. Please refer to `customer.name` object",
-            "deprecated": true,
-            "example": "John Test",
-            "nullable": true,
-            "maxLength": 255
-          },
-          "phone": {
-            "type": "string",
-            "description": "The customer's phone number\nThis field will be deprecated soon. Please refer to `customer.phone` object",
-            "deprecated": true,
-            "example": "9123456789",
-            "nullable": true,
-            "maxLength": 255
-          },
-          "return_url": {
+          "reason": {
             "type": "string",
-            "description": "The URL to redirect after the completion of the operation",
-            "example": "https://hyperswitch.io",
-            "nullable": true
-          },
-          "authentication_type": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/AuthenticationType"
-              }
-            ],
-            "default": "three_ds",
+            "description": "Reason for incremental authorization",
             "nullable": true
-          },
-          "statement_descriptor_name": {
+          }
+        }
+      },
+      "PaymentsIntentResponse": {
+        "type": "object",
+        "required": [
+          "id",
+          "status",
+          "amount_details",
+          "client_secret",
+          "profile_id",
+          "capture_method",
+          "authentication_type",
+          "customer_id",
+          "customer_present",
+          "setup_future_usage",
+          "apply_mit_exemption",
+          "payment_link_enabled",
+          "request_incremental_authorization",
+          "expires_on",
+          "request_external_three_ds_authentication"
+        ],
+        "properties": {
+          "id": {
             "type": "string",
-            "description": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.",
-            "example": "Hyperswitch Router",
-            "nullable": true,
-            "maxLength": 255
+            "description": "Global Payment Id for the payment"
           },
-          "statement_descriptor_suffix": {
-            "type": "string",
-            "description": "Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 255 characters for the concatenated descriptor.",
-            "example": "Payment for shoes purchase",
-            "nullable": true,
-            "maxLength": 255
+          "status": {
+            "$ref": "#/components/schemas/IntentStatus"
           },
-          "next_action": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/NextActionData"
-              }
-            ],
-            "nullable": true
+          "amount_details": {
+            "$ref": "#/components/schemas/AmountDetailsResponse"
           },
-          "cancellation_reason": {
+          "client_secret": {
             "type": "string",
-            "description": "If the payment was cancelled the reason will be provided here",
-            "nullable": true
+            "description": "It's a token used for client side verification.",
+            "example": "pay_U42c409qyHwOkWo3vK60_secret_el9ksDkiB8hi6j9N78yo"
           },
-          "error_code": {
+          "profile_id": {
             "type": "string",
-            "description": "If there was an error while calling the connectors the code is received here",
-            "example": "E0001",
-            "nullable": true
+            "description": "The identifier for the profile. This is inferred from the `x-profile-id` header"
           },
-          "error_message": {
+          "merchant_reference_id": {
             "type": "string",
-            "description": "If there was an error while calling the connector the error message is received here",
-            "example": "Failed while verifying the card",
-            "nullable": true
+            "description": "Unique identifier for the payment. This ensures idempotency for multiple payments\nthat have been done by a single merchant.",
+            "example": "pay_mbabizu24mvu3mela5njyhpit4",
+            "nullable": true,
+            "maxLength": 30,
+            "minLength": 30
           },
-          "unified_code": {
+          "routing_algorithm_id": {
             "type": "string",
-            "description": "error code unified across the connectors is received here if there was an error while calling connector",
+            "description": "The routing algorithm id to be used for the payment",
             "nullable": true
           },
-          "unified_message": {
-            "type": "string",
-            "description": "error message unified across the connectors is received here if there was an error while calling connector",
-            "nullable": true
+          "capture_method": {
+            "$ref": "#/components/schemas/CaptureMethod"
           },
-          "payment_experience": {
+          "authentication_type": {
             "allOf": [
               {
-                "$ref": "#/components/schemas/PaymentExperience"
+                "$ref": "#/components/schemas/AuthenticationType"
               }
             ],
-            "nullable": true
+            "default": "no_three_ds"
           },
-          "payment_method_type": {
+          "billing": {
             "allOf": [
               {
-                "$ref": "#/components/schemas/PaymentMethodType"
+                "$ref": "#/components/schemas/Address"
               }
             ],
             "nullable": true
           },
-          "connector_label": {
-            "type": "string",
-            "description": "The connector used for this payment along with the country and business details",
-            "example": "stripe_US_food",
-            "nullable": true
-          },
-          "business_country": {
+          "shipping": {
             "allOf": [
               {
-                "$ref": "#/components/schemas/CountryAlpha2"
+                "$ref": "#/components/schemas/Address"
               }
             ],
             "nullable": true
           },
-          "business_label": {
+          "customer_id": {
             "type": "string",
-            "description": "The business label of merchant for this payment",
-            "nullable": true
+            "description": "The identifier for the customer",
+            "example": "12345_cus_01926c58bc6e77c09e809964e72af8c8",
+            "maxLength": 64,
+            "minLength": 32
+          },
+          "customer_present": {
+            "$ref": "#/components/schemas/PresenceOfCustomerDuringPayment"
           },
-          "business_sub_label": {
+          "description": {
             "type": "string",
-            "description": "The business_sub_label for this payment",
+            "description": "A description for the payment",
+            "example": "It's my first payment request",
             "nullable": true
           },
-          "allowed_payment_method_types": {
-            "type": "array",
-            "items": {
-              "$ref": "#/components/schemas/PaymentMethodType"
-            },
-            "description": "Allowed Payment Method Types for a given PaymentIntent",
+          "return_url": {
+            "type": "string",
+            "description": "The URL to which you want the user to be redirected after the completion of the payment operation",
+            "example": "https://hyperswitch.io",
             "nullable": true
           },
-          "ephemeral_key": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/EphemeralKeyCreateResponse"
-              }
-            ],
-            "nullable": true
+          "setup_future_usage": {
+            "$ref": "#/components/schemas/FutureUsage"
           },
-          "manual_retry_allowed": {
-            "type": "boolean",
-            "description": "If true the payment can be retried with same or different payment method which means the confirm call can be made again.",
-            "nullable": true
+          "apply_mit_exemption": {
+            "$ref": "#/components/schemas/MitExemptionRequest"
           },
-          "connector_transaction_id": {
+          "statement_descriptor": {
             "type": "string",
-            "description": "A unique identifier for a payment provided by the connector",
-            "example": "993672945374576J",
+            "description": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.",
+            "example": "Hyperswitch Router",
+            "nullable": true,
+            "maxLength": 22
+          },
+          "order_details": {
+            "type": "array",
+            "items": {
+              "$ref": "#/components/schemas/OrderDetailsWithAmount"
+            },
+            "description": "Use this object to capture the details about the different products for which the payment is being made. The sum of amount across different products here should be equal to the overall payment amount",
+            "example": "[{\n        \"product_name\": \"Apple iPhone 16\",\n        \"quantity\": 1,\n        \"amount\" : 69000\n        \"product_img_link\" : \"https://dummy-img-link.com\"\n    }]",
             "nullable": true
           },
-          "frm_message": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/FrmMessage"
-              }
-            ],
+          "allowed_payment_method_types": {
+            "type": "array",
+            "items": {
+              "$ref": "#/components/schemas/PaymentMethodType"
+            },
+            "description": "Use this parameter to restrict the Payment Method Types to show for a given PaymentIntent",
             "nullable": true
           },
           "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.",
+            "description": "Metadata is useful for storing additional, unstructured information on an object.",
             "nullable": true
           },
           "connector_metadata": {
@@ -16384,154 +15388,35 @@
             ],
             "nullable": true
           },
-          "reference_id": {
-            "type": "string",
-            "description": "reference(Identifier) to the payment at connector side",
-            "example": "993672945374576J",
-            "nullable": true
-          },
-          "payment_link": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/PaymentLinkResponse"
-              }
-            ],
-            "nullable": true
-          },
-          "profile_id": {
-            "type": "string",
-            "description": "The business profile that is associated with this payment",
-            "nullable": true
-          },
-          "surcharge_details": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/RequestSurchargeDetails"
-              }
-            ],
-            "nullable": true
-          },
-          "attempt_count": {
-            "type": "integer",
-            "format": "int32",
-            "description": "Total number of attempts associated with this payment"
-          },
-          "merchant_decision": {
-            "type": "string",
-            "description": "Denotes the action(approve or reject) taken by merchant in case of manual review. Manual review can occur when the transaction is marked as risky by the frm_processor, payment processor or when there is underpayment/over payment incase of crypto payment",
-            "nullable": true
-          },
-          "merchant_connector_id": {
-            "type": "string",
-            "description": "Identifier of the connector ( merchant connector account ) which was chosen to make the payment",
-            "nullable": true
-          },
-          "incremental_authorization_allowed": {
-            "type": "boolean",
-            "description": "If true, incremental authorization can be performed on this payment, in case the funds authorized initially fall short.",
-            "nullable": true
-          },
-          "authorization_count": {
-            "type": "integer",
-            "format": "int32",
-            "description": "Total number of authorizations happened in an incremental_authorization payment",
-            "nullable": true
-          },
-          "incremental_authorizations": {
-            "type": "array",
-            "items": {
-              "$ref": "#/components/schemas/IncrementalAuthorizationResponse"
-            },
-            "description": "List of incremental authorizations happened to the payment",
-            "nullable": true
+          "payment_link_enabled": {
+            "$ref": "#/components/schemas/EnablePaymentLinkRequest"
           },
-          "external_authentication_details": {
+          "payment_link_config": {
             "allOf": [
               {
-                "$ref": "#/components/schemas/ExternalAuthenticationDetailsResponse"
+                "$ref": "#/components/schemas/PaymentLinkConfigRequest"
               }
             ],
             "nullable": true
           },
-          "external_3ds_authentication_attempted": {
-            "type": "boolean",
-            "description": "Flag indicating if external 3ds authentication is made or not",
-            "nullable": true
+          "request_incremental_authorization": {
+            "$ref": "#/components/schemas/RequestIncrementalAuthorization"
           },
           "expires_on": {
             "type": "string",
             "format": "date-time",
-            "description": "Date Time for expiry of the payment",
-            "example": "2022-09-10T10:11:12Z",
-            "nullable": true
-          },
-          "fingerprint": {
-            "type": "string",
-            "description": "Payment Fingerprint, to identify a particular card.\nIt is a 20 character long alphanumeric code.",
-            "nullable": true
-          },
-          "browser_info": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/BrowserInformation"
-              }
-            ],
-            "nullable": true
-          },
-          "payment_method_id": {
-            "type": "string",
-            "description": "Identifier for Payment Method used for the payment",
-            "nullable": true
-          },
-          "payment_method_status": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/PaymentMethodStatus"
-              }
-            ],
-            "nullable": true
-          },
-          "updated": {
-            "type": "string",
-            "format": "date-time",
-            "description": "Date time at which payment was updated",
-            "example": "2022-09-10T10:11:12Z",
-            "nullable": true
-          },
-          "split_payments": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/SplitPaymentsResponse"
-              }
-            ],
-            "nullable": true
+            "description": "Will be used to expire client secret after certain amount of time to be supplied in seconds"
           },
           "frm_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. FRM Metadata is useful for storing additional, structured information on an object related to FRM.",
-            "nullable": true
-          },
-          "merchant_order_reference_id": {
-            "type": "string",
-            "description": "Merchant's identifier for the payment/invoice. This will be sent to the connector\nif the connector provides support to accept multiple reference ids.\nIn case the connector supports only one reference id, Hyperswitch's Payment ID will be sent as reference.",
-            "example": "Custom_Order_id_123",
-            "nullable": true,
-            "maxLength": 255
-          },
-          "order_tax_amount": {
-            "allOf": [
-              {
-                "$ref": "#/components/schemas/MinorUnit"
-              }
-            ],
+            "description": "Additional data related to some frm(Fraud Risk Management) connectors",
             "nullable": true
           },
-          "connector_mandate_id": {
-            "type": "string",
-            "description": "Connector Identifier for the payment method",
-            "nullable": true
+          "request_external_three_ds_authentication": {
+            "$ref": "#/components/schemas/External3dsAuthenticationRequest"
           }
-        }
+        },
+        "additionalProperties": false
       },
       "PaymentsRetrieveRequest": {
         "type": "object",
@@ -19351,6 +18236,21 @@
           }
         }
       },
+      "ResourceId": {
+        "oneOf": [
+          {
+            "type": "object",
+            "required": [
+              "customer"
+            ],
+            "properties": {
+              "customer": {
+                "type": "string"
+              }
+            }
+          }
+        ]
+      },
       "ResponsePaymentMethodTypes": {
         "allOf": [
           {
diff --git a/crates/api_models/src/ephemeral_key.rs b/crates/api_models/src/ephemeral_key.rs
index fa61642e353..b5681f60ba2 100644
--- a/crates/api_models/src/ephemeral_key.rs
+++ b/crates/api_models/src/ephemeral_key.rs
@@ -19,51 +19,55 @@ pub struct EphemeralKeyCreateRequest {
 }
 
 #[cfg(feature = "v2")]
-/// Information required to create an ephemeral key.
+#[derive(Clone, Debug, serde::Serialize, serde::Deserialize, PartialEq, Eq, ToSchema)]
+#[serde(rename_all = "snake_case")]
+pub enum ResourceId {
+    #[schema(value_type = String)]
+    Customer(id_type::GlobalCustomerId),
+}
+
+#[cfg(feature = "v2")]
+/// Information required to create a client secret.
 #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema)]
-pub struct EphemeralKeyCreateRequest {
-    /// Customer ID for which an ephemeral key must be created
-    #[schema(
-        min_length = 32,
-        max_length = 64,
-        value_type = String,
-        example = "12345_cus_01926c58bc6e77c09e809964e72af8c8"
-    )]
-    pub customer_id: id_type::GlobalCustomerId,
+pub struct ClientSecretCreateRequest {
+    /// Resource ID for which a client secret must be created
+    pub resource_id: ResourceId,
 }
 
 #[cfg(feature = "v2")]
-/// ephemeral_key for the customer_id mentioned
+/// client_secret for the resource_id mentioned
 #[derive(Debug, serde::Serialize, serde::Deserialize, Clone, Eq, PartialEq, ToSchema)]
-pub struct EphemeralKeyResponse {
-    /// Ephemeral key id
+pub struct ClientSecretResponse {
+    /// Client Secret id
     #[schema(value_type = String, max_length = 32, min_length = 1)]
-    pub id: id_type::EphemeralKeyId,
-    /// customer_id to which this ephemeral key belongs to
-    #[schema(value_type = String, max_length = 64, min_length = 32, example = "12345_cus_01926c58bc6e77c09e809964e72af8c8")]
-    pub customer_id: id_type::GlobalCustomerId,
-    /// time at which this ephemeral key was created
+    pub id: id_type::ClientSecretId,
+    /// resource_id to which this client secret belongs to
+    #[schema(value_type = ResourceId)]
+    pub resource_id: ResourceId,
+    /// time at which this client secret was created
     pub created_at: time::PrimitiveDateTime,
-    /// time at which this ephemeral key would expire
+    /// time at which this client secret would expire
     pub expires: time::PrimitiveDateTime,
     #[schema(value_type=String)]
-    /// ephemeral key
+    /// client secret
     pub secret: Secret<String>,
 }
 
-impl common_utils::events::ApiEventMetric for EphemeralKeyCreateRequest {
+#[cfg(feature = "v2")]
+impl common_utils::events::ApiEventMetric for ClientSecretCreateRequest {
     fn get_api_event_type(&self) -> Option<common_utils::events::ApiEventsType> {
         Some(common_utils::events::ApiEventsType::Miscellaneous)
     }
 }
 
 #[cfg(feature = "v2")]
-impl common_utils::events::ApiEventMetric for EphemeralKeyResponse {
+impl common_utils::events::ApiEventMetric for ClientSecretResponse {
     fn get_api_event_type(&self) -> Option<common_utils::events::ApiEventsType> {
         Some(common_utils::events::ApiEventsType::Miscellaneous)
     }
 }
 
+#[cfg(feature = "v1")]
 /// ephemeral_key for the customer_id mentioned
 #[derive(Debug, serde::Serialize, serde::Deserialize, Clone, Eq, PartialEq, ToSchema)]
 pub struct EphemeralKeyCreateResponse {
diff --git a/crates/api_models/src/events/payment.rs b/crates/api_models/src/events/payment.rs
index e6de6190b83..7c7ba060541 100644
--- a/crates/api_models/src/events/payment.rs
+++ b/crates/api_models/src/events/payment.rs
@@ -10,6 +10,8 @@ use super::{
     not(feature = "payment_methods_v2")
 ))]
 use crate::payment_methods::CustomerPaymentMethodsListResponse;
+#[cfg(feature = "v1")]
+use crate::payments::{PaymentListResponse, PaymentListResponseV2, PaymentsResponse};
 #[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
 use crate::{events, payment_methods::CustomerPaymentMethodsListResponse};
 use crate::{
@@ -23,15 +25,14 @@ use crate::{
     payments::{
         self, ExtendedCardInfoResponse, PaymentIdType, PaymentListConstraints,
         PaymentListFilterConstraints, PaymentListFilters, PaymentListFiltersV2,
-        PaymentListResponse, PaymentListResponseV2, PaymentsAggregateResponse,
-        PaymentsApproveRequest, PaymentsCancelRequest, PaymentsCaptureRequest,
-        PaymentsCompleteAuthorizeRequest, PaymentsDynamicTaxCalculationRequest,
-        PaymentsDynamicTaxCalculationResponse, PaymentsExternalAuthenticationRequest,
-        PaymentsExternalAuthenticationResponse, PaymentsIncrementalAuthorizationRequest,
-        PaymentsManualUpdateRequest, PaymentsManualUpdateResponse,
-        PaymentsPostSessionTokensRequest, PaymentsPostSessionTokensResponse, PaymentsRejectRequest,
-        PaymentsResponse, PaymentsRetrieveRequest, PaymentsSessionResponse, PaymentsStartRequest,
-        RedirectionResponse,
+        PaymentsAggregateResponse, PaymentsApproveRequest, PaymentsCancelRequest,
+        PaymentsCaptureRequest, PaymentsCompleteAuthorizeRequest,
+        PaymentsDynamicTaxCalculationRequest, PaymentsDynamicTaxCalculationResponse,
+        PaymentsExternalAuthenticationRequest, PaymentsExternalAuthenticationResponse,
+        PaymentsIncrementalAuthorizationRequest, PaymentsManualUpdateRequest,
+        PaymentsManualUpdateResponse, PaymentsPostSessionTokensRequest,
+        PaymentsPostSessionTokensResponse, PaymentsRejectRequest, PaymentsRetrieveRequest,
+        PaymentsSessionResponse, PaymentsStartRequest, RedirectionResponse,
     },
 };
 
@@ -355,12 +356,14 @@ impl ApiEventMetric for PaymentListConstraints {
     }
 }
 
+#[cfg(feature = "v1")]
 impl ApiEventMetric for PaymentListResponse {
     fn get_api_event_type(&self) -> Option<ApiEventsType> {
         Some(ApiEventsType::ResourceListAPI)
     }
 }
 
+#[cfg(feature = "v1")]
 impl ApiEventMetric for PaymentListResponseV2 {
     fn get_api_event_type(&self) -> Option<ApiEventsType> {
         Some(ApiEventsType::ResourceListAPI)
diff --git a/crates/api_models/src/payment_methods.rs b/crates/api_models/src/payment_methods.rs
index 8df2c948736..5ec043fd400 100644
--- a/crates/api_models/src/payment_methods.rs
+++ b/crates/api_models/src/payment_methods.rs
@@ -2441,4 +2441,8 @@ pub struct PaymentMethodsSessionResponse {
     #[schema(value_type = PrimitiveDateTime, example = "2023-01-18T11:04:09.922Z")]
     #[serde(with = "common_utils::custom_serde::iso8601")]
     pub expires_at: time::PrimitiveDateTime,
+
+    /// Client Secret
+    #[schema(value_type = String)]
+    pub client_secret: masking::Secret<String>,
 }
diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs
index b6152cc9787..6177f9070bb 100644
--- a/crates/api_models/src/payments.rs
+++ b/crates/api_models/src/payments.rs
@@ -27,12 +27,13 @@ use time::{Date, PrimitiveDateTime};
 use url::Url;
 use utoipa::ToSchema;
 
+#[cfg(feature = "v1")]
+use crate::ephemeral_key::EphemeralKeyCreateResponse;
 #[cfg(feature = "v2")]
 use crate::payment_methods;
 use crate::{
     admin::{self, MerchantConnectorInfo},
     disputes, enums as api_enums,
-    ephemeral_key::EphemeralKeyCreateResponse,
     mandates::RecurringDetails,
     refunds,
 };
@@ -4411,6 +4412,7 @@ pub struct ReceiverDetails {
     amount_remaining: Option<i64>,
 }
 
+#[cfg(feature = "v1")]
 #[derive(Clone, Debug, PartialEq, serde::Serialize, ToSchema, router_derive::PolymorphicSchema)]
 #[generate_schemas(PaymentsCreateResponseOpenApi)]
 pub struct PaymentsResponse {
@@ -5101,6 +5103,7 @@ pub struct PaymentListConstraints {
     pub created_gte: Option<PrimitiveDateTime>,
 }
 
+#[cfg(feature = "v1")]
 #[derive(Clone, Debug, serde::Serialize, ToSchema)]
 pub struct PaymentListResponse {
     /// The number of payments included in the list
@@ -5127,6 +5130,7 @@ pub struct IncrementalAuthorizationResponse {
     pub previously_authorized_amount: MinorUnit,
 }
 
+#[cfg(feature = "v1")]
 #[derive(Clone, Debug, serde::Serialize)]
 pub struct PaymentListResponseV2 {
     /// The number of payments included in the list for given constraints
diff --git a/crates/api_models/src/webhooks.rs b/crates/api_models/src/webhooks.rs
index f99e3a450b2..ddefea542c2 100644
--- a/crates/api_models/src/webhooks.rs
+++ b/crates/api_models/src/webhooks.rs
@@ -285,7 +285,7 @@ pub enum OutgoingWebhookContent {
 #[serde(tag = "type", content = "object", rename_all = "snake_case")]
 #[cfg(feature = "v2")]
 pub enum OutgoingWebhookContent {
-    #[schema(value_type = PaymentsResponse, title = "PaymentsResponse")]
+    #[schema(value_type = PaymentsRetrieveResponse, title = "PaymentsResponse")]
     PaymentDetails(Box<payments::PaymentsRetrieveResponse>),
     #[schema(value_type = RefundResponse, title = "RefundResponse")]
     RefundDetails(Box<refunds::RefundResponse>),
diff --git a/crates/common_utils/src/events.rs b/crates/common_utils/src/events.rs
index 823b48083e7..2e90d646e9e 100644
--- a/crates/common_utils/src/events.rs
+++ b/crates/common_utils/src/events.rs
@@ -112,8 +112,9 @@ pub enum ApiEventsType {
         poll_id: String,
     },
     Analytics,
-    EphemeralKey {
-        key_id: id_type::EphemeralKeyId,
+    #[cfg(feature = "v2")]
+    ClientSecret {
+        key_id: id_type::ClientSecretId,
     },
     #[cfg(feature = "v2")]
     PaymentMethodSession {
diff --git a/crates/common_utils/src/id_type.rs b/crates/common_utils/src/id_type.rs
index ebb5e8e481b..30b6a3888da 100644
--- a/crates/common_utils/src/id_type.rs
+++ b/crates/common_utils/src/id_type.rs
@@ -2,8 +2,8 @@
 //! The id type can be used to create specific id types with custom behaviour
 
 mod api_key;
+mod client_secret;
 mod customer;
-mod ephemeral_key;
 #[cfg(feature = "v2")]
 mod global_id;
 mod merchant;
@@ -38,8 +38,8 @@ pub use self::global_id::{
 };
 pub use self::{
     api_key::ApiKeyId,
+    client_secret::ClientSecretId,
     customer::CustomerId,
-    ephemeral_key::EphemeralKeyId,
     merchant::MerchantId,
     merchant_connector_account::MerchantConnectorAccountId,
     organization::OrganizationId,
diff --git a/crates/common_utils/src/id_type/client_secret.rs b/crates/common_utils/src/id_type/client_secret.rs
new file mode 100644
index 00000000000..b9d7f2e09e6
--- /dev/null
+++ b/crates/common_utils/src/id_type/client_secret.rs
@@ -0,0 +1,32 @@
+crate::id_type!(
+    ClientSecretId,
+    "A type for key_id that can be used for Ephemeral key IDs"
+);
+crate::impl_id_type_methods!(ClientSecretId, "key_id");
+
+// This is to display the `ClientSecretId` as ClientSecretId(abcd)
+crate::impl_debug_id_type!(ClientSecretId);
+crate::impl_try_from_cow_str_id_type!(ClientSecretId, "key_id");
+
+crate::impl_generate_id_id_type!(ClientSecretId, "csi");
+crate::impl_serializable_secret_id_type!(ClientSecretId);
+crate::impl_queryable_id_type!(ClientSecretId);
+crate::impl_to_sql_from_sql_id_type!(ClientSecretId);
+
+#[cfg(feature = "v2")]
+impl crate::events::ApiEventMetric for ClientSecretId {
+    fn get_api_event_type(&self) -> Option<crate::events::ApiEventsType> {
+        Some(crate::events::ApiEventsType::ClientSecret {
+            key_id: self.clone(),
+        })
+    }
+}
+
+crate::impl_default_id_type!(ClientSecretId, "key");
+
+impl ClientSecretId {
+    /// Generate a key for redis
+    pub fn generate_redis_key(&self) -> String {
+        format!("cs_{}", self.get_string_repr())
+    }
+}
diff --git a/crates/common_utils/src/id_type/ephemeral_key.rs b/crates/common_utils/src/id_type/ephemeral_key.rs
deleted file mode 100644
index 071980fc6a4..00000000000
--- a/crates/common_utils/src/id_type/ephemeral_key.rs
+++ /dev/null
@@ -1,31 +0,0 @@
-crate::id_type!(
-    EphemeralKeyId,
-    "A type for key_id that can be used for Ephemeral key IDs"
-);
-crate::impl_id_type_methods!(EphemeralKeyId, "key_id");
-
-// This is to display the `EphemeralKeyId` as EphemeralKeyId(abcd)
-crate::impl_debug_id_type!(EphemeralKeyId);
-crate::impl_try_from_cow_str_id_type!(EphemeralKeyId, "key_id");
-
-crate::impl_generate_id_id_type!(EphemeralKeyId, "eki");
-crate::impl_serializable_secret_id_type!(EphemeralKeyId);
-crate::impl_queryable_id_type!(EphemeralKeyId);
-crate::impl_to_sql_from_sql_id_type!(EphemeralKeyId);
-
-impl crate::events::ApiEventMetric for EphemeralKeyId {
-    fn get_api_event_type(&self) -> Option<crate::events::ApiEventsType> {
-        Some(crate::events::ApiEventsType::EphemeralKey {
-            key_id: self.clone(),
-        })
-    }
-}
-
-crate::impl_default_id_type!(EphemeralKeyId, "key");
-
-impl EphemeralKeyId {
-    /// Generate a key for redis
-    pub fn generate_redis_key(&self) -> String {
-        format!("epkey_{}", self.get_string_repr())
-    }
-}
diff --git a/crates/common_utils/src/id_type/global_id/payment_methods.rs b/crates/common_utils/src/id_type/global_id/payment_methods.rs
index 6e3c95068fe..b88cb784682 100644
--- a/crates/common_utils/src/id_type/global_id/payment_methods.rs
+++ b/crates/common_utils/src/id_type/global_id/payment_methods.rs
@@ -54,7 +54,7 @@ impl GlobalPaymentMethodSessionId {
         Ok(Self(global_id))
     }
 
-    fn get_string_repr(&self) -> &str {
+    pub fn get_string_repr(&self) -> &str {
         self.0.get_string_repr()
     }
 
diff --git a/crates/diesel_models/src/ephemeral_key.rs b/crates/diesel_models/src/ephemeral_key.rs
index c7fc103ed09..7af6569a5ae 100644
--- a/crates/diesel_models/src/ephemeral_key.rs
+++ b/crates/diesel_models/src/ephemeral_key.rs
@@ -1,30 +1,29 @@
 #[cfg(feature = "v2")]
 use masking::{PeekInterface, Secret};
+
 #[cfg(feature = "v2")]
-pub struct EphemeralKeyTypeNew {
-    pub id: common_utils::id_type::EphemeralKeyId,
+pub struct ClientSecretTypeNew {
+    pub id: common_utils::id_type::ClientSecretId,
     pub merchant_id: common_utils::id_type::MerchantId,
-    pub customer_id: common_utils::id_type::GlobalCustomerId,
     pub secret: Secret<String>,
-    pub resource_type: ResourceType,
+    pub resource_id: ResourceId,
 }
 
 #[cfg(feature = "v2")]
 #[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
-pub struct EphemeralKeyType {
-    pub id: common_utils::id_type::EphemeralKeyId,
+pub struct ClientSecretType {
+    pub id: common_utils::id_type::ClientSecretId,
     pub merchant_id: common_utils::id_type::MerchantId,
-    pub customer_id: common_utils::id_type::GlobalCustomerId,
-    pub resource_type: ResourceType,
+    pub resource_id: ResourceId,
     pub created_at: time::PrimitiveDateTime,
     pub expires: time::PrimitiveDateTime,
     pub secret: Secret<String>,
 }
 
 #[cfg(feature = "v2")]
-impl EphemeralKeyType {
+impl ClientSecretType {
     pub fn generate_secret_key(&self) -> String {
-        format!("epkey_{}", self.secret.peek())
+        format!("cs_{}", self.secret.peek())
     }
 }
 
@@ -51,20 +50,22 @@ impl common_utils::events::ApiEventMetric for EphemeralKey {
     }
 }
 
-#[derive(
-    Clone,
-    Copy,
-    Debug,
-    serde::Serialize,
-    serde::Deserialize,
-    strum::Display,
-    strum::EnumString,
-    PartialEq,
-    Eq,
-)]
+#[cfg(feature = "v2")]
+#[derive(Clone, Debug, serde::Serialize, serde::Deserialize, PartialEq, Eq)]
 #[serde(rename_all = "snake_case")]
-#[strum(serialize_all = "snake_case")]
-pub enum ResourceType {
-    Payment,
-    PaymentMethod,
+pub enum ResourceId {
+    Payment(common_utils::id_type::GlobalPaymentId),
+    Customer(common_utils::id_type::GlobalCustomerId),
+    PaymentMethodSession(common_utils::id_type::GlobalPaymentMethodSessionId),
+}
+
+#[cfg(feature = "v2")]
+impl ResourceId {
+    pub fn to_str(&self) -> &str {
+        match self {
+            Self::Payment(id) => id.get_string_repr(),
+            Self::Customer(id) => id.get_string_repr(),
+            Self::PaymentMethodSession(id) => id.get_string_repr(),
+        }
+    }
 }
diff --git a/crates/openapi/src/openapi_v2.rs b/crates/openapi/src/openapi_v2.rs
index 299bec55398..8f663ffc2aa 100644
--- a/crates/openapi/src/openapi_v2.rs
+++ b/crates/openapi/src/openapi_v2.rs
@@ -194,6 +194,7 @@ Never share your secret api keys. Keep them guarded and secure.
         api_models::customers::CustomerRequest,
         api_models::customers::CustomerUpdateRequest,
         api_models::customers::CustomerDeleteResponse,
+        api_models::ephemeral_key::ResourceId,
         api_models::payment_methods::PaymentMethodCreate,
         api_models::payment_methods::PaymentMethodIntentCreate,
         api_models::payment_methods::PaymentMethodIntentConfirm,
@@ -364,8 +365,6 @@ Never share your secret api keys. Keep them guarded and secure.
         api_models::payments::CardRedirectData,
         api_models::payments::CardToken,
         api_models::payments::CustomerAcceptance,
-        api_models::payments::PaymentsResponse,
-        api_models::payments::PaymentsCreateResponseOpenApi,
         api_models::payments::PaymentRetrieveBody,
         api_models::payments::PaymentsRetrieveRequest,
         api_models::payments::PaymentsCaptureRequest,
@@ -429,7 +428,6 @@ Never share your secret api keys. Keep them guarded and secure.
         api_models::payments::SamsungPayTokenData,
         api_models::payments::PaymentsCancelRequest,
         api_models::payments::PaymentListConstraints,
-        api_models::payments::PaymentListResponse,
         api_models::payments::CashappQr,
         api_models::payments::BankTransferData,
         api_models::payments::BankTransferNextStepsData,
@@ -501,7 +499,7 @@ Never share your secret api keys. Keep them guarded and secure.
         api_models::mandates::MandateCardDetails,
         api_models::mandates::RecurringDetails,
         api_models::mandates::ProcessorPaymentToken,
-        api_models::ephemeral_key::EphemeralKeyCreateResponse,
+        api_models::ephemeral_key::ClientSecretResponse,
         api_models::payments::CustomerDetails,
         api_models::payments::GiftCardData,
         api_models::payments::GiftCardDetails,
diff --git a/crates/router/src/core/payment_methods.rs b/crates/router/src/core/payment_methods.rs
index 62e0f1d29d1..9aca771e22b 100644
--- a/crates/router/src/core/payment_methods.rs
+++ b/crates/router/src/core/payment_methods.rs
@@ -1030,105 +1030,6 @@ pub async fn payment_method_intent_create(
     Ok(services::ApplicationResponse::Json(resp))
 }
 
-#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
-#[instrument(skip_all)]
-pub async fn payment_method_intent_confirm(
-    state: &SessionState,
-    req: api::PaymentMethodIntentConfirm,
-    merchant_account: &domain::MerchantAccount,
-    key_store: &domain::MerchantKeyStore,
-    pm_id: id_type::GlobalPaymentMethodId,
-) -> RouterResponse<api::PaymentMethodResponse> {
-    let key_manager_state = &(state).into();
-    req.validate()?;
-
-    let db = &*state.store;
-
-    let payment_method = db
-        .find_payment_method(
-            key_manager_state,
-            key_store,
-            &pm_id,
-            merchant_account.storage_scheme,
-        )
-        .await
-        .change_context(errors::ApiErrorResponse::PaymentMethodNotFound)
-        .attach_printable("Unable to find payment method")?;
-
-    when(
-        payment_method.status != enums::PaymentMethodStatus::AwaitingData,
-        || {
-            Err(errors::ApiErrorResponse::InvalidRequestData {
-                message: "Invalid pm_id provided: This Payment method cannot be confirmed"
-                    .to_string(),
-            })
-        },
-    )?;
-
-    let payment_method_data = pm_types::PaymentMethodVaultingData::from(req.payment_method_data);
-
-    let vaulting_result = vault_payment_method(
-        state,
-        &payment_method_data,
-        merchant_account,
-        key_store,
-        None,
-    )
-    .await;
-
-    let response = match vaulting_result {
-        Ok((vaulting_resp, fingerprint_id)) => {
-            let pm_update = create_pm_additional_data_update(
-                &payment_method_data,
-                state,
-                key_store,
-                Some(vaulting_resp.vault_id.get_string_repr().clone()),
-                Some(req.payment_method_type),
-                Some(req.payment_method_subtype),
-                Some(fingerprint_id),
-            )
-            .await
-            .attach_printable("Unable to create Payment method data")?;
-
-            let payment_method = db
-                .update_payment_method(
-                    &(state.into()),
-                    key_store,
-                    payment_method,
-                    pm_update,
-                    merchant_account.storage_scheme,
-                )
-                .await
-                .change_context(errors::ApiErrorResponse::InternalServerError)
-                .attach_printable("Failed to update payment method in db")?;
-
-            let resp = pm_transforms::generate_payment_method_response(&payment_method)?;
-
-            Ok(resp)
-        }
-        Err(e) => {
-            let pm_update = storage::PaymentMethodUpdate::StatusUpdate {
-                status: Some(enums::PaymentMethodStatus::Inactive),
-            };
-
-            db.update_payment_method(
-                &(state.into()),
-                key_store,
-                payment_method,
-                pm_update,
-                merchant_account.storage_scheme,
-            )
-            .await
-            .change_context(errors::ApiErrorResponse::InternalServerError)
-            .attach_printable("Failed to update payment method in db")?;
-
-            Err(e)
-        }
-    }?;
-
-    Ok(services::ApplicationResponse::Json(response))
-}
-
 #[cfg(feature = "v2")]
 trait PerformFilteringOnEnabledPaymentMethods {
     fn perform_filtering(self) -> FilteredPaymentMethodsEnabled;
@@ -1934,6 +1835,15 @@ pub async fn payment_methods_session_create(
 
     let expires_at = common_utils::date_time::now().saturating_add(Duration::seconds(expires_in));
 
+    let client_secret = payment_helpers::create_client_secret(
+        &state,
+        merchant_account.get_id(),
+        diesel_models::ResourceId::PaymentMethodSession(payment_methods_session_id.clone()),
+    )
+    .await
+    .change_context(errors::ApiErrorResponse::InternalServerError)
+    .attach_printable("Unable to create client secret")?;
+
     let payment_method_session_domain_model =
         hyperswitch_domain_models::payment_methods::PaymentMethodsSession {
             id: payment_methods_session_id,
@@ -1954,9 +1864,10 @@ pub async fn payment_methods_session_create(
     .change_context(errors::ApiErrorResponse::InternalServerError)
     .attach_printable("Failed to insert payment methods session in db")?;
 
-    let response = payment_methods::PaymentMethodsSessionResponse::foreign_from(
+    let response = payment_methods::PaymentMethodsSessionResponse::foreign_from((
         payment_method_session_domain_model,
-    );
+        client_secret.secret,
+    ));
 
     Ok(services::ApplicationResponse::Json(response))
 }
@@ -1979,9 +1890,10 @@ pub async fn payment_methods_session_retrieve(
         })
         .attach_printable("Failed to retrieve payment methods session from db")?;
 
-    let response = payment_methods::PaymentMethodsSessionResponse::foreign_from(
+    let response = payment_methods::PaymentMethodsSessionResponse::foreign_from((
         payment_method_session_domain_model,
-    );
+        Secret::new("CLIENT_SECRET_REDACTED".to_string()),
+    ));
 
     Ok(services::ApplicationResponse::Json(response))
 }
diff --git a/crates/router/src/core/payment_methods/transformers.rs b/crates/router/src/core/payment_methods/transformers.rs
index d8e3bbf3829..c4d3eafe463 100644
--- a/crates/router/src/core/payment_methods/transformers.rs
+++ b/crates/router/src/core/payment_methods/transformers.rs
@@ -972,22 +972,30 @@ impl transformers::ForeignTryFrom<domain::PaymentMethod> for api::CustomerPaymen
 }
 
 #[cfg(feature = "v2")]
-impl transformers::ForeignFrom<hyperswitch_domain_models::payment_methods::PaymentMethodsSession>
-    for api_models::payment_methods::PaymentMethodsSessionResponse
+impl
+    transformers::ForeignFrom<(
+        hyperswitch_domain_models::payment_methods::PaymentMethodsSession,
+        Secret<String>,
+    )> for api_models::payment_methods::PaymentMethodsSessionResponse
 {
     fn foreign_from(
-        item: hyperswitch_domain_models::payment_methods::PaymentMethodsSession,
+        item: (
+            hyperswitch_domain_models::payment_methods::PaymentMethodsSession,
+            Secret<String>,
+        ),
     ) -> Self {
+        let (session, client_secret) = item;
         Self {
-            id: item.id,
-            customer_id: item.customer_id,
-            billing: item
+            id: session.id,
+            customer_id: session.customer_id,
+            billing: session
                 .billing
                 .map(|address| address.into_inner())
                 .map(From::from),
-            psp_tokenization: item.psp_tokenization,
-            network_tokenization: item.network_tokenization,
-            expires_at: item.expires_at,
+            psp_tokenization: session.psp_tokenization,
+            network_tokenization: session.network_tokenization,
+            expires_at: session.expires_at,
+            client_secret,
         }
     }
 }
diff --git a/crates/router/src/core/payments/helpers.rs b/crates/router/src/core/payments/helpers.rs
index 797aadbbc05..70f921fa817 100644
--- a/crates/router/src/core/payments/helpers.rs
+++ b/crates/router/src/core/payments/helpers.rs
@@ -1,7 +1,7 @@
 use std::{borrow::Cow, collections::HashSet, str::FromStr};
 
 #[cfg(feature = "v2")]
-use api_models::ephemeral_key::EphemeralKeyResponse;
+use api_models::ephemeral_key::ClientSecretResponse;
 use api_models::{
     mandates::RecurringDetails,
     payments::{additional_info as payment_additional_types, RequestSurchargeDetails},
@@ -3053,76 +3053,72 @@ pub async fn make_ephemeral_key(
 }
 
 #[cfg(feature = "v2")]
-pub async fn make_ephemeral_key(
+pub async fn make_client_secret(
     state: SessionState,
-    customer_id: id_type::GlobalCustomerId,
+    resource_id: api_models::ephemeral_key::ResourceId,
     merchant_account: domain::MerchantAccount,
     key_store: domain::MerchantKeyStore,
     headers: &actix_web::http::header::HeaderMap,
-) -> errors::RouterResponse<EphemeralKeyResponse> {
+) -> errors::RouterResponse<ClientSecretResponse> {
     let db = &state.store;
     let key_manager_state = &((&state).into());
-    db.find_customer_by_global_id(
-        key_manager_state,
-        &customer_id,
-        merchant_account.get_id(),
-        &key_store,
-        merchant_account.storage_scheme,
-    )
-    .await
-    .to_not_found_response(errors::ApiErrorResponse::CustomerNotFound)?;
-
-    let resource_type = services::authentication::get_header_value_by_key(
-        headers::X_RESOURCE_TYPE.to_string(),
-        headers,
-    )?
-    .map(ephemeral_key::ResourceType::from_str)
-    .transpose()
-    .change_context(errors::ApiErrorResponse::InvalidRequestData {
-        message: format!("`{}` header is invalid", headers::X_RESOURCE_TYPE),
-    })?
-    .get_required_value("ResourceType")
-    .attach_printable("Failed to convert ResourceType from string")?;
-
-    let ephemeral_key = create_ephemeral_key(
-        &state,
-        &customer_id,
-        merchant_account.get_id(),
-        resource_type,
-    )
-    .await
-    .change_context(errors::ApiErrorResponse::InternalServerError)
-    .attach_printable("Unable to create ephemeral key")?;
 
-    let response = EphemeralKeyResponse::foreign_from(ephemeral_key);
+    match &resource_id {
+        api_models::ephemeral_key::ResourceId::Customer(global_customer_id) => {
+            db.find_customer_by_global_id(
+                key_manager_state,
+                global_customer_id,
+                merchant_account.get_id(),
+                &key_store,
+                merchant_account.storage_scheme,
+            )
+            .await
+            .to_not_found_response(errors::ApiErrorResponse::CustomerNotFound)?;
+        }
+    }
+
+    let resource_id = match resource_id {
+        api_models::ephemeral_key::ResourceId::Customer(global_customer_id) => {
+            diesel_models::ResourceId::Customer(global_customer_id)
+        }
+    };
+
+    let resource_id = resource_id;
+
+    let client_secret = create_client_secret(&state, merchant_account.get_id(), resource_id)
+        .await
+        .change_context(errors::ApiErrorResponse::InternalServerError)
+        .attach_printable("Unable to create client secret")?;
+
+    let response = ClientSecretResponse::foreign_try_from(client_secret)
+        .attach_printable("Only customer is supported as resource_id in response")?;
     Ok(services::ApplicationResponse::Json(response))
 }
 
 #[cfg(feature = "v2")]
-pub async fn create_ephemeral_key(
+pub async fn create_client_secret(
     state: &SessionState,
-    customer_id: &id_type::GlobalCustomerId,
     merchant_id: &id_type::MerchantId,
-    resource_type: ephemeral_key::ResourceType,
-) -> RouterResult<ephemeral_key::EphemeralKeyType> {
+    resource_id: diesel_models::ephemeral_key::ResourceId,
+) -> RouterResult<ephemeral_key::ClientSecretType> {
     use common_utils::generate_time_ordered_id;
 
     let store = &state.store;
-    let id = id_type::EphemeralKeyId::generate();
-    let secret = masking::Secret::new(generate_time_ordered_id("epk"));
-    let ephemeral_key = ephemeral_key::EphemeralKeyTypeNew {
+    let id = id_type::ClientSecretId::generate();
+    let secret = masking::Secret::new(generate_time_ordered_id("cs"));
+
+    let client_secret = ephemeral_key::ClientSecretTypeNew {
         id,
-        customer_id: customer_id.to_owned(),
         merchant_id: merchant_id.to_owned(),
         secret,
-        resource_type,
+        resource_id,
     };
-    let ephemeral_key = store
-        .create_ephemeral_key(ephemeral_key, state.conf.eph_key.validity)
+    let client_secret = store
+        .create_client_secret(client_secret, state.conf.eph_key.validity)
         .await
         .change_context(errors::ApiErrorResponse::InternalServerError)
-        .attach_printable("Unable to create ephemeral key")?;
-    Ok(ephemeral_key)
+        .attach_printable("Unable to create client secret")?;
+    Ok(client_secret)
 }
 
 #[cfg(feature = "v1")]
@@ -3140,13 +3136,13 @@ pub async fn delete_ephemeral_key(
 }
 
 #[cfg(feature = "v2")]
-pub async fn delete_ephemeral_key(
+pub async fn delete_client_secret(
     state: SessionState,
     ephemeral_key_id: String,
-) -> errors::RouterResponse<EphemeralKeyResponse> {
+) -> errors::RouterResponse<ClientSecretResponse> {
     let db = state.store.as_ref();
     let ephemeral_key = db
-        .delete_ephemeral_key(&ephemeral_key_id)
+        .delete_client_secret(&ephemeral_key_id)
         .await
         .map_err(|err| match err.current_context() {
             errors::StorageError::ValueNotFound(_) => {
@@ -3158,10 +3154,12 @@ pub async fn delete_ephemeral_key(
         })
         .attach_printable("Unable to delete ephemeral key")?;
 
-    let response = EphemeralKeyResponse::foreign_from(ephemeral_key);
+    let response = ClientSecretResponse::foreign_try_from(ephemeral_key)
+        .attach_printable("Only customer is supported as resource_id in response")?;
     Ok(services::ApplicationResponse::Json(response))
 }
 
+#[cfg(feature = "v1")]
 pub fn make_pg_redirect_response(
     payment_id: id_type::PaymentId,
     response: &api::PaymentsResponse,
diff --git a/crates/router/src/core/payments/transformers.rs b/crates/router/src/core/payments/transformers.rs
index 80c10a294ec..b70c08d82c7 100644
--- a/crates/router/src/core/payments/transformers.rs
+++ b/crates/router/src/core/payments/transformers.rs
@@ -1725,7 +1725,7 @@ pub fn payments_to_payments_response<Op, F: Clone, D>(
     _connector_http_status_code: Option<u16>,
     _external_latency: Option<u128>,
     _is_latency_header_enabled: Option<bool>,
-) -> RouterResponse<api::PaymentsResponse>
+) -> RouterResponse<api_models::payments::PaymentsRetrieveResponse>
 where
     Op: Debug,
     D: OperationSessionGetters<F>,
@@ -2565,6 +2565,7 @@ impl ForeignFrom<(storage::PaymentIntent, storage::PaymentAttempt)> for api::Pay
     }
 }
 
+#[cfg(feature = "v1")]
 impl ForeignFrom<ephemeral_key::EphemeralKey> for api::ephemeral_key::EphemeralKeyCreateResponse {
     fn foreign_from(from: ephemeral_key::EphemeralKey) -> Self {
         Self {
diff --git a/crates/router/src/core/utils.rs b/crates/router/src/core/utils.rs
index 0f775eda855..0f51c67669d 100644
--- a/crates/router/src/core/utils.rs
+++ b/crates/router/src/core/utils.rs
@@ -1415,6 +1415,7 @@ pub fn get_external_authentication_request_poll_id(
     payment_id.get_external_authentication_request_poll_id()
 }
 
+#[cfg(feature = "v1")]
 pub fn get_html_redirect_response_for_external_authentication(
     return_url_with_query_params: String,
     payment_response: &api_models::payments::PaymentsResponse,
diff --git a/crates/router/src/db.rs b/crates/router/src/db.rs
index 124161454a0..17da4902bac 100644
--- a/crates/router/src/db.rs
+++ b/crates/router/src/db.rs
@@ -99,6 +99,7 @@ pub trait StorageInterface:
     + dashboard_metadata::DashboardMetadataInterface
     + dispute::DisputeInterface
     + ephemeral_key::EphemeralKeyInterface
+    + ephemeral_key::ClientSecretInterface
     + events::EventInterface
     + file::FileMetadataInterface
     + FraudCheckInterface
diff --git a/crates/router/src/db/ephemeral_key.rs b/crates/router/src/db/ephemeral_key.rs
index b3e33cd777f..2799d1c9ccb 100644
--- a/crates/router/src/db/ephemeral_key.rs
+++ b/crates/router/src/db/ephemeral_key.rs
@@ -3,7 +3,7 @@ use common_utils::id_type;
 use time::ext::NumericalDuration;
 
 #[cfg(feature = "v2")]
-use crate::types::storage::ephemeral_key::{EphemeralKeyType, EphemeralKeyTypeNew, ResourceType};
+use crate::types::storage::ephemeral_key::{ClientSecretType, ClientSecretTypeNew};
 use crate::{
     core::errors::{self, CustomResult},
     db::MockDb,
@@ -19,36 +19,39 @@ pub trait EphemeralKeyInterface {
         _validity: i64,
     ) -> CustomResult<EphemeralKey, errors::StorageError>;
 
-    #[cfg(feature = "v2")]
-    async fn create_ephemeral_key(
-        &self,
-        _ek: EphemeralKeyTypeNew,
-        _validity: i64,
-    ) -> CustomResult<EphemeralKeyType, errors::StorageError>;
-
     #[cfg(feature = "v1")]
     async fn get_ephemeral_key(
         &self,
         _key: &str,
     ) -> CustomResult<EphemeralKey, errors::StorageError>;
 
-    #[cfg(feature = "v2")]
-    async fn get_ephemeral_key(
-        &self,
-        _key: &str,
-    ) -> CustomResult<EphemeralKeyType, errors::StorageError>;
-
     #[cfg(feature = "v1")]
     async fn delete_ephemeral_key(
         &self,
         _id: &str,
     ) -> CustomResult<EphemeralKey, errors::StorageError>;
+}
 
+#[async_trait::async_trait]
+pub trait ClientSecretInterface {
     #[cfg(feature = "v2")]
-    async fn delete_ephemeral_key(
+    async fn create_client_secret(
+        &self,
+        _ek: ClientSecretTypeNew,
+        _validity: i64,
+    ) -> CustomResult<ClientSecretType, errors::StorageError>;
+
+    #[cfg(feature = "v2")]
+    async fn get_client_secret(
+        &self,
+        _key: &str,
+    ) -> CustomResult<ClientSecretType, errors::StorageError>;
+
+    #[cfg(feature = "v2")]
+    async fn delete_client_secret(
         &self,
         _id: &str,
-    ) -> CustomResult<EphemeralKeyType, errors::StorageError>;
+    ) -> CustomResult<ClientSecretType, errors::StorageError>;
 }
 
 mod storage {
@@ -65,11 +68,9 @@ mod storage {
     use storage_impl::redis::kv_store::RedisConnInterface;
     use time::ext::NumericalDuration;
 
-    use super::EphemeralKeyInterface;
+    use super::{ClientSecretInterface, EphemeralKeyInterface};
     #[cfg(feature = "v2")]
-    use crate::types::storage::ephemeral_key::{
-        EphemeralKeyType, EphemeralKeyTypeNew, ResourceType,
-    };
+    use crate::types::storage::ephemeral_key::{ClientSecretType, ClientSecretTypeNew};
     use crate::{
         core::errors::{self, CustomResult},
         services::Store,
@@ -137,37 +138,74 @@ mod storage {
             }
         }
 
+        #[cfg(feature = "v1")]
+        #[instrument(skip_all)]
+        async fn get_ephemeral_key(
+            &self,
+            key: &str,
+        ) -> CustomResult<EphemeralKey, errors::StorageError> {
+            let key = format!("epkey_{key}");
+            self.get_redis_conn()
+                .map_err(Into::<errors::StorageError>::into)?
+                .get_hash_field_and_deserialize(&key.into(), "ephkey", "EphemeralKey")
+                .await
+                .change_context(errors::StorageError::KVError)
+        }
+
+        #[cfg(feature = "v1")]
+        async fn delete_ephemeral_key(
+            &self,
+            id: &str,
+        ) -> CustomResult<EphemeralKey, errors::StorageError> {
+            let ek = self.get_ephemeral_key(id).await?;
+
+            self.get_redis_conn()
+                .map_err(Into::<errors::StorageError>::into)?
+                .delete_key(&format!("epkey_{}", &ek.id).into())
+                .await
+                .change_context(errors::StorageError::KVError)?;
+
+            self.get_redis_conn()
+                .map_err(Into::<errors::StorageError>::into)?
+                .delete_key(&format!("epkey_{}", &ek.secret).into())
+                .await
+                .change_context(errors::StorageError::KVError)?;
+            Ok(ek)
+        }
+    }
+
+    #[async_trait::async_trait]
+    impl ClientSecretInterface for Store {
         #[cfg(feature = "v2")]
         #[instrument(skip_all)]
-        async fn create_ephemeral_key(
+        async fn create_client_secret(
             &self,
-            new: EphemeralKeyTypeNew,
+            new: ClientSecretTypeNew,
             validity: i64,
-        ) -> CustomResult<EphemeralKeyType, errors::StorageError> {
+        ) -> CustomResult<ClientSecretType, errors::StorageError> {
             let created_at = date_time::now();
             let expires = created_at.saturating_add(validity.hours());
             let id_key = new.id.generate_redis_key();
 
-            let created_ephemeral_key = EphemeralKeyType {
+            let created_client_secret = ClientSecretType {
                 id: new.id,
                 created_at,
                 expires,
-                customer_id: new.customer_id,
                 merchant_id: new.merchant_id,
                 secret: new.secret,
-                resource_type: new.resource_type,
+                resource_id: new.resource_id,
             };
-            let secret_key = created_ephemeral_key.generate_secret_key();
+            let secret_key = created_client_secret.generate_secret_key();
 
             match self
                 .get_redis_conn()
                 .map_err(Into::<errors::StorageError>::into)?
                 .serialize_and_set_multiple_hash_field_if_not_exist(
                     &[
-                        (&secret_key.as_str().into(), &created_ephemeral_key),
-                        (&id_key.as_str().into(), &created_ephemeral_key),
+                        (&secret_key.as_str().into(), &created_client_secret),
+                        (&id_key.as_str().into(), &created_client_secret),
                     ],
-                    "ephkey",
+                    "csh",
                     None,
                 )
                 .await
@@ -191,69 +229,34 @@ mod storage {
                         .set_expire_at(&id_key.into(), expire_at)
                         .await
                         .change_context(errors::StorageError::KVError)?;
-                    Ok(created_ephemeral_key)
+                    Ok(created_client_secret)
                 }
                 Err(er) => Err(er).change_context(errors::StorageError::KVError),
             }
         }
 
-        #[cfg(feature = "v1")]
-        #[instrument(skip_all)]
-        async fn get_ephemeral_key(
-            &self,
-            key: &str,
-        ) -> CustomResult<EphemeralKey, errors::StorageError> {
-            let key = format!("epkey_{key}");
-            self.get_redis_conn()
-                .map_err(Into::<errors::StorageError>::into)?
-                .get_hash_field_and_deserialize(&key.into(), "ephkey", "EphemeralKey")
-                .await
-                .change_context(errors::StorageError::KVError)
-        }
-
         #[cfg(feature = "v2")]
         #[instrument(skip_all)]
-        async fn get_ephemeral_key(
+        async fn get_client_secret(
             &self,
             key: &str,
-        ) -> CustomResult<EphemeralKeyType, errors::StorageError> {
-            let key = format!("epkey_{key}");
+        ) -> CustomResult<ClientSecretType, errors::StorageError> {
+            let key = format!("cs_{key}");
             self.get_redis_conn()
                 .map_err(Into::<errors::StorageError>::into)?
-                .get_hash_field_and_deserialize(&key.into(), "ephkey", "EphemeralKeyType")
+                .get_hash_field_and_deserialize(&key.into(), "csh", "ClientSecretType")
                 .await
                 .change_context(errors::StorageError::KVError)
         }
 
-        #[cfg(feature = "v1")]
-        async fn delete_ephemeral_key(
-            &self,
-            id: &str,
-        ) -> CustomResult<EphemeralKey, errors::StorageError> {
-            let ek = self.get_ephemeral_key(id).await?;
-
-            self.get_redis_conn()
-                .map_err(Into::<errors::StorageError>::into)?
-                .delete_key(&format!("epkey_{}", &ek.id).into())
-                .await
-                .change_context(errors::StorageError::KVError)?;
-
-            self.get_redis_conn()
-                .map_err(Into::<errors::StorageError>::into)?
-                .delete_key(&format!("epkey_{}", &ek.secret).into())
-                .await
-                .change_context(errors::StorageError::KVError)?;
-            Ok(ek)
-        }
-
         #[cfg(feature = "v2")]
-        async fn delete_ephemeral_key(
+        async fn delete_client_secret(
             &self,
             id: &str,
-        ) -> CustomResult<EphemeralKeyType, errors::StorageError> {
-            let ephemeral_key = self.get_ephemeral_key(id).await?;
-            let redis_id_key = ephemeral_key.id.generate_redis_key();
-            let secret_key = ephemeral_key.generate_secret_key();
+        ) -> CustomResult<ClientSecretType, errors::StorageError> {
+            let client_secret = self.get_client_secret(id).await?;
+            let redis_id_key = client_secret.id.generate_redis_key();
+            let secret_key = client_secret.generate_secret_key();
 
             self.get_redis_conn()
                 .map_err(Into::<errors::StorageError>::into)?
@@ -276,7 +279,7 @@ mod storage {
                     }
                     _ => err.change_context(errors::StorageError::KVError),
                 })?;
-            Ok(ephemeral_key)
+            Ok(client_secret)
         }
     }
 }
@@ -305,15 +308,6 @@ impl EphemeralKeyInterface for MockDb {
         Ok(ephemeral_key)
     }
 
-    #[cfg(feature = "v2")]
-    async fn create_ephemeral_key(
-        &self,
-        ek: EphemeralKeyTypeNew,
-        validity: i64,
-    ) -> CustomResult<EphemeralKeyType, errors::StorageError> {
-        todo!()
-    }
-
     #[cfg(feature = "v1")]
     async fn get_ephemeral_key(
         &self,
@@ -333,14 +327,6 @@ impl EphemeralKeyInterface for MockDb {
         }
     }
 
-    #[cfg(feature = "v2")]
-    async fn get_ephemeral_key(
-        &self,
-        key: &str,
-    ) -> CustomResult<EphemeralKeyType, errors::StorageError> {
-        todo!()
-    }
-
     #[cfg(feature = "v1")]
     async fn delete_ephemeral_key(
         &self,
@@ -356,12 +342,32 @@ impl EphemeralKeyInterface for MockDb {
             );
         }
     }
+}
 
+#[async_trait::async_trait]
+impl ClientSecretInterface for MockDb {
     #[cfg(feature = "v2")]
-    async fn delete_ephemeral_key(
+    async fn create_client_secret(
+        &self,
+        new: ClientSecretTypeNew,
+        validity: i64,
+    ) -> CustomResult<ClientSecretType, errors::StorageError> {
+        todo!()
+    }
+
+    #[cfg(feature = "v2")]
+    async fn get_client_secret(
+        &self,
+        key: &str,
+    ) -> CustomResult<ClientSecretType, errors::StorageError> {
+        todo!()
+    }
+
+    #[cfg(feature = "v2")]
+    async fn delete_client_secret(
         &self,
         id: &str,
-    ) -> CustomResult<EphemeralKeyType, errors::StorageError> {
+    ) -> CustomResult<ClientSecretType, errors::StorageError> {
         todo!()
     }
 }
diff --git a/crates/router/src/db/kafka_store.rs b/crates/router/src/db/kafka_store.rs
index d10465562f9..47f4b7dbf87 100644
--- a/crates/router/src/db/kafka_store.rs
+++ b/crates/router/src/db/kafka_store.rs
@@ -7,7 +7,7 @@ use common_utils::{
     types::{keymanager::KeyManagerState, theme::ThemeLineage},
 };
 #[cfg(feature = "v2")]
-use diesel_models::ephemeral_key::{EphemeralKeyType, EphemeralKeyTypeNew};
+use diesel_models::ephemeral_key::{ClientSecretType, ClientSecretTypeNew};
 use diesel_models::{
     enums,
     enums::ProcessTrackerStatus,
@@ -39,6 +39,7 @@ use time::PrimitiveDateTime;
 
 use super::{
     dashboard_metadata::DashboardMetadataInterface,
+    ephemeral_key::ClientSecretInterface,
     role::RoleInterface,
     user::{sample_data::BatchSampleDataInterface, theme::ThemeInterface, UserInterface},
     user_authentication_method::UserAuthenticationMethodInterface,
@@ -659,15 +660,6 @@ impl EphemeralKeyInterface for KafkaStore {
         self.diesel_store.create_ephemeral_key(ek, validity).await
     }
 
-    #[cfg(feature = "v2")]
-    async fn create_ephemeral_key(
-        &self,
-        ek: EphemeralKeyTypeNew,
-        validity: i64,
-    ) -> CustomResult<EphemeralKeyType, errors::StorageError> {
-        self.diesel_store.create_ephemeral_key(ek, validity).await
-    }
-
     #[cfg(feature = "v1")]
     async fn get_ephemeral_key(
         &self,
@@ -676,14 +668,6 @@ impl EphemeralKeyInterface for KafkaStore {
         self.diesel_store.get_ephemeral_key(key).await
     }
 
-    #[cfg(feature = "v2")]
-    async fn get_ephemeral_key(
-        &self,
-        key: &str,
-    ) -> CustomResult<EphemeralKeyType, errors::StorageError> {
-        self.diesel_store.get_ephemeral_key(key).await
-    }
-
     #[cfg(feature = "v1")]
     async fn delete_ephemeral_key(
         &self,
@@ -691,13 +675,33 @@ impl EphemeralKeyInterface for KafkaStore {
     ) -> CustomResult<EphemeralKey, errors::StorageError> {
         self.diesel_store.delete_ephemeral_key(id).await
     }
+}
 
+#[async_trait::async_trait]
+impl ClientSecretInterface for KafkaStore {
     #[cfg(feature = "v2")]
-    async fn delete_ephemeral_key(
+    async fn create_client_secret(
+        &self,
+        ek: ClientSecretTypeNew,
+        validity: i64,
+    ) -> CustomResult<ClientSecretType, errors::StorageError> {
+        self.diesel_store.create_client_secret(ek, validity).await
+    }
+
+    #[cfg(feature = "v2")]
+    async fn get_client_secret(
+        &self,
+        key: &str,
+    ) -> CustomResult<ClientSecretType, errors::StorageError> {
+        self.diesel_store.get_client_secret(key).await
+    }
+
+    #[cfg(feature = "v2")]
+    async fn delete_client_secret(
         &self,
         id: &str,
-    ) -> CustomResult<EphemeralKeyType, errors::StorageError> {
-        self.diesel_store.delete_ephemeral_key(id).await
+    ) -> CustomResult<ClientSecretType, errors::StorageError> {
+        self.diesel_store.delete_client_secret(id).await
     }
 }
 
diff --git a/crates/router/src/lib.rs b/crates/router/src/lib.rs
index b1eb6e239f2..9b43d7f2b16 100644
--- a/crates/router/src/lib.rs
+++ b/crates/router/src/lib.rs
@@ -90,8 +90,8 @@ pub mod headers {
     pub const X_REDIRECT_URI: &str = "x-redirect-uri";
     pub const X_TENANT_ID: &str = "x-tenant-id";
     pub const X_CLIENT_SECRET: &str = "X-Client-Secret";
+    pub const X_CUSTOMER_ID: &str = "X-Customer-Id";
     pub const X_CONNECTED_MERCHANT_ID: &str = "x-connected-merchant-id";
-    pub const X_RESOURCE_TYPE: &str = "X-Resource-Type";
 }
 
 pub mod pii {
diff --git a/crates/router/src/routes/app.rs b/crates/router/src/routes/app.rs
index 0a413ae021e..ef6564c55e3 100644
--- a/crates/router/src/routes/app.rs
+++ b/crates/router/src/routes/app.rs
@@ -1166,10 +1166,6 @@ impl PaymentMethods {
                 .service(web::resource("/list-enabled-payment-methods").route(
                     web::get().to(payment_methods::payment_method_session_list_payment_methods),
                 ))
-                .service(
-                    web::resource("/confirm-intent")
-                        .route(web::post().to(payment_methods::confirm_payment_method_intent_api)),
-                )
                 .service(
                     web::resource("/update-saved-payment-method")
                         .route(web::put().to(payment_methods::payment_method_update_api)),
@@ -1497,10 +1493,10 @@ impl EphemeralKey {
 #[cfg(feature = "v2")]
 impl EphemeralKey {
     pub fn server(config: AppState) -> Scope {
-        web::scope("/v2/ephemeral-keys")
+        web::scope("/v2/client-secret")
             .app_data(web::Data::new(config))
-            .service(web::resource("").route(web::post().to(ephemeral_key_create)))
-            .service(web::resource("/{id}").route(web::delete().to(ephemeral_key_delete)))
+            .service(web::resource("").route(web::post().to(client_secret_create)))
+            .service(web::resource("/{id}").route(web::delete().to(client_secret_delete)))
     }
 }
 
diff --git a/crates/router/src/routes/customers.rs b/crates/router/src/routes/customers.rs
index 09b6983d2a7..67088316799 100644
--- a/crates/router/src/routes/customers.rs
+++ b/crates/router/src/routes/customers.rs
@@ -85,19 +85,25 @@ pub async fn customers_retrieve(
     req: HttpRequest,
     path: web::Path<id_type::GlobalCustomerId>,
 ) -> HttpResponse {
+    use crate::services::authentication::V2Auth;
+
     let flow = Flow::CustomersRetrieve;
 
     let id = path.into_inner();
 
-    let auth = if auth::is_jwt_auth(req.headers()) {
+    let auth: Box<
+        dyn auth::AuthenticateAndFetch<auth::AuthenticationData, crate::routes::SessionState>
+            + Send
+            + Sync,
+    > = if auth::is_jwt_auth(req.headers()) {
         Box::new(auth::JWTAuth {
             permission: Permission::MerchantCustomerRead,
         })
     } else {
-        match auth::is_ephemeral_auth(req.headers()) {
-            Ok(auth) => auth,
-            Err(err) => return api::log_and_return_error_response(err),
-        }
+        Box::new(vec![
+            V2Auth::ApiKeyAuth,
+            V2Auth::ClientAuth(diesel_models::ResourceId::Customer(id.clone())),
+        ])
     };
 
     Box::pin(api::server_wrap(
diff --git a/crates/router/src/routes/ephemeral_key.rs b/crates/router/src/routes/ephemeral_key.rs
index 0330482e81a..1986106a08e 100644
--- a/crates/router/src/routes/ephemeral_key.rs
+++ b/crates/router/src/routes/ephemeral_key.rs
@@ -36,10 +36,10 @@ pub async fn ephemeral_key_create(
 
 #[cfg(feature = "v2")]
 #[instrument(skip_all, fields(flow = ?Flow::EphemeralKeyCreate))]
-pub async fn ephemeral_key_create(
+pub async fn client_secret_create(
     state: web::Data<AppState>,
     req: HttpRequest,
-    json_payload: web::Json<api_models::ephemeral_key::EphemeralKeyCreateRequest>,
+    json_payload: web::Json<api_models::ephemeral_key::ClientSecretCreateRequest>,
 ) -> HttpResponse {
     let flow = Flow::EphemeralKeyCreate;
     let payload = json_payload.into_inner();
@@ -49,9 +49,9 @@ pub async fn ephemeral_key_create(
         &req,
         payload,
         |state, auth: auth::AuthenticationData, payload, _| {
-            helpers::make_ephemeral_key(
+            helpers::make_client_secret(
                 state,
-                payload.customer_id.to_owned(),
+                payload.resource_id.to_owned(),
                 auth.merchant_account,
                 auth.key_store,
                 req.headers(),
@@ -64,7 +64,7 @@ pub async fn ephemeral_key_create(
 }
 
 #[instrument(skip_all, fields(flow = ?Flow::EphemeralKeyDelete))]
-pub async fn ephemeral_key_delete(
+pub async fn client_secret_delete(
     state: web::Data<AppState>,
     req: HttpRequest,
     path: web::Path<String>,
@@ -76,7 +76,7 @@ pub async fn ephemeral_key_delete(
         state,
         &req,
         payload,
-        |state, _: auth::AuthenticationData, req, _| helpers::delete_ephemeral_key(state, req),
+        |state, _: auth::AuthenticationData, req, _| helpers::delete_client_secret(state, req),
         &auth::HeaderAuth(auth::ApiKeyAuth),
         api_locking::LockAction::NotApplicable,
     )
diff --git a/crates/router/src/routes/payment_methods.rs b/crates/router/src/routes/payment_methods.rs
index 26f0e64763a..b1b9d689261 100644
--- a/crates/router/src/routes/payment_methods.rs
+++ b/crates/router/src/routes/payment_methods.rs
@@ -117,7 +117,7 @@ pub async fn create_payment_method_intent_api(
             ))
             .await
         },
-        &auth::HeaderAuth(auth::ApiKeyAuth),
+        &auth::V2Auth::ApiKeyAuth,
         api_locking::LockAction::NotApplicable,
     ))
     .await
@@ -149,52 +149,6 @@ impl common_utils::events::ApiEventMetric for PaymentMethodIntentConfirmInternal
     }
 }
 
-#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
-#[instrument(skip_all, fields(flow = ?Flow::PaymentMethodsCreate))]
-pub async fn confirm_payment_method_intent_api(
-    state: web::Data<AppState>,
-    req: HttpRequest,
-    json_payload: web::Json<payment_methods::PaymentMethodIntentConfirm>,
-    path: web::Path<id_type::GlobalPaymentMethodId>,
-) -> HttpResponse {
-    let flow = Flow::PaymentMethodsCreate;
-    let pm_id = path.into_inner();
-    let payload = json_payload.into_inner();
-
-    let auth = match auth::is_ephemeral_or_publishible_auth(req.headers()) {
-        Ok(auth) => auth,
-        Err(e) => return api::log_and_return_error_response(e),
-    };
-
-    let inner_payload = PaymentMethodIntentConfirmInternal {
-        id: pm_id.to_owned(),
-        request: payload,
-    };
-
-    Box::pin(api::server_wrap(
-        flow,
-        state,
-        &req,
-        inner_payload,
-        |state, auth: auth::AuthenticationData, req, _| {
-            let pm_id = pm_id.clone();
-            async move {
-                Box::pin(payment_methods_routes::payment_method_intent_confirm(
-                    &state,
-                    req.request,
-                    &auth.merchant_account,
-                    &auth.key_store,
-                    pm_id,
-                ))
-                .await
-            }
-        },
-        &*auth,
-        api_locking::LockAction::NotApplicable,
-    ))
-    .await
-}
-
 #[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
 #[instrument(skip_all, fields(flow = ?Flow::PaymentMethodsUpdate))]
 pub async fn payment_method_update_api(
@@ -207,11 +161,6 @@ pub async fn payment_method_update_api(
     let payment_method_id = path.into_inner();
     let payload = json_payload.into_inner();
 
-    let auth = match auth::is_ephemeral_or_publishible_auth(req.headers()) {
-        Ok(auth) => auth,
-        Err(e) => return api::log_and_return_error_response(e),
-    };
-
     Box::pin(api::server_wrap(
         flow,
         state,
@@ -226,7 +175,7 @@ pub async fn payment_method_update_api(
                 &payment_method_id,
             )
         },
-        &*auth,
+        &auth::V2Auth::ApiKeyAuth,
         api_locking::LockAction::NotApplicable,
     ))
     .await
@@ -948,11 +897,6 @@ pub async fn payment_methods_session_create(
     let flow = Flow::PaymentMethodSessionCreate;
     let payload = json_payload.into_inner();
 
-    let ephemeral_auth = match auth::is_ephemeral_auth(req.headers()) {
-        Ok(auth) => auth,
-        Err(err) => return api::log_and_return_error_response(err),
-    };
-
     Box::pin(api::server_wrap(
         flow,
         state,
@@ -967,7 +911,7 @@ pub async fn payment_methods_session_create(
             )
             .await
         },
-        &*ephemeral_auth,
+        &auth::V2Auth::ApiKeyAuth,
         api_locking::LockAction::NotApplicable,
     ))
     .await
@@ -983,16 +927,11 @@ pub async fn payment_methods_session_retrieve(
     let flow = Flow::PaymentMethodSessionRetrieve;
     let payment_method_session_id = path.into_inner();
 
-    let ephemeral_auth = match auth::is_ephemeral_auth(req.headers()) {
-        Ok(auth) => auth,
-        Err(err) => return api::log_and_return_error_response(err),
-    };
-
     Box::pin(api::server_wrap(
         flow,
         state,
         &req,
-        payment_method_session_id,
+        payment_method_session_id.clone(),
         |state, auth: auth::AuthenticationData, payment_method_session_id, _| async move {
             payment_methods_routes::payment_methods_session_retrieve(
                 state,
@@ -1002,7 +941,12 @@ pub async fn payment_methods_session_retrieve(
             )
             .await
         },
-        &*ephemeral_auth,
+        &vec![
+            auth::V2Auth::ApiKeyAuth,
+            auth::V2Auth::ClientAuth(diesel_models::ResourceId::PaymentMethodSession(
+                payment_method_session_id,
+            )),
+        ],
         api_locking::LockAction::NotApplicable,
     ))
     .await
@@ -1018,16 +962,11 @@ pub async fn payment_method_session_list_payment_methods(
     let flow = Flow::PaymentMethodsList;
     let payment_method_session_id = path.into_inner();
 
-    let auth = match auth::is_ephemeral_or_publishible_auth(req.headers()) {
-        Ok(auth) => auth,
-        Err(e) => return api::log_and_return_error_response(e),
-    };
-
     Box::pin(api::server_wrap(
         flow,
         state,
         &req,
-        payment_method_session_id,
+        payment_method_session_id.clone(),
         |state, auth: auth::AuthenticationData, payment_method_session_id, _| {
             payment_methods_routes::list_payment_methods_for_session(
                 state,
@@ -1037,7 +976,9 @@ pub async fn payment_method_session_list_payment_methods(
                 payment_method_session_id,
             )
         },
-        &*auth,
+        &auth::V2Auth::ClientAuth(diesel_models::ResourceId::PaymentMethodSession(
+            payment_method_session_id,
+        )),
         api_locking::LockAction::NotApplicable,
     ))
     .await
@@ -1076,11 +1017,6 @@ pub async fn payment_method_session_update_saved_payment_method(
     let payload = json_payload.into_inner();
     let payment_method_session_id = path.into_inner();
 
-    let auth = match auth::is_ephemeral_or_publishible_auth(req.headers()) {
-        Ok(auth) => auth,
-        Err(e) => return api::log_and_return_error_response(e),
-    };
-
     let request = PaymentMethodsSessionGenericRequest {
         payment_method_session_id: payment_method_session_id.clone(),
         request: payload,
@@ -1100,7 +1036,9 @@ pub async fn payment_method_session_update_saved_payment_method(
                 request.request,
             )
         },
-        &*auth,
+        &auth::V2Auth::ClientAuth(diesel_models::ResourceId::PaymentMethodSession(
+            payment_method_session_id,
+        )),
         api_locking::LockAction::NotApplicable,
     ))
     .await
diff --git a/crates/router/src/services/authentication.rs b/crates/router/src/services/authentication.rs
index 99800b55512..d270005a058 100644
--- a/crates/router/src/services/authentication.rs
+++ b/crates/router/src/services/authentication.rs
@@ -20,6 +20,8 @@ use common_utils::{date_time, id_type};
 use diesel_models::ephemeral_key;
 use error_stack::{report, ResultExt};
 use jsonwebtoken::{decode, Algorithm, DecodingKey, Validation};
+#[cfg(feature = "v2")]
+use masking::ExposeInterface;
 use masking::PeekInterface;
 use router_env::logger;
 use serde::Serialize;
@@ -1286,6 +1288,18 @@ impl<'a> HeaderMapStruct<'a> {
             })
     }
 
+    #[cfg(feature = "v2")]
+    pub fn get_auth_string_from_header(&self) -> RouterResult<&str> {
+        self.headers
+            .get(headers::AUTHORIZATION)
+            .get_required_value(headers::AUTHORIZATION)?
+            .to_str()
+            .change_context(errors::ApiErrorResponse::InvalidDataValue {
+                field_name: headers::AUTHORIZATION,
+            })
+            .attach_printable("Failed to convert authorization header to string")
+    }
+
     pub fn get_id_type_from_header_if_present<T>(&self, key: &str) -> RouterResult<Option<T>>
     where
         T: TryFrom<
@@ -1510,44 +1524,6 @@ where
     }
 }
 
-#[cfg(feature = "v2")]
-#[async_trait]
-impl<A> AuthenticateAndFetch<AuthenticationData, A> for EphemeralKeyAuth
-where
-    A: SessionStateInfo + Sync,
-{
-    async fn authenticate_and_fetch(
-        &self,
-        request_headers: &HeaderMap,
-        state: &A,
-    ) -> RouterResult<(AuthenticationData, AuthenticationType)> {
-        let api_key =
-            get_api_key(request_headers).change_context(errors::ApiErrorResponse::Unauthorized)?;
-        let ephemeral_key = state
-            .store()
-            .get_ephemeral_key(api_key)
-            .await
-            .change_context(errors::ApiErrorResponse::Unauthorized)?;
-
-        let resource_type = HeaderMapStruct::new(request_headers)
-            .get_mandatory_header_value_by_key(headers::X_RESOURCE_TYPE)
-            .and_then(|val| {
-                ephemeral_key::ResourceType::from_str(val).change_context(
-                    errors::ApiErrorResponse::InvalidRequestData {
-                        message: format!("`{}` header is invalid", headers::X_RESOURCE_TYPE),
-                    },
-                )
-            })?;
-
-        fp_utils::when(resource_type != ephemeral_key.resource_type, || {
-            Err(errors::ApiErrorResponse::Unauthorized)
-        })?;
-
-        MerchantIdAuth(ephemeral_key.merchant_id)
-            .authenticate_and_fetch(request_headers, state)
-            .await
-    }
-}
 #[derive(Debug)]
 pub struct MerchantIdAuth(pub id_type::MerchantId);
 
@@ -1778,6 +1754,267 @@ where
     }
 }
 
+#[derive(Debug)]
+#[cfg(feature = "v2")]
+pub enum V2Auth {
+    ApiKeyAuth,                            // API Key
+    ClientAuth(diesel_models::ResourceId), // Publishable Key + Client Secret
+    DashboardAuth,                         // JWT
+}
+
+#[cfg(feature = "v2")]
+#[async_trait]
+impl<A> AuthenticateAndFetch<AuthenticationData, A> for V2Auth
+where
+    A: SessionStateInfo + Sync,
+{
+    async fn authenticate_and_fetch(
+        &self,
+        request_headers: &HeaderMap,
+        state: &A,
+    ) -> RouterResult<(AuthenticationData, AuthenticationType)> {
+        let auth_string = request_headers
+            .get(headers::AUTHORIZATION)
+            .get_required_value(headers::AUTHORIZATION)?
+            .to_str()
+            .change_context(errors::ApiErrorResponse::InvalidDataValue {
+                field_name: headers::AUTHORIZATION,
+            })
+            .attach_printable("Failed to convert authorization header to string")?
+            .to_owned();
+
+        match self {
+            Self::ApiKeyAuth => {
+                let api_key = auth_string
+                    .split(',')
+                    .find_map(|part| part.trim().strip_prefix("api-key="))
+                    .ok_or_else(|| {
+                        report!(errors::ApiErrorResponse::Unauthorized)
+                            .attach_printable("Unable to parse api_key")
+                    })?;
+                if api_key.is_empty() {
+                    return Err(errors::ApiErrorResponse::Unauthorized)
+                        .attach_printable("API key is empty");
+                }
+
+                let profile_id = HeaderMapStruct::new(request_headers)
+                    .get_id_type_from_header::<id_type::ProfileId>(headers::X_PROFILE_ID)?;
+
+                let api_key = api_keys::PlaintextApiKey::from(api_key);
+                let hash_key = {
+                    let config = state.conf();
+                    config.api_keys.get_inner().get_hash_key()?
+                };
+                let hashed_api_key = api_key.keyed_hash(hash_key.peek());
+
+                let stored_api_key = state
+                    .store()
+                    .find_api_key_by_hash_optional(hashed_api_key.into())
+                    .await
+                    .change_context(errors::ApiErrorResponse::InternalServerError) // If retrieve failed
+                    .attach_printable("Failed to retrieve API key")?
+                    .ok_or(report!(errors::ApiErrorResponse::Unauthorized)) // If retrieve returned `None`
+                    .attach_printable("Merchant not authenticated")?;
+
+                if stored_api_key
+                    .expires_at
+                    .map(|expires_at| expires_at < date_time::now())
+                    .unwrap_or(false)
+                {
+                    return Err(report!(errors::ApiErrorResponse::Unauthorized))
+                        .attach_printable("API key has expired");
+                }
+
+                let key_manager_state = &(&state.session_state()).into();
+
+                let key_store = state
+                    .store()
+                    .get_merchant_key_store_by_merchant_id(
+                        key_manager_state,
+                        &stored_api_key.merchant_id,
+                        &state.store().get_master_key().to_vec().into(),
+                    )
+                    .await
+                    .change_context(errors::ApiErrorResponse::Unauthorized)
+                    .attach_printable("Failed to fetch merchant key store for the merchant id")?;
+
+                let merchant = state
+                    .store()
+                    .find_merchant_account_by_merchant_id(
+                        key_manager_state,
+                        &stored_api_key.merchant_id,
+                        &key_store,
+                    )
+                    .await
+                    .to_not_found_response(errors::ApiErrorResponse::Unauthorized)?;
+
+                // Get connected merchant account if API call is done by Platform merchant account on behalf of connected merchant account
+                let (merchant, platform_merchant_account) = if state.conf().platform.enabled {
+                    get_platform_merchant_account(state, request_headers, merchant).await?
+                } else {
+                    (merchant, None)
+                };
+
+                let key_store = if platform_merchant_account.is_some() {
+                    state
+                        .store()
+                        .get_merchant_key_store_by_merchant_id(
+                            key_manager_state,
+                            merchant.get_id(),
+                            &state.store().get_master_key().to_vec().into(),
+                        )
+                        .await
+                        .change_context(errors::ApiErrorResponse::Unauthorized)
+                        .attach_printable(
+                            "Failed to fetch merchant key store for the merchant id",
+                        )?
+                } else {
+                    key_store
+                };
+
+                let profile = state
+                    .store()
+                    .find_business_profile_by_profile_id(key_manager_state, &key_store, &profile_id)
+                    .await
+                    .to_not_found_response(errors::ApiErrorResponse::Unauthorized)?;
+
+                let auth = AuthenticationData {
+                    merchant_account: merchant,
+                    platform_merchant_account,
+                    key_store,
+                    profile,
+                };
+                Ok((
+                    auth.clone(),
+                    AuthenticationType::ApiKey {
+                        merchant_id: auth.merchant_account.get_id().clone(),
+                        key_id: stored_api_key.key_id,
+                    },
+                ))
+            }
+            Self::ClientAuth(resource_id) => {
+                let publishable_key = auth_string
+                    .split(',')
+                    .find_map(|part| part.trim().strip_prefix("publishable-key="))
+                    .ok_or_else(|| {
+                        report!(errors::ApiErrorResponse::Unauthorized)
+                            .attach_printable("Unable to parse publishable_key")
+                    })?;
+
+                let client_secret = auth_string
+                    .split(',')
+                    .find_map(|part| part.trim().strip_prefix("client-secret="))
+                    .ok_or_else(|| {
+                        report!(errors::ApiErrorResponse::Unauthorized)
+                            .attach_printable("Unable to parse client_secret")
+                    })?;
+
+                let key_manager_state: &common_utils::types::keymanager::KeyManagerState =
+                    &(&state.session_state()).into();
+
+                let db_client_secret: diesel_models::ClientSecretType = state
+                    .store()
+                    .get_client_secret(client_secret)
+                    .await
+                    .change_context(errors::ApiErrorResponse::Unauthorized)
+                    .attach_printable("Invalid ephemeral_key")?;
+
+                let profile_id = get_id_type_by_key_from_headers(
+                    headers::X_PROFILE_ID.to_string(),
+                    request_headers,
+                )?
+                .get_required_value(headers::X_PROFILE_ID)?;
+
+                match db_client_secret.resource_id {
+                    diesel_models::ResourceId::Payment(global_payment_id) => todo!(),
+                    diesel_models::ResourceId::Customer(global_customer_id) => {
+                        if global_customer_id.get_string_repr() != resource_id.to_str() {
+                            return Err(errors::ApiErrorResponse::Unauthorized.into());
+                        }
+                    }
+                    diesel_models::ResourceId::PaymentMethodSession(
+                        global_payment_method_session_id,
+                    ) => {
+                        if global_payment_method_session_id.get_string_repr()
+                            != resource_id.to_str()
+                        {
+                            return Err(errors::ApiErrorResponse::Unauthorized.into());
+                        }
+                    }
+                };
+
+                let (merchant_account, key_store) = state
+                    .store()
+                    .find_merchant_account_by_publishable_key(key_manager_state, publishable_key)
+                    .await
+                    .to_not_found_response(errors::ApiErrorResponse::Unauthorized)?;
+                let merchant_id = merchant_account.get_id().clone();
+
+                if db_client_secret.merchant_id != merchant_id {
+                    return Err(errors::ApiErrorResponse::Unauthorized.into());
+                }
+                let profile = state
+                    .store()
+                    .find_business_profile_by_merchant_id_profile_id(
+                        key_manager_state,
+                        &key_store,
+                        &merchant_id,
+                        &profile_id,
+                    )
+                    .await
+                    .to_not_found_response(errors::ApiErrorResponse::Unauthorized)?;
+                Ok((
+                    AuthenticationData {
+                        merchant_account,
+                        key_store,
+                        profile,
+                        platform_merchant_account: None,
+                    },
+                    AuthenticationType::PublishableKey { merchant_id },
+                ))
+            }
+            Self::DashboardAuth => Err(errors::ApiErrorResponse::Unauthorized.into()),
+        }
+    }
+}
+
+#[cfg(feature = "v2")]
+#[async_trait]
+impl<A> AuthenticateAndFetch<AuthenticationData, A> for Vec<V2Auth>
+where
+    A: SessionStateInfo + Sync,
+{
+    async fn authenticate_and_fetch(
+        &self,
+        request_headers: &HeaderMap,
+        state: &A,
+    ) -> RouterResult<(AuthenticationData, AuthenticationType)> {
+        let header_map_struct = HeaderMapStruct::new(request_headers);
+        let auth_string = header_map_struct.get_auth_string_from_header()?;
+
+        match auth_string.trim() {
+            s if s.starts_with("api-key=") => {
+                if let Some(handler) = self.iter().find(|auth| matches!(auth, V2Auth::ApiKeyAuth)) {
+                    handler.authenticate_and_fetch(request_headers, state).await
+                } else {
+                    Err(errors::ApiErrorResponse::Unauthorized.into())
+                }
+            }
+            s if s.starts_with("publishable-key=") || s.starts_with("client-secret=") => {
+                if let Some(handler) = self
+                    .iter()
+                    .find(|auth| matches!(auth, V2Auth::ClientAuth(_)))
+                {
+                    handler.authenticate_and_fetch(request_headers, state).await
+                } else {
+                    Err(errors::ApiErrorResponse::Unauthorized.into())
+                }
+            }
+            _ => Err(errors::ApiErrorResponse::Unauthorized.into()),
+        }
+    }
+}
+
 #[derive(Debug)]
 pub struct PublishableKeyAuth;
 
@@ -3282,20 +3519,7 @@ where
     }
 }
 
-pub fn is_ephemeral_or_publishible_auth<A: SessionStateInfo + Sync + Send>(
-    headers: &HeaderMap,
-) -> RouterResult<Box<dyn AuthenticateAndFetch<AuthenticationData, A>>> {
-    let api_key = get_api_key(headers)?;
-
-    if api_key.starts_with("epk") {
-        Ok(Box::new(EphemeralKeyAuth))
-    } else if api_key.starts_with("pk_") {
-        Ok(Box::new(HeaderAuth(PublishableKeyAuth)))
-    } else {
-        Ok(Box::new(HeaderAuth(ApiKeyAuth)))
-    }
-}
-
+#[cfg(feature = "v1")]
 pub fn is_ephemeral_auth<A: SessionStateInfo + Sync + Send>(
     headers: &HeaderMap,
 ) -> RouterResult<Box<dyn AuthenticateAndFetch<AuthenticationData, A>>> {
diff --git a/crates/router/src/types.rs b/crates/router/src/types.rs
index 2ae2af92478..1d0cdaad3df 100644
--- a/crates/router/src/types.rs
+++ b/crates/router/src/types.rs
@@ -542,6 +542,7 @@ pub struct RedirectPaymentFlowResponse<D> {
     pub profile: domain::Profile,
 }
 
+#[cfg(feature = "v1")]
 #[derive(Clone, Debug)]
 pub struct AuthenticatePaymentFlowResponse {
     pub payments_response: api_models::payments::PaymentsResponse,
diff --git a/crates/router/src/types/api/payments.rs b/crates/router/src/types/api/payments.rs
index 6ec0fe701e9..2c5b07359c8 100644
--- a/crates/router/src/types/api/payments.rs
+++ b/crates/router/src/types/api/payments.rs
@@ -1,5 +1,7 @@
 #[cfg(feature = "v1")]
 pub use api_models::payments::PaymentsRequest;
+#[cfg(feature = "v1")]
+pub use api_models::payments::{PaymentListResponse, PaymentListResponseV2, PaymentsResponse};
 #[cfg(feature = "v2")]
 pub use api_models::payments::{
     PaymentsCreateIntentRequest, PaymentsIntentResponse, PaymentsUpdateIntentRequest,
@@ -14,15 +16,15 @@ pub use api_models::{
         MandateTransactionType, MandateType, MandateValidationFields, NextActionType,
         OnlineMandate, OpenBankingSessionToken, PayLaterData, PaymentIdType,
         PaymentListConstraints, PaymentListFilterConstraints, PaymentListFilters,
-        PaymentListFiltersV2, PaymentListResponse, PaymentListResponseV2, PaymentMethodData,
-        PaymentMethodDataRequest, PaymentMethodDataResponse, PaymentOp, PaymentRetrieveBody,
+        PaymentListFiltersV2, PaymentMethodData, PaymentMethodDataRequest,
+        PaymentMethodDataResponse, PaymentOp, PaymentRetrieveBody,
         PaymentRetrieveBodyWithCredentials, PaymentsAggregateResponse, PaymentsApproveRequest,
         PaymentsCancelRequest, PaymentsCaptureRequest, PaymentsCompleteAuthorizeRequest,
         PaymentsDynamicTaxCalculationRequest, PaymentsDynamicTaxCalculationResponse,
         PaymentsExternalAuthenticationRequest, PaymentsIncrementalAuthorizationRequest,
         PaymentsManualUpdateRequest, PaymentsPostSessionTokensRequest,
         PaymentsPostSessionTokensResponse, PaymentsRedirectRequest, PaymentsRedirectionResponse,
-        PaymentsRejectRequest, PaymentsResponse, PaymentsResponseForm, PaymentsRetrieveRequest,
+        PaymentsRejectRequest, PaymentsResponseForm, PaymentsRetrieveRequest,
         PaymentsSessionRequest, PaymentsSessionResponse, PaymentsStartRequest, PgRedirectResponse,
         PhoneDetails, RedirectionResponse, SessionToken, UrlDetails, VerifyRequest, VerifyResponse,
         WalletData,
diff --git a/crates/router/src/types/storage/ephemeral_key.rs b/crates/router/src/types/storage/ephemeral_key.rs
index c4b8e2ba701..f913827e3a0 100644
--- a/crates/router/src/types/storage/ephemeral_key.rs
+++ b/crates/router/src/types/storage/ephemeral_key.rs
@@ -1,18 +1,31 @@
-pub use diesel_models::ephemeral_key::{EphemeralKey, EphemeralKeyNew};
 #[cfg(feature = "v2")]
-pub use diesel_models::ephemeral_key::{EphemeralKeyType, EphemeralKeyTypeNew, ResourceType};
+pub use diesel_models::ephemeral_key::{ClientSecretType, ClientSecretTypeNew};
+pub use diesel_models::ephemeral_key::{EphemeralKey, EphemeralKeyNew};
 
 #[cfg(feature = "v2")]
-use crate::types::transformers::ForeignFrom;
+use crate::db::errors;
+#[cfg(feature = "v2")]
+use crate::types::transformers::ForeignTryFrom;
 #[cfg(feature = "v2")]
-impl ForeignFrom<EphemeralKeyType> for api_models::ephemeral_key::EphemeralKeyResponse {
-    fn foreign_from(from: EphemeralKeyType) -> Self {
-        Self {
-            customer_id: from.customer_id,
-            created_at: from.created_at,
-            expires: from.expires,
-            secret: from.secret,
-            id: from.id,
+impl ForeignTryFrom<ClientSecretType> for api_models::ephemeral_key::ClientSecretResponse {
+    type Error = errors::ApiErrorResponse;
+    fn foreign_try_from(from: ClientSecretType) -> Result<Self, errors::ApiErrorResponse> {
+        match from.resource_id {
+            diesel_models::ResourceId::Payment(global_payment_id) => {
+                Err(errors::ApiErrorResponse::InternalServerError)
+            }
+            diesel_models::ResourceId::PaymentMethodSession(global_payment_id) => {
+                Err(errors::ApiErrorResponse::InternalServerError)
+            }
+            diesel_models::ResourceId::Customer(global_customer_id) => Ok(Self {
+                resource_id: api_models::ephemeral_key::ResourceId::Customer(
+                    global_customer_id.clone(),
+                ),
+                created_at: from.created_at,
+                expires: from.expires,
+                secret: from.secret,
+                id: from.id,
+            }),
         }
     }
 }

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

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

## Description
<!-- Describe your changes in detail -->
Added an enum `V2Auth` (name subject to change) to encapsulate different authentication scenarios. Currently only works for Client Authentication using `publishable_key` and `ephemeral_key` in `Authorization` header

### Additional Changes

- [x] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables

<!--
Provide links to the files with corresponding changes.

Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->


## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.

If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
Closes #7037 

## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->

1a. Payment method intent create request:

```bash
curl --location 'http://localhost:8080/v2/payment-methods/create-intent' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'X-Profile-Id: pro_hOlRnOdewwhXSV9l7TJJ' \
--header 'api-key: dev_XLbxcbVTqGoxcd8rVlt48b0QhbleB8ZuiqeSj2XXToUBXPDbVzeS0I5cMCaSnsYb' \
--data '{
  "customer_id": "12345_cus_0194a71908247490bbc38202cece425b"
}'
```

1b. Payment method intent create response:
```json
{
    "id": "12345_pm_0194a71929907523adbb332ddb699f0f",
    "merchant_id": "cloth_seller_a8Sp7qm2hHWJbjAuffaz",
    "customer_id": "12345_cus_0194a71908247490bbc38202cece425b",
    "payment_method_type": null,
    "payment_method_subtype": null,
    "recurring_enabled": false,
    "created": "2025-01-27T09:30:31.703Z",
    "last_used_at": "2025-01-27T09:30:31.703Z",
    "client_secret": "cs_0194a71929917da2b83fafc6c97388d1",
    "payment_method_data": null
}
```

2a. List payment methods enabled request:

```bash
curl --location 'http://localhost:8080/v2/payment-methods/12345_pm_0194a71929907523adbb332ddb699f0f/list-enabled-payment-methods' \
--header 'Content-Type: application/json' \
--header 'x-profile-id: pro_hOlRnOdewwhXSV9l7TJJ' \
--header 'Authorization: publishable-key=pk_dev_8dc540967cb24672bea6d5afed3720e4, client-secret=cs_0194a71929917da2b83fafc6c97388d1' \
--header 'x-customer-id: 12345_cus_0194a71908247490bbc38202cece425b'
```

2b. List payment methods enabled response:

```json
{
    "payment_methods_enabled": [
        {
            "payment_method_type": "card_redirect",
            "payment_method_subtype": "card_redirect",
            "required_fields": []
        },
        {
            "payment_method_type": "card",
            "payment_method_subtype": "credit",
            "required_fields": [
                {
                    "required_field": "payment_method_data.card.card_number",
                    "display_name": "card_number",
                    "field_type": "user_card_number",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_exp_year",
                    "display_name": "card_exp_year",
                    "field_type": "user_card_expiry_year",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_cvc",
                    "display_name": "card_cvc",
                    "field_type": "user_card_cvc",
                    "value": null
                },
                {
                    "required_field": "payment_method_data.card.card_exp_month",
                    "display_name": "card_exp_month",
                    "field_type": "user_card_expiry_month",
                    "value": null
                }
            ]
        },
        {
            "payment_method_type": "card",
            "payment_method_subtype": "debit",
            "required_fields": []
        },
        {
            "payment_method_type": "wallet",
            "payment_method_subtype": "google_pay",
            "required_fields": []
        },
        {
            "payment_method_type": "wallet",
            "payment_method_subtype": "apple_pay",
            "required_fields": []
        },
        {
            "payment_method_type": "wallet",
            "payment_method_subtype": "we_chat_pay",
            "required_fields": []
        },
        {
            "payment_method_type": "wallet",
            "payment_method_subtype": "ali_pay",
            "required_fields": []
        },
        {
            "payment_method_type": "wallet",
            "payment_method_subtype": "paypal",
            "required_fields": []
        },
        {
            "payment_method_type": "wallet",
            "payment_method_subtype": "mb_way",
            "required_fields": []
        },
        {
            "payment_method_type": "pay_later",
            "payment_method_subtype": "klarna",
            "required_fields": []
        },
        {
            "payment_method_type": "pay_later",
            "payment_method_subtype": "affirm",
            "required_fields": []
        },
        {
            "payment_method_type": "pay_later",
            "payment_method_subtype": "afterpay_clearpay",
            "required_fields": []
        },
        {
            "payment_method_type": "pay_later",
            "payment_method_subtype": "walley",
            "required_fields": []
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "giropay",
            "required_fields": []
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "ideal",
            "required_fields": []
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "eps",
            "required_fields": []
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "bancontact_card",
            "required_fields": []
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "przelewy24",
            "required_fields": []
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "sofort",
            "required_fields": []
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "blik",
            "required_fields": []
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "trustly",
            "required_fields": []
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "online_banking_finland",
            "required_fields": []
        },
        {
            "payment_method_type": "bank_redirect",
            "payment_method_subtype": "online_banking_poland",
            "required_fields": []
        },
        {
            "payment_method_type": "bank_transfer",
            "payment_method_subtype": "ach",
            "required_fields": []
        },
        {
            "payment_method_type": "bank_transfer",
            "payment_method_subtype": "sepa",
            "required_fields": []
        },
        {
            "payment_method_type": "bank_transfer",
            "payment_method_subtype": "bacs",
            "required_fields": []
        },
        {
            "payment_method_type": "bank_debit",
            "payment_method_subtype": "ach",
            "required_fields": []
        },
        {
            "payment_method_type": "bank_debit",
            "payment_method_subtype": "sepa",
            "required_fields": []
        },
        {
            "payment_method_type": "bank_debit",
            "payment_method_subtype": "bacs",
            "required_fields": []
        },
        {
            "payment_method_type": "bank_debit",
            "payment_method_subtype": "becs",
            "required_fields": []
        }
    ]
}
```

## Checklist
<!-- Put an `x` in the boxes that apply -->

- [x] I formatted the code `cargo +nightly fmt --all`
- [ ] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
