diff --git a/package.json b/package.json index eb5fb7c3..a5bf309c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@internxt/sdk", "author": "Internxt ", - "version": "1.17.12", + "version": "1.17.13", "description": "An sdk for interacting with Internxt's services", "repository": { "type": "git", diff --git a/src/drive/payments/index.ts b/src/drive/payments/index.ts index 4e6cb8c3..10c60011 100644 --- a/src/drive/payments/index.ts +++ b/src/drive/payments/index.ts @@ -127,6 +127,10 @@ export class Payments { ); } + public applyCancellationTrial(subscriptionId: string): Promise { + return this.client.post('/customer/cancellation-trial', { subscriptionId }, this.headers()); + } + public cancelSubscription(userType?: UserType): Promise { const query = new URLSearchParams(); if (userType) query.set('userType', userType); diff --git a/src/drive/payments/types/types.ts b/src/drive/payments/types/types.ts index 293e23ba..92733bbe 100644 --- a/src/drive/payments/types/types.ts +++ b/src/drive/payments/types/types.ts @@ -69,6 +69,13 @@ export enum UserType { Business = 'business', } +export type Commitment = { + enabled: boolean; + remainingMonths?: number; + cancellationDate?: string; + isElegibleForCancellation?: boolean; +}; + export type StoragePlan = { planId: string; productId: string; @@ -81,11 +88,9 @@ export type StoragePlan = { isTeam: boolean; isLifetime: boolean; renewalPeriod: RenewalPeriod; - commitment: { - enabled: boolean; - isFirstMonth?: boolean; - remainingMonths?: number; - cancellationDate?: string | null; + commitment: Commitment; + cancellationTrial: { + redeemed: boolean; }; storageLimit: number; amountOfSeats: number;