mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 09:07:09 +08:00
chore: updated open api spec documentation for create platform account (#8692)
Co-authored-by: Gitanjli Chopra <gitanjli.chopra@Gitanjli-Chopra-DC62KJQFX6.local> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Sandeep Kumar <83278309+tsdk02@users.noreply.github.com>
This commit is contained in:
@ -44,5 +44,4 @@ npx @mintlify/scraping@latest openapi-file v1/openapi_spec_v1.json -o v1
|
|||||||
|
|
||||||
This will generate files in [api-reference](api-reference) folder. These routes should be added to the [mint.json](mint.json) file under navigation, under respective group.
|
This will generate files in [api-reference](api-reference) folder. These routes should be added to the [mint.json](mint.json) file under navigation, under respective group.
|
||||||
|
|
||||||
|
|
||||||
NOTE: For working with V2 API reference, replace every occurrence of `v1` with `v2` in above commands
|
NOTE: For working with V2 API reference, replace every occurrence of `v1` with `v2` in above commands
|
||||||
@ -146,6 +146,12 @@
|
|||||||
"v1/business-profile/business-profile--list"
|
"v1/business-profile/business-profile--list"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"group": "Platform Account",
|
||||||
|
"pages": [
|
||||||
|
"v1/platform/platform--create"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"group": "API Key",
|
"group": "API Key",
|
||||||
"pages": [
|
"pages": [
|
||||||
|
|||||||
@ -6481,6 +6481,53 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"/create_platform": {
|
||||||
|
"post": {
|
||||||
|
"tags": [
|
||||||
|
"Platform"
|
||||||
|
],
|
||||||
|
"summary": "Platform - Create",
|
||||||
|
"description": "Create a new platform account",
|
||||||
|
"operationId": "Create a Platform Account",
|
||||||
|
"requestBody": {
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/PlatformAccountCreateRequest"
|
||||||
|
},
|
||||||
|
"examples": {
|
||||||
|
"Create a platform account with organization_name": {
|
||||||
|
"value": {
|
||||||
|
"organization_name": "organization_abc"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Platform Account Created",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/PlatformAccountCreateResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"400": {
|
||||||
|
"description": "Invalid data"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"jwt_key": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"components": {
|
"components": {
|
||||||
@ -26363,6 +26410,51 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"PlatformAccountCreateRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"organization_name"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"organization_name": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "organization_abc",
|
||||||
|
"maxLength": 64
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"PlatformAccountCreateResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"org_id",
|
||||||
|
"org_type",
|
||||||
|
"merchant_id",
|
||||||
|
"merchant_account_type"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"org_id": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "org_abc",
|
||||||
|
"maxLength": 64,
|
||||||
|
"minLength": 1
|
||||||
|
},
|
||||||
|
"org_name": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "organization_abc",
|
||||||
|
"nullable": true
|
||||||
|
},
|
||||||
|
"org_type": {
|
||||||
|
"$ref": "#/components/schemas/OrganizationType"
|
||||||
|
},
|
||||||
|
"merchant_id": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "merchant_abc"
|
||||||
|
},
|
||||||
|
"merchant_account_type": {
|
||||||
|
"$ref": "#/components/schemas/MerchantAccountType"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"PollConfig": {
|
"PollConfig": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
|
|||||||
3
api-reference/v1/platform/platform--create.mdx
Normal file
3
api-reference/v1/platform/platform--create.mdx
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
openapi: post /create_platform
|
||||||
|
---
|
||||||
@ -3,6 +3,7 @@ use std::fmt::Debug;
|
|||||||
use common_enums::{EntityType, TokenPurpose};
|
use common_enums::{EntityType, TokenPurpose};
|
||||||
use common_utils::{crypto::OptionalEncryptableName, id_type, pii};
|
use common_utils::{crypto::OptionalEncryptableName, id_type, pii};
|
||||||
use masking::Secret;
|
use masking::Secret;
|
||||||
|
use utoipa::ToSchema;
|
||||||
|
|
||||||
use crate::user_role::UserStatus;
|
use crate::user_role::UserStatus;
|
||||||
pub mod dashboard_metadata;
|
pub mod dashboard_metadata;
|
||||||
@ -150,17 +151,24 @@ pub struct UserOrgMerchantCreateRequest {
|
|||||||
pub merchant_name: Secret<String>,
|
pub merchant_name: Secret<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, serde::Deserialize, serde::Serialize, Clone)]
|
#[derive(Debug, serde::Deserialize, serde::Serialize, Clone, ToSchema)]
|
||||||
pub struct PlatformAccountCreateRequest {
|
pub struct PlatformAccountCreateRequest {
|
||||||
|
#[schema(max_length = 64, value_type = String, example = "organization_abc")]
|
||||||
pub organization_name: Secret<String>,
|
pub organization_name: Secret<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, serde::Deserialize, serde::Serialize)]
|
#[derive(Debug, serde::Deserialize, serde::Serialize, ToSchema)]
|
||||||
pub struct PlatformAccountCreateResponse {
|
pub struct PlatformAccountCreateResponse {
|
||||||
|
#[schema(value_type = String, max_length = 64, min_length = 1, example = "org_abc")]
|
||||||
pub org_id: id_type::OrganizationId,
|
pub org_id: id_type::OrganizationId,
|
||||||
|
#[schema(value_type = Option<String>, example = "organization_abc")]
|
||||||
pub org_name: Option<String>,
|
pub org_name: Option<String>,
|
||||||
|
|
||||||
|
#[schema(value_type = OrganizationType, example = "standard")]
|
||||||
pub org_type: common_enums::OrganizationType,
|
pub org_type: common_enums::OrganizationType,
|
||||||
|
#[schema(value_type = String, example = "merchant_abc")]
|
||||||
pub merchant_id: id_type::MerchantId,
|
pub merchant_id: id_type::MerchantId,
|
||||||
|
#[schema(value_type = MerchantAccountType, example = "standard")]
|
||||||
pub merchant_account_type: common_enums::MerchantAccountType,
|
pub merchant_account_type: common_enums::MerchantAccountType,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -213,6 +213,9 @@ Never share your secret api keys. Keep them guarded and secure.
|
|||||||
|
|
||||||
// Routes for authentication
|
// Routes for authentication
|
||||||
routes::authentication::authentication_create,
|
routes::authentication::authentication_create,
|
||||||
|
|
||||||
|
// Routes for platform account
|
||||||
|
routes::platform::create_platform_account,
|
||||||
),
|
),
|
||||||
components(schemas(
|
components(schemas(
|
||||||
common_utils::types::MinorUnit,
|
common_utils::types::MinorUnit,
|
||||||
@ -362,8 +365,8 @@ Never share your secret api keys. Keep them guarded and secure.
|
|||||||
api_models::enums::MerchantProductType,
|
api_models::enums::MerchantProductType,
|
||||||
api_models::enums::CtpServiceProvider,
|
api_models::enums::CtpServiceProvider,
|
||||||
api_models::enums::PaymentLinkSdkLabelType,
|
api_models::enums::PaymentLinkSdkLabelType,
|
||||||
api_models::enums::PaymentLinkShowSdkTerms,
|
|
||||||
api_models::enums::OrganizationType,
|
api_models::enums::OrganizationType,
|
||||||
|
api_models::enums::PaymentLinkShowSdkTerms,
|
||||||
api_models::admin::MerchantConnectorCreate,
|
api_models::admin::MerchantConnectorCreate,
|
||||||
api_models::admin::AdditionalMerchantData,
|
api_models::admin::AdditionalMerchantData,
|
||||||
api_models::admin::ConnectorWalletDetails,
|
api_models::admin::ConnectorWalletDetails,
|
||||||
@ -806,6 +809,8 @@ Never share your secret api keys. Keep them guarded and secure.
|
|||||||
api_models::authentication::ThreeDsData,
|
api_models::authentication::ThreeDsData,
|
||||||
api_models::authentication::AuthenticationEligibilityRequest,
|
api_models::authentication::AuthenticationEligibilityRequest,
|
||||||
api_models::authentication::AuthenticationEligibilityResponse,
|
api_models::authentication::AuthenticationEligibilityResponse,
|
||||||
|
api_models::user::PlatformAccountCreateRequest,
|
||||||
|
api_models::user::PlatformAccountCreateResponse,
|
||||||
)),
|
)),
|
||||||
modifiers(&SecurityAddon)
|
modifiers(&SecurityAddon)
|
||||||
)]
|
)]
|
||||||
|
|||||||
@ -14,6 +14,7 @@ pub mod payment_link;
|
|||||||
pub mod payment_method;
|
pub mod payment_method;
|
||||||
pub mod payments;
|
pub mod payments;
|
||||||
pub mod payouts;
|
pub mod payouts;
|
||||||
|
pub mod platform;
|
||||||
pub mod poll;
|
pub mod poll;
|
||||||
pub mod profile;
|
pub mod profile;
|
||||||
pub mod profile_acquirer;
|
pub mod profile_acquirer;
|
||||||
|
|||||||
26
crates/openapi/src/routes/platform.rs
Normal file
26
crates/openapi/src/routes/platform.rs
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#[cfg(feature = "v1")]
|
||||||
|
/// Platform - Create
|
||||||
|
///
|
||||||
|
/// Create a new platform account
|
||||||
|
#[utoipa::path(
|
||||||
|
post,
|
||||||
|
path = "/create_platform",
|
||||||
|
request_body(
|
||||||
|
content = PlatformAccountCreateRequest,
|
||||||
|
examples(
|
||||||
|
(
|
||||||
|
"Create a platform account with organization_name" = (
|
||||||
|
value = json!({"organization_name": "organization_abc"})
|
||||||
|
)
|
||||||
|
),
|
||||||
|
)
|
||||||
|
),
|
||||||
|
responses(
|
||||||
|
(status = 200, description = "Platform Account Created", body = PlatformAccountCreateResponse),
|
||||||
|
(status = 400, description = "Invalid data")
|
||||||
|
),
|
||||||
|
tag = "Platform",
|
||||||
|
operation_id = "Create a Platform Account",
|
||||||
|
security(("jwt_key" = []))
|
||||||
|
)]
|
||||||
|
pub async fn create_platform_account() {}
|
||||||
Reference in New Issue
Block a user