Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
chore(openapi): resolve openapi semantic inconsistency (#8099)
Sakil Mostakfa4b552a329b
diff --git a/api-reference/openapi_spec.json b/api-reference/openapi_spec.jsonindex c4bf23abfa..d57c3f55f2 100644--- a/api-reference/openapi_spec.json+++ b/api-reference/openapi_spec.json@@ -312,18 +312,48 @@"schema": {"type": "string"}- }- ],- "requestBody": {- "content": {- "application/json": {- "schema": {- "$ref": "#/components/schemas/PaymentRetrieveBody"- }+ },+ {+ "name": "force_sync",+ "in": "query",+ "description": "Decider to enable or disable the connector call for retrieve request",+ "required": false,+ "schema": {+ "type": "boolean",+ "nullable": true}},- "required": true- },+ {+ "name": "client_secret",+ "in": "query",+ "description": "This is a token which expires after 15 minutes, used from the client to authenticate and create sessions from the SDK",+ "required": false,+ "schema": {+ "type": "string",+ "nullable": true+ }+ },+ {+ "name": "expand_attempts",+ "in": "query",+ "description": "If enabled provides list of attempts linked to payment intent",+ "required": false,+ "schema": {+ "type": "boolean",+ "nullable": true+ }+ },+ {+ "name": "expand_captures",+ "in": "query",+ "description": "If enabled provides list of captures linked to latest attempt",+ "required": false,+ "schema": {+ "type": "boolean",+ "nullable": true+ }+ }+ ],"responses": {"200": {"description": "Gets the payment with final status",@@ -592,91 +622,90 @@"description": "To list the *payments*","operationId": "List all Payments","parameters": [- {- "name": "customer_id",- "in": "query",- "description": "The identifier for the customer",- "required": true,- "schema": {- "type": "string"- }- },{"name": "starting_after","in": "query","description": "A cursor for use in pagination, fetch the next list after some object",- "required": true,+ "required": false,"schema": {- "type": "string"+ "type": "string",+ "nullable": true}},{"name": "ending_before","in": "query","description": "A cursor for use in pagination, fetch the previous list before some object",- "required": true,+ "required": false,"schema": {- "type": "string"+ "type": "string",+ "nullable": true}},{"name": "limit","in": "query","description": "Limit on the number of objects to return",- "required": true,+ "required": false,"schema": {"type": "integer",- "format": "int64"+ "format": "int64",+ "nullable": true}},{"name": "created","in": "query","description": "The time at which payment is created",- "required": true,+ "required": false,"schema": {"type": "string",- "format": "date-time"+ "format": "date-time",+ "nullable": true}},{"name": "created_lt","in": "query","description": "Time less than the payment created time",- "required": true,+ "required": false,"schema": {"type": "string",- "format": "date-time"+ "format": "date-time",+ "nullable": true}},{"name": "created_gt","in": "query","description": "Time greater than the payment created time",- "required": true,+ "required": false,"schema": {"type": "string",- "format": "date-time"+ "format": "date-time",+ "nullable": true}},{"name": "created_lte","in": "query","description": "Time less than or equals to the payment created time",- "required": true,+ "required": false,"schema": {"type": "string",- "format": "date-time"+ "format": "date-time",+ "nullable": true}},{"name": "created_gte","in": "query","description": "Time greater than or equals to the payment created time",- "required": true,+ "required": false,"schema": {"type": "string",- "format": "date-time"+ "format": "date-time",+ "nullable": true}}],@@ -918,6 +947,17 @@],"summary": "Payments - Post Session Tokens","operationId": "Create Post Session Tokens for a Payment",+ "parameters": [+ {+ "name": "payment_id",+ "in": "path",+ "description": "The identifier for payment",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],"requestBody": {"content": {"application/json": {@@ -957,6 +997,17 @@],"summary": "Payments - Update Metadata","operationId": "Update Metadata for a Payment",+ "parameters": [+ {+ "name": "payment_id",+ "in": "path",+ "description": "The identifier for payment",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],"requestBody": {"content": {"application/json": {@@ -1073,6 +1124,15 @@"description": "Retrieves a relay details.","operationId": "Retrieve a Relay details","parameters": [+ {+ "name": "relay_id",+ "in": "path",+ "description": "The unique identifier for the Relay",+ "required": true,+ "schema": {+ "type": "string"+ }+ },{"name": "X-Profile-Id","in": "header",@@ -1735,6 +1795,17 @@"summary": "Merchant Connector - Create","description": "Creates a new Merchant Connector for the merchant account. The connector could be a payment processor/facilitator/acquirer or a provider of specialized services like Fraud/Accounting etc.","operationId": "Create a Merchant Connector",+ "parameters": [+ {+ "name": "account_id",+ "in": "path",+ "description": "The unique identifier for the merchant account",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],"requestBody": {"content": {"application/json": {@@ -2286,6 +2357,17 @@"summary": "Mandates - Customer Mandates List","description": "Lists all the mandates for a particular customer id.","operationId": "List Mandates for a Customer",+ "parameters": [+ {+ "name": "customer_id",+ "in": "path",+ "description": "The unique identifier for the customer",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],"responses": {"200": {"description": "List of retrieved mandates for a customer",@@ -2810,7 +2892,7 @@],"summary": "List customer saved payment methods for a Payment","description": "Lists all the applicable payment methods for a particular payment tied to the `client_secret`.",- "operationId": "List all Payment Methods for a Customer",+ "operationId": "List Customer Payment Methods via Client Secret","parameters": [{"name": "client-secret",@@ -2919,7 +3001,7 @@}},"/{customer_id}/payment_methods/{payment_method_id}/default": {- "get": {+ "post": {"tags": ["Payment Methods"],@@ -9843,6 +9925,7 @@"aci","adyen","airwallex",+ "archipel","authorizedotnet","bambora","bamboraapac",@@ -15979,6 +16062,24 @@}}},+ {+ "type": "object",+ "required": [+ "popup_url",+ "type"+ ],+ "properties": {+ "popup_url": {+ "type": "string"+ },+ "type": {+ "type": "string",+ "enum": [+ "redirect_inside_popup"+ ]+ }+ }+ },{"type": "object","description": "Informs the next steps for bank transfer and also contains the charges details (ex: amount received, amount charged etc)",@@ -16209,7 +16310,8 @@"trigger_api","display_bank_transfer_information","display_wait_screen",- "collect_otp"+ "collect_otp",+ "redirect_inside_popup"]},"NoThirdPartySdkSessionResponse": {@@ -16514,6 +16616,9 @@},"OrganizationUpdateRequest": {"type": "object",+ "required": [+ "platform_merchant_id"+ ],"properties": {"organization_name": {"type": "string",@@ -16531,12 +16636,8 @@"nullable": true},"platform_merchant_id": {- "allOf": [- {- "$ref": "#/components/schemas/id_type.MerchantId"- }- ],- "nullable": true+ "type": "string",+ "description": "Platform merchant id is unique distiguisher for special merchant in the platform org"}},"additionalProperties": false@@ -19360,6 +19461,11 @@],"nullable": true},+ "is_iframe_redirection_enabled": {+ "type": "boolean",+ "description": "Indicates if the redirection has to open in the iframe",+ "nullable": true+ },"all_keys_required": {"type": "boolean","description": "If enabled, provides whole connector response",@@ -19778,6 +19884,11 @@],"nullable": true},+ "is_iframe_redirection_enabled": {+ "type": "boolean",+ "description": "Indicates if the redirection has to open in the iframe",+ "nullable": true+ },"all_keys_required": {"type": "boolean","description": "If enabled, provides whole connector response",@@ -20361,6 +20472,11 @@"description": "Error message received from the issuer in case of failed payments","nullable": true},+ "is_iframe_redirection_enabled": {+ "type": "boolean",+ "description": "Indicates if the redirection has to open in the iframe",+ "nullable": true+ },"whole_connector_response": {"type": "string","description": "Contains whole connector response",@@ -21069,6 +21185,11 @@],"nullable": true},+ "is_iframe_redirection_enabled": {+ "type": "boolean",+ "description": "Indicates if the redirection has to open in the iframe",+ "nullable": true+ },"all_keys_required": {"type": "boolean","description": "If enabled, provides whole connector response",@@ -21678,6 +21799,11 @@"description": "Error message received from the issuer in case of failed payments","nullable": true},+ "is_iframe_redirection_enabled": {+ "type": "boolean",+ "description": "Indicates if the redirection has to open in the iframe",+ "nullable": true+ },"whole_connector_response": {"type": "string","description": "Contains whole connector response",@@ -22229,6 +22355,11 @@],"nullable": true},+ "is_iframe_redirection_enabled": {+ "type": "boolean",+ "description": "Indicates if the redirection has to open in the iframe",+ "nullable": true+ },"all_keys_required": {"type": "boolean","description": "If enabled, provides whole connector response",@@ -24268,6 +24399,16 @@}],"nullable": true+ },+ "is_iframe_redirection_enabled": {+ "type": "boolean",+ "description": "Indicates if the redirection has to open in the iframe",+ "nullable": true+ },+ "is_pre_network_tokenization_enabled": {+ "type": "boolean",+ "description": "Indicates if pre network tokenization is enabled or not",+ "nullable": true}},"additionalProperties": false@@ -24303,7 +24444,8 @@"is_auto_retries_enabled","is_click_to_pay_enabled","is_clear_pan_retries_enabled",- "force_3ds_challenge"+ "force_3ds_challenge",+ "is_pre_network_tokenization_enabled"],"properties": {"merchant_id": {@@ -24545,6 +24687,12 @@}],"nullable": true+ },+ "is_pre_network_tokenization_enabled": {+ "type": "boolean",+ "description": "Indicates if pre network tokenization is enabled or not",+ "default": false,+ "example": false}}},@@ -25690,6 +25838,7 @@"aci","adyen","airwallex",+ "archipel","authorizedotnet","bankofamerica","billwerk",diff --git a/crates/api_models/src/organization.rs b/crates/api_models/src/organization.rsindex e7ec5d32d7..50632e66be 100644--- a/crates/api_models/src/organization.rs+++ b/crates/api_models/src/organization.rs@@ -52,6 +52,7 @@ pub struct OrganizationUpdateRequest {pub metadata: Option<pii::SecretSerdeValue>,/// Platform merchant id is unique distiguisher for special merchant in the platform org+ #[schema(value_type = String)]pub platform_merchant_id: Option<id_type::MerchantId>,}#[cfg(feature = "v1")]diff --git a/crates/openapi/src/routes/mandates.rs b/crates/openapi/src/routes/mandates.rsindex e638070637..b87affde8b 100644--- a/crates/openapi/src/routes/mandates.rs+++ b/crates/openapi/src/routes/mandates.rs@@ -66,6 +66,9 @@ pub async fn retrieve_mandates_list() {}#[utoipa::path(post,path = "/customers/{customer_id}/mandates",+ params(+ ("customer_id" = String, Path, description = "The unique identifier for the customer")+ ),responses((status = 200, description = "List of retrieved mandates for a customer", body = Vec<MandateResponse>),(status = 400, description = "Invalid Data"),diff --git a/crates/openapi/src/routes/merchant_connector_account.rs b/crates/openapi/src/routes/merchant_connector_account.rsindex 9a205abb1a..9d64e15047 100644--- a/crates/openapi/src/routes/merchant_connector_account.rs+++ b/crates/openapi/src/routes/merchant_connector_account.rs@@ -5,6 +5,9 @@#[utoipa::path(post,path = "/accounts/{account_id}/connectors",+ params(+ ("account_id" = String, Path, description = "The unique identifier for the merchant account")+ ),request_body(content = MerchantConnectorCreate,examples(diff --git a/crates/openapi/src/routes/payment_method.rs b/crates/openapi/src/routes/payment_method.rsindex 6dcf3b6775..fd16b2ee2b 100644--- a/crates/openapi/src/routes/payment_method.rs+++ b/crates/openapi/src/routes/payment_method.rs@@ -110,7 +110,7 @@ pub async fn list_customer_payment_method_api() {}(status = 404, description = "Payment Methods does not exist in records")),tag = "Payment Methods",- operation_id = "List all Payment Methods for a Customer",+ operation_id = "List Customer Payment Methods via Client Secret",security(("publishable_key" = [])))]pub async fn list_customer_payment_method_api_client() {}@@ -181,7 +181,7 @@ pub async fn payment_method_delete_api() {}////// Set the Payment Method as Default for the Customer.#[utoipa::path(- get,+ post,path = "/{customer_id}/payment_methods/{payment_method_id}/default",params (("customer_id" = String,Path, description ="The unique identifier for the Customer"),@@ -375,7 +375,7 @@ pub fn payment_method_session_create() {}#[cfg(feature = "v2")]#[utoipa::path(get,- path = "/v2/payment-method-session/:id",+ path = "/v2/payment-method-session/{id}",params (("id" = String, Path, description = "The unique identifier for the Payment Method Session"),),@@ -396,7 +396,7 @@ pub fn payment_method_session_retrieve() {}#[cfg(feature = "v2")]#[utoipa::path(get,- path = "/v2/payment-method-session/:id/list-payment-methods",+ path = "/v2/payment-method-session/{id}/list-payment-methods",params (("id" = String, Path, description = "The unique identifier for the Payment Method Session"),),@@ -416,7 +416,7 @@ pub fn payment_method_session_list_payment_methods() {}#[cfg(feature = "v2")]#[utoipa::path(put,- path = "/v2/payment-method-session/:id/update-saved-payment-method",+ path = "/v2/payment-method-session/{id}/update-saved-payment-method",params (("id" = String, Path, description = "The unique identifier for the Payment Method Session"),),@@ -450,7 +450,7 @@ pub fn payment_method_session_update_saved_payment_method() {}#[cfg(feature = "v2")]#[utoipa::path(delete,- path = "/v2/payment-method-session/:id",+ path = "/v2/payment-method-session/{id}",params (("id" = String, Path, description = "The unique identifier for the Payment Method Session"),),@@ -507,7 +507,7 @@ pub async fn tokenize_card_api() {}(status = 404, description = "Customer not found"),),tag = "Payment Methods",- operation_id = "Create card network token",+ operation_id = "Create card network token using Payment Method ID",security(("admin_api_key" = [])))]pub async fn tokenize_card_using_pm_api() {}@@ -517,7 +517,7 @@ pub async fn tokenize_card_using_pm_api() {}/// **Confirms a payment method session object with the payment method data**#[utoipa::path(post,- path = "/v2/payment-method-session/:id/confirm",+ path = "/v2/payment-method-session/{id}/confirm",params (("id" = String, Path, description = "The unique identifier for the Payment Method Session"),("X-Profile-Id" = String, Header,diff --git a/crates/openapi/src/routes/payments.rs b/crates/openapi/src/routes/payments.rsindex 63a60238d2..ee659e1f70 100644--- a/crates/openapi/src/routes/payments.rs+++ b/crates/openapi/src/routes/payments.rs@@ -219,9 +219,12 @@ pub fn payments_create() {}get,path = "/payments/{payment_id}",params(- ("payment_id" = String, Path, description = "The identifier for payment")+ ("payment_id" = String, Path, description = "The identifier for payment"),+ ("force_sync" = Option<bool>, Query, description = "Decider to enable or disable the connector call for retrieve request"),+ ("client_secret" = Option<String>, Query, description = "This is a token which expires after 15 minutes, used from the client to authenticate and create sessions from the SDK"),+ ("expand_attempts" = Option<bool>, Query, description = "If enabled provides list of attempts linked to payment intent"),+ ("expand_captures" = Option<bool>, Query, description = "If enabled provides list of captures linked to latest attempt"),),- request_body=PaymentRetrieveBody,responses((status = 200, description = "Gets the payment with final status", body = PaymentsResponse),(status = 404, description = "No payment found")@@ -415,7 +418,7 @@ pub fn payments_connector_session() {}(status = 400, description = "Missing mandatory fields")),tag = "Payments",- operation_id = "Create Session tokens for a Payment",+ operation_id = "Create V2 Session tokens for a Payment",security(("publishable_key" = [])))]pub fn payments_connector_session() {}@@ -462,15 +465,15 @@ pub fn payments_cancel() {}get,path = "/payments/list",params(- ("customer_id" = String, Query, description = "The identifier for the customer"),- ("starting_after" = String, Query, description = "A cursor for use in pagination, fetch the next list after some object"),- ("ending_before" = String, Query, description = "A cursor for use in pagination, fetch the previous list before some object"),- ("limit" = i64, Query, description = "Limit on the number of objects to return"),- ("created" = PrimitiveDateTime, Query, description = "The time at which payment is created"),- ("created_lt" = PrimitiveDateTime, Query, description = "Time less than the payment created time"),- ("created_gt" = PrimitiveDateTime, Query, description = "Time greater than the payment created time"),- ("created_lte" = PrimitiveDateTime, Query, description = "Time less than or equals to the payment created time"),- ("created_gte" = PrimitiveDateTime, Query, description = "Time greater than or equals to the payment created time")+ ("customer_id" = Option<String>, Query, description = "The identifier for the customer"),+ ("starting_after" = Option<String>, Query, description = "A cursor for use in pagination, fetch the next list after some object"),+ ("ending_before" = Option<String>, Query, description = "A cursor for use in pagination, fetch the previous list before some object"),+ ("limit" = Option<i64>, Query, description = "Limit on the number of objects to return"),+ ("created" = Option<PrimitiveDateTime>, Query, description = "The time at which payment is created"),+ ("created_lt" = Option<PrimitiveDateTime>, Query, description = "Time less than the payment created time"),+ ("created_gt" = Option<PrimitiveDateTime>, Query, description = "Time greater than the payment created time"),+ ("created_lte" = Option<PrimitiveDateTime>, Query, description = "Time less than or equals to the payment created time"),+ ("created_gte" = Option<PrimitiveDateTime>, Query, description = "Time greater than or equals to the payment created time")),responses((status = 200, description = "Successfully retrieved a payment list", body = Vec<PaymentListResponse>),@@ -587,6 +590,9 @@ pub fn payments_dynamic_tax_calculation() {}#[utoipa::path(post,path = "/payments/{payment_id}/post_session_tokens",+ params(+ ("payment_id" = String, Path, description = "The identifier for payment")+ ),request_body=PaymentsPostSessionTokensRequest,responses((status = 200, description = "Post Session Token is done", body = PaymentsPostSessionTokensResponse),@@ -603,6 +609,9 @@ pub fn payments_post_session_tokens() {}#[utoipa::path(post,path = "/payments/{payment_id}/update_metadata",+ params(+ ("payment_id" = String, Path, description = "The identifier for payment")+ ),request_body=PaymentsUpdateMetadataRequest,responses((status = 200, description = "Metadata updated successfully", body = PaymentsUpdateMetadataResponse),diff --git a/crates/openapi/src/routes/profile.rs b/crates/openapi/src/routes/profile.rsindex e2dfffa2d1..265e26f520 100644--- a/crates/openapi/src/routes/profile.rs+++ b/crates/openapi/src/routes/profile.rs@@ -368,7 +368,7 @@ pub async fn routing_retrieve_default_config() {}(status = 401, description = "Unauthorized request")),tag = "Business Profile",- operation_id = "List all Merchant Connectors",+ operation_id = "List all Merchant Connectors for Profile",security(("admin_api_key" = [])))]#[cfg(feature = "v2")]diff --git a/crates/openapi/src/routes/relay.rs b/crates/openapi/src/routes/relay.rsindex 180fed6649..dc5b56296b 100644--- a/crates/openapi/src/routes/relay.rs+++ b/crates/openapi/src/routes/relay.rs@@ -43,14 +43,11 @@ pub async fn relay() {}#[utoipa::path(get,path = "/relay/{relay_id}",- params (("id" = String, Path, description = "The unique identifier for the Relay")),+ params (("relay_id" = String, Path, description = "The unique identifier for the Relay"), ("X-Profile-Id" = String, Header, description = "Profile ID for authentication")),responses((status = 200, description = "Relay Retrieved", body = RelayResponse),(status = 404, description = "Relay details was not found")),- params(- ("X-Profile-Id" = String, Header, description = "Profile ID for authentication")- ),tag = "Relay",operation_id = "Retrieve a Relay details",security(("api_key" = []), ("ephemeral_key" = []))diff --git a/crates/router/src/routes/admin.rs b/crates/router/src/routes/admin.rsindex d7b2188269..945ce2cee4 100644--- a/crates/router/src/routes/admin.rs+++ b/crates/router/src/routes/admin.rs@@ -695,7 +695,7 @@ pub async fn connector_list((status = 401, description = "Unauthorized request")),tag = "Merchant Connector Account",- operation_id = "List all Merchant Connectors",+ operation_id = "List all Merchant Connectors Admin",security(("admin_api_key" = [])))]#[cfg(feature = "v1")]