Skip to content

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

chore: update org retrieve api response to include org type (#8660)

Gitanjlia75af8b3e6ae
diff --git a/api-reference/v1/openapi_spec_v1.json b/api-reference/v1/openapi_spec_v1.json
index 9239142f57..96b8f60def 100644
--- a/api-reference/v1/openapi_spec_v1.json
+++ b/api-reference/v1/openapi_spec_v1.json
@@ -18423,9 +18423,24 @@
"created_at": {
"type": "string",
"format": "date-time"
+ },
+ "organization_type": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OrganizationType"
+ }
+ ],
+ "nullable": true
}
}
},
+ "OrganizationType": {
+ "type": "string",
+ "enum": [
+ "standard",
+ "platform"
+ ]
+ },
"OrganizationUpdateRequest": {
"type": "object",
"required": [
diff --git a/api-reference/v2/openapi_spec_v2.json b/api-reference/v2/openapi_spec_v2.json
index 7b4f04a229..1bce9a47e2 100644
--- a/api-reference/v2/openapi_spec_v2.json
+++ b/api-reference/v2/openapi_spec_v2.json
@@ -14971,9 +14971,24 @@
"created_at": {
"type": "string",
"format": "date-time"
+ },
+ "organization_type": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/OrganizationType"
+ }
+ ],
+ "nullable": true
}
}
},
+ "OrganizationType": {
+ "type": "string",
+ "enum": [
+ "standard",
+ "platform"
+ ]
+ },
"OrganizationUpdateRequest": {
"type": "object",
"required": [
diff --git a/crates/api_models/src/organization.rs b/crates/api_models/src/organization.rs
index 50632e66be..e12b21c143 100644
--- a/crates/api_models/src/organization.rs
+++ b/crates/api_models/src/organization.rs
@@ -74,6 +74,10 @@ pub struct OrganizationResponse {
pub metadata: Option<pii::SecretSerdeValue>,
pub modified_at: time::PrimitiveDateTime,
pub created_at: time::PrimitiveDateTime,
+
+ /// Organization Type of the organization
+ #[schema(value_type = Option<OrganizationType>, example = "standard")]
+ pub organization_type: Option<OrganizationType>,
}
#[cfg(feature = "v2")]
@@ -95,4 +99,8 @@ pub struct OrganizationResponse {
pub metadata: Option<pii::SecretSerdeValue>,
pub modified_at: time::PrimitiveDateTime,
pub created_at: time::PrimitiveDateTime,
+
+ /// Organization Type of the organization
+ #[schema(value_type = Option<OrganizationType>, example = "standard")]
+ pub organization_type: Option<OrganizationType>,
}
diff --git a/crates/common_enums/src/enums/accounts.rs b/crates/common_enums/src/enums/accounts.rs
index 2d575f4d83..844ef39824 100644
--- a/crates/common_enums/src/enums/accounts.rs
+++ b/crates/common_enums/src/enums/accounts.rs
@@ -61,6 +61,7 @@ pub enum MerchantAccountType {
serde::Serialize,
strum::Display,
strum::EnumString,
+ ToSchema,
)]
#[router_derive::diesel_enum(storage_type = "text")]
#[strum(serialize_all = "snake_case")]
diff --git a/crates/openapi/src/openapi.rs b/crates/openapi/src/openapi.rs
index 766c69c494..387be8ec75 100644
--- a/crates/openapi/src/openapi.rs
+++ b/crates/openapi/src/openapi.rs
@@ -363,6 +363,7 @@ Never share your secret api keys. Keep them guarded and secure.
api_models::enums::CtpServiceProvider,
api_models::enums::PaymentLinkSdkLabelType,
api_models::enums::PaymentLinkShowSdkTerms,
+ api_models::enums::OrganizationType,
api_models::admin::MerchantConnectorCreate,
api_models::admin::AdditionalMerchantData,
api_models::admin::ConnectorWalletDetails,
diff --git a/crates/openapi/src/openapi_v2.rs b/crates/openapi/src/openapi_v2.rs
index ba447a4e45..e1cda388a3 100644
--- a/crates/openapi/src/openapi_v2.rs
+++ b/crates/openapi/src/openapi_v2.rs
@@ -319,6 +319,7 @@ Never share your secret api keys. Keep them guarded and secure.
api_models::enums::CtpServiceProvider,
api_models::enums::PaymentLinkSdkLabelType,
api_models::enums::PaymentLinkShowSdkTerms,
+ api_models::enums::OrganizationType,
api_models::admin::MerchantConnectorCreate,
api_models::admin::AdditionalMerchantData,
api_models::admin::CardTestingGuardConfig,
diff --git a/crates/router/src/types/api/admin.rs b/crates/router/src/types/api/admin.rs
index dea8cc0d77..1b478cee4c 100644
--- a/crates/router/src/types/api/admin.rs
+++ b/crates/router/src/types/api/admin.rs
@@ -75,6 +75,7 @@ impl ForeignFrom<diesel_models::organization::Organization> for OrganizationResp
metadata: org.metadata,
modified_at: org.modified_at,
created_at: org.created_at,
+ organization_type: org.organization_type,
}
}
}