From fcab87ffac94e07b48c2b52e0e481afdf4ccd431 Mon Sep 17 00:00:00 2001 From: Stephon Brown Date: Tue, 20 Jan 2026 12:21:57 -0500 Subject: [PATCH] feat(billing): Add upgrade endpoint --- .../billing/clients/account-billing.client.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/apps/web/src/app/billing/clients/account-billing.client.ts b/apps/web/src/app/billing/clients/account-billing.client.ts index e520e70bf70..45699dd85a4 100644 --- a/apps/web/src/app/billing/clients/account-billing.client.ts +++ b/apps/web/src/app/billing/clients/account-billing.client.ts @@ -1,7 +1,9 @@ import { Injectable } from "@angular/core"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; +import { ProductTierType } from "@bitwarden/common/billing/enums"; import { BitwardenSubscriptionResponse } from "@bitwarden/common/billing/models/response/bitwarden-subscription.response"; +import { SubscriptionCadence } from "@bitwarden/common/billing/types/subscription-pricing-tier"; import { BitwardenSubscription } from "@bitwarden/subscription"; import { @@ -53,4 +55,20 @@ export class AccountBillingClient { const path = `${this.endpoint}/subscription/storage`; await this.apiService.send("PUT", path, { additionalStorageGb }, true, false); }; + + upgradePremiumToOrganization = async ( + organizationName: string, + organizationKey: string, + planTier: ProductTierType, + cadence: SubscriptionCadence, + ): Promise => { + const path = `${this.endpoint}/upgrade`; + await this.apiService.send( + "POST", + path, + { organizationName, key: organizationKey, tier: planTier, cadence }, + true, + false, + ); + }; }