/** * This enum represent the status of a subscription */ export declare enum SubscriptionState { Active = 1, PendingUserVerification = 3, PendingActivation = 0, Inactive = -1, Ready = 2 } /** * This type represent the type of a subscription */ export declare enum SubscriptionType { Agency = 3, Enterprise = 4, Professional = 2, Starter = 1, Trial = 0 } /** * This type represent the model for a subscription plan */ export type SubscriptionPlan = { /** * The cost of the subscription plan */ cost: number; /** * The unique id of the subscription plan */ id: number; /** * The subscription name */ name: string; /** * The limit of space for the subscription plan */ spacesCap: number; /** * The type of the subscription plan */ subscriptionType: SubscriptionType; /** * Mark if the subscription plan is legacy */ legacy: boolean; }; /** * The type represent the model of a subscription */ export type SubscriptionResponse = { /** * The creation date of the subscription */ creationDate: Date; /** * The unique id of the subscription */ id: string; /** * The owner id of the subscription */ ownerId: string; /** * The state of the subscription */ state: SubscriptionState; /** * The type of the subscription */ type: SubscriptionType; /** * The update date of the subscription */ updateDate?: Date; /** * The stripe customer id */ stripeCustomerId: string; /** * The stripe plan id */ stripePlanId: string; /** * The stripe subscription id */ stripeSubscriptionId: string; /** * The subscription end date */ subscriptionEndDate: Date; /** * The last stripe payment intent */ latestStripePaymentIntent: string; }; /** * This type represent the data needed to make a create subscription API request */ export type CreateSubscriptionRequest = { /** * The scenario selected for the subscription * This will create the first space with predefined data based on the selected scenario */ selectedScenario: number; /** * The first subscription space name */ spaceName: string; /** * The subscription type * Default value is set to trial */ type?: SubscriptionType; /** * Promotional code */ promoCode?: string; /** * Default locale of the new space */ locale: string; }; /** * This type represent the response of of a create subscription API request */ export type CreateSubscriptionResponse = SubscriptionResponse; /** * This type represent the data needed to make a create subscription space API request */ export type CreateSubscriptionSpaceRequest = { /** * The subscription id where to create the space */ subscriptionId: string; /** * The space name */ spaceName: string; /** * The selected scenario for the space */ scenario: number; /** * Default locale of the new space */ defaultLocale: string; }; /** * This type of represent the response of a create subscription space API request */ export type CreateSubscriptionSpaceResponse = boolean; /** * This type represent the data needed to make a get subscription API request */ export type GetSubscriptionRequest = { /** * The subscription unique id to retrieve */ subscriptionId: string; }; /** * This type represent the response of a get subscription API request */ export type GetSubscriptionResponse = SubscriptionResponse; /** * This type represent the data needed to make a get subscription summary API request */ export type GetSubscriptionSummaryRequest = { /** * The subscription unique id */ subscriptionId: string; }; /** * This type represent the response of a get subscription summary response */ export type GetSubscriptionSummaryResponse = { /** * The data of the subscription */ subscription: SubscriptionResponse; /** * The plan related to the subscription */ plan: SubscriptionPlan; /** * The list of space related to the subscription */ spaces: { /** * The space id */ spaceId: string; /** * The space name */ spaceName: string; }[]; /** * The list of available plans upgrade */ availableUpgrades: SubscriptionPlan[]; }; /** * This type represent the data needed to make a list subscription API request */ export type ListSubscriptionRequest = {}; /** * This type represent the response of a list subscription API request */ export type ListSubscriptionResponse = SubscriptionResponse[]; /** * This type represent the data needed to make a change plan API request */ export type ChangePlanRequest = { /** * The subscription unique id where to change the plan */ subscriptionId: string; /** * The stripe tokenized payment method */ tokenizedPaymentMethod: string; /** * The new plan to select */ plan: SubscriptionType; /** * The subscription renewal interval */ interval: Interval; }; /** * This type represent the response of a change plan API request */ export type ChangePlanResponse = SubscriptionResponse; /** * This type represent the data needed to make an attempt payment API request */ export type AttemptPaymentRequest = { /** * The subscription unique id to try to pay */ subscriptionId: string; /** * The stripe tokenized payment method */ tokenizedPaymentMethod: string; /** * The selected plan */ plan: SubscriptionType; }; /** * This type represent the response of an attempt payment API request */ export type AttemptPaymentResponse = SubscriptionResponse; /** * this type represent the data needed to make an update customer source API request */ export type UpdateCustomerSourceRequest = { /** * The subscription unique id */ subscriptionId: string; /** * The stripe tokenized payment method */ tokenizedPaymentMethod: string; }; /** * This type represent the response of an update custom source API request */ export type UpdateCustomerSourceResponse = boolean; /** * this type represent the data needed to make a cancel subscription API request */ export type CancelSubscriptionRequest = { /** * The subscription unique id */ subscriptionId: string; }; /** * This type represent the response of a cancel subscription source API request */ export type CancelSubscriptionResponse = boolean; /** * This type represent the data needed to make an update billing information API request */ export type UpdateBillingRequest = { /** * The subscription unique id */ subscriptionId: string; /** * The billing information to upgrade */ billingInformation: BillingInformation; }; /** * This type represent the response of an update billing information API request */ export type UpdateBillingResponse = BillingInformation; /** * This type represent the data needed to make a get billing information API request */ export type GetBillingRequest = { /** * The subscription unique id */ subscriptionId: string; }; /** * This type represent the response of a get billing API request */ export type GetBillingResponse = Partial; /** * This type represent the data needed to make a get a get tax rate API request */ export type GetTaxRateRequest = { /** * The subscription api request */ subscriptionId: string; }; /** * This type represent the response of a get tax rage API request */ export type GetTaxRateResponse = { /** * The tax display name */ displayName: string; /** * The jurisdiction of the tax */ jurisdiction: string | null; /** * The percentage of taxes */ percentage: number; /** * Mark if the tax is exempt */ isTaxExempt: boolean; }; /** * This enum represent the payment intent status */ export declare enum PaymentIntentStatus { REQUIRES_PAYMENT_METHOD = "requires_payment_method", REQUIRES_ACTION = "requires_action" } /** * This type represent the model of billing information */ export type BillingInformation = { /** * The name of the billing owner */ name: string; /** * The tax rate id */ tax_id?: string; /** * The address 1 */ address_line1: string; /** * The address 2 */ address_line2?: string; /** * The state of the billing owner */ state: string; /** * The city of the billing owner */ city: string; /** * The country of the billing owner */ country: string; /** * The zip code of the billing owner */ zip: string; /** * The company of the billing owner */ company?: boolean; }; /** * This enum represent the admitted payment interval */ export declare enum Interval { day = "day", week = "week", month = "month", year = "year" }