/** * An app instance is a specific occurrence of an app on a Wix site. * When a Wix user installs an app, a unique instance is generated for that * specific site. Use the `instanceId` to keep track of the individual data * associated with each app instance. */ export interface AppInstance { /** * App instance ID. Useful to keep track of the * data that's associated with the specific instance of your app * installed on a Wix site. */ instanceId?: string; /** App name, as you entered it in the App Dashboard. */ appName?: string; /** Version of your app that's installed on the Wix site. */ appVersion?: string | null; /** * Whether the Wix user has installed a free or paid version of your app * on their site. */ isFree?: boolean; /** * Billing information for the app instance. Available only in case * `{"isFree": false}`. */ billing?: BillingInfo; /** * List of [permissions](https://dev.wix.com/docs/build-apps/developer-tools/developers-center/example-app-walkthrough/build-an-app#4-add-permissions) * that the Wix user has granted your app. You set the list of permissions that * your app requires from the Wix user in your app's Permissions page. */ permissions?: string[]; /** Plans available to this app instance. */ availablePlans?: AvailablePlan[]; /** * ID of the Wix site from which the instance of your app has been cloned. * Available only when `{"copiedFromTemplate": true}`. * All visual settings of the Wix site and app data are duplicated during the * cloning process. Wix also notifies you in case there is any additional * external functionality for the original site. */ originInstanceId?: string | null; /** * __Deprecated__. This parameter will be removed on March 30, 2023. Use * `copiedFromTemplate` instead. * @deprecated */ isOriginSiteTemplate?: boolean; /** Whether this app instance was created when another Wix site was cloned. */ copiedFromTemplate?: boolean; /** Whether this app instance includes a free trial that hasn't started yet. */ freeTrialAvailable?: boolean; } export interface BillingInfo { /** Name of the package that the site owner has paid for. */ packageName?: string; /** * Interval of the billing cycle. `"ONE_TIME"` means that site owners have * purchased unlimited access to the app with a single, upfront payment. */ billingCycle?: PaymentCycle; /** * Date and time the Wix user purchased the app's paid plan or began their free trial. In * `YYYY-MM-DDThh:mm:ss.sssZ` format. */ timeStamp?: string; /** * Date and time the app's current billing cycle ends in * `YYYY-MM-DDThh:mm:ss.sssZ` format. Available only for yearly and * multi-yearly plans. */ expirationDate?: string | null; /** * Whether the app's subscription automatically renews at the end of the * current billing cycle. */ autoRenewing?: boolean | null; /** ID of the invoice for the current billing cycle. */ invoiceId?: string | null; /** * Information about any discounts applied to the app instance's current billing cycle. * If the site owners applied a developer coupon or Wix Voucher * when installing the paid version of your app, this field holds the coupon's * name or `“Wix discount coupon”`. Site owners may receive a Wix Voucher when * upgrading their Wix subscription. If there is no discount for the * current billing cycle, the field is an empty string. */ source?: string | null; /** Information about the free trial applied, if relevant. */ freeTrialInfo?: FreeTrialInfo; } export declare enum PaymentCycle { NO_CYCLE = "NO_CYCLE", MONTHLY = "MONTHLY", YEARLY = "YEARLY", ONE_TIME = "ONE_TIME", TWO_YEARS = "TWO_YEARS", THREE_YEARS = "THREE_YEARS", FOUR_YEARS = "FOUR_YEARS", FIVE_YEARS = "FIVE_YEARS" } export interface FreeTrialInfo { /** * Current free trial status. * @readonly */ status?: FreeTrialStatus; /** * When the free trial has ended. Populated only once the free trial is over. * @readonly */ endDate?: Date | null; } export declare enum FreeTrialStatus { /** Unknown trial status. */ UNKNOWN_STATUS = "UNKNOWN_STATUS", /** The free trial is currently in progress. */ IN_PROGRESS = "IN_PROGRESS", /** The free trial has ended. */ ENDED = "ENDED", /** No free trial was applied, as none was available. */ NOT_AVAILABLE = "NOT_AVAILABLE" } export interface AvailablePlan { /** Package name of the available plan. */ packageName?: string; /** Source of the available plan. Can be a bundle or 3rd-party app. */ source?: string; } export interface AppInstalled { /** Unique identifier of the app within the website. */ appId?: string; /** Instance ID of the app in the original website (relevant only when this site was [duplicated from another site](https://support.wix.com/en/article/duplicating-your-site-1472847)). */ originInstanceId?: string | null; } export interface AppRemoved { /** Unique identifier of the app within the website. */ appId?: string; } export interface PaidPlanPurchased { /** Date and time of purchase. */ operationTimeStamp?: Date | null; /** Purchased app plan. */ vendorProductId?: string; /** Selected payment cycle. */ cycle?: PaymentCycle; /** Plan expiration date. */ expiresOn?: Date | null; /** Coupon applied to purchase (if relevant). */ couponName?: string | null; /** Invoice ID. */ invoiceId?: string | null; } export interface PaidPlanChanged { /** Date and time of change. */ operationTimeStamp?: Date | null; /** Newly purchased app plan. */ vendorProductId?: string; /** Newly selected payment cycle. */ cycle?: PaymentCycle; /** Previous app plan. */ previousVendorProductId?: string | null; /** Previous payment cycle. */ previousCycle?: PaymentCycle; /** Coupon applied to purchase (if relevant). */ couponName?: string | null; /** Invoice ID. */ invoiceId?: string | null; } export interface PaidPlanAutoRenewalCancelled { /** Date and time of auto-renewal cancellation. */ operationTimeStamp?: Date | null; /** Current app plan. */ vendorProductId?: string; /** Current payment cycle. */ cycle?: PaymentCycle; /** Supported values: `UNKNOWN_CANCELLATION_TYPE_ERROR_STATE`, `USER_CANCEL`, `FAILED_PAYMENT`, `TRANSFER_CANCELLATION_REASON`. Reason provided by app for cancellation (if relevant). */ cancelReason?: string | null; /** Reason provided by site owner for cancellation (if relevant). */ userReason?: string | null; /** Cancellation type. */ subscriptionCancellationType?: string | null; } export interface GetAppInstanceRequest { } export interface GetAppInstanceResponse { /** Retrieved app instance. */ instance?: AppInstance; /** Information about the site. */ site?: SiteInfo; } export interface SiteInfo { /** Display name of the site. */ siteDisplayName?: string | null; /** * 2-letter language code of the site's locale in * [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. */ locale?: string; /** * 3-letter currency code for the site's billing in * [ISO-4217 alphabetic](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) format. */ paymentCurrency?: string; /** Information about the site's supported languages. */ multilingual?: Multilingual; /** URL of the site. Available only when the site has been published. */ url?: string | null; /** Description of the site. */ description?: string | null; /** Apps made by Wix that are installed on the site. */ installedWixApps?: string[]; /** * > **Deprecation Notice:** This parameter will be removed on June 30, 2022. Use `ownerInfo` instead. * @deprecated */ ownerEmail?: string | null; /** * Information about the site's Wix user. Available only when calling * _Get App Instance_ with the __Read Site Owner Email__ permission scope. */ ownerInfo?: OwnerInfo; /** Site ID. */ siteId?: string; } export interface Multilingual { /** Whether the site supports more than a single language. */ isMultiLingual?: boolean; /** List of supported languages. Returned only when `{"isMultiLingual": true}`. */ supportedLanguages?: SupportedLanguage[]; } export interface SupportedLanguage { /** Two-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. */ languageCode?: string; /** Locale. */ locale?: Locale; /** Whether the supported language is the primary language for the site. */ isPrimary?: boolean; /** Language icon. */ countryCode?: string; /** How the language will be resolved. For internal use. */ resolutionMethod?: ResolutionMethod; } export interface Locale { /** Two-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. */ languageCode?: string; /** Two-letter country code in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format. */ country?: string; } export declare enum ResolutionMethod { QUERY_PARAM = "QUERY_PARAM", SUBDOMAIN = "SUBDOMAIN", SUBDIRECTORY = "SUBDIRECTORY" } export interface OwnerInfo { /** Wix user's email address. Identical to the their login email. */ email?: string; /** * Supported values: `VERIFIED_OPT_IN`, `VERIFIED_OPT_OUT`, * `NOT_VERIFIED_OPT_IN`, `NOT_VERIFIED_OPT_OUT`. * * Whether the Wix user has verified their email and whether they have chosen * to receive email notifications from Wix. */ emailStatus?: string; } export interface GetAppInstanceByInstanceIdRequest { /** ID of the app instance to retrieve. */ instanceId?: string; } export interface MessageEnvelope { /** App instance ID. */ instanceId?: string | null; /** Event type. */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; } export interface IdentificationData extends IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; /** @readonly */ identityType?: WebhookIdentityType; } /** @oneof */ export interface IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; } export declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } interface FreeTrialInfoNonNullableFields { status: FreeTrialStatus; } interface BillingInfoNonNullableFields { packageName: string; billingCycle: PaymentCycle; timeStamp: string; freeTrialInfo?: FreeTrialInfoNonNullableFields; } interface AvailablePlanNonNullableFields { packageName: string; source: string; } interface AppInstanceNonNullableFields { instanceId: string; appName: string; isFree: boolean; billing?: BillingInfoNonNullableFields; permissions: string[]; availablePlans: AvailablePlanNonNullableFields[]; isOriginSiteTemplate: boolean; copiedFromTemplate: boolean; freeTrialAvailable: boolean; } interface LocaleNonNullableFields { languageCode: string; country: string; } interface SupportedLanguageNonNullableFields { languageCode: string; locale?: LocaleNonNullableFields; isPrimary: boolean; countryCode: string; resolutionMethod: ResolutionMethod; } interface MultilingualNonNullableFields { isMultiLingual: boolean; supportedLanguages: SupportedLanguageNonNullableFields[]; } interface OwnerInfoNonNullableFields { email: string; emailStatus: string; } interface SiteInfoNonNullableFields { locale: string; paymentCurrency: string; multilingual?: MultilingualNonNullableFields; installedWixApps: string[]; ownerInfo?: OwnerInfoNonNullableFields; siteId: string; } export interface GetAppInstanceResponseNonNullableFields { instance?: AppInstanceNonNullableFields; site?: SiteInfoNonNullableFields; } export {};