import type * as Whop from "../index.mjs"; /** * A membership represents an active relationship between a user and a product. It tracks the user's access, billing status, and renewal schedule. */ export interface MembershipLegacy { /** Whether this membership is set to cancel at the end of the current billing cycle. Only applies to memberships with a recurring plan. */ cancel_at_period_end: boolean; /** The category selected for why the member canceled (e.g. too_expensive, switching, missing_features). */ cancel_option: Whop.CancelOptions | null; /** Whether the customer is canceling, left, or was won back. Null if the membership has no cancellation reason or its cancellation state is indeterminate. */ cancelation_status: Whop.CancelationStatus | null; /** The time the customer initiated cancellation of this membership. As a Unix timestamp. Null if the membership has not been canceled. */ canceled_at: string | null; /** Free-text explanation provided by the customer when canceling. Null if the customer did not provide a reason. */ cancellation_reason: string | null; /** The ID of the checkout session/configuration that produced this membership, if any. Use this to map memberships back to the checkout configuration that created them. */ checkout_configuration_id: string | null; /** The company this membership belongs to. */ company: MembershipLegacy.Company; /** The datetime the membership was created. */ created_at: string; /** The three-letter ISO currency code for this membership's billing. Null if the membership is free. */ currency: Whop.Currencies | null; /** The customer's responses to custom checkout questions configured on the product at the time of purchase. */ custom_field_responses: MembershipLegacy.CustomFieldResponses.Item[]; /** The account's own cancel reason the member picked, as they saw it. `null` when the member picked a default category or gave no reason. */ feedback_option: MembershipLegacy.FeedbackOption | null; /** The recurring renewal price for this membership, formatted with currency symbol and billing interval. Null if the membership is not recurring. */ formatted_renewal_price: string | null; /** The unique identifier for the membership. */ id: string; /** The amount the customer paid when first purchasing this membership, formatted with currency symbol. */ initial_price_paid: string; /** The time the user first joined the company associated with this membership. As a Unix timestamp. Null if the member record does not exist. */ joined_at: string | null; /** The software license key associated with this membership. Only present if the product includes a Whop Software Licensing experience. Null otherwise. */ license_key: string | null; /** The URL where the customer can view and manage this membership, including cancellation and plan changes. Null if no member record exists. */ manage_url: string | null; /** The member record linking the user to the company for this membership. Null if the member record has not been created yet. */ member: MembershipLegacy.Member | null; /** Custom key-value pairs for the membership (commonly used for software licensing, e.g., HWID). Max 50 keys, 100 chars per key, 500 chars per string value. */ metadata: Record | null; /** Whether recurring payment collection for this membership is temporarily paused by the company. */ payment_collection_paused: boolean; /** The plan the customer purchased to create this membership. */ plan: MembershipLegacy.Plan; /** The product this membership grants access to. */ product: MembershipLegacy.Product; /** The promotional code currently applied to this membership's billing. Null if no promo code is active. */ promo_code: MembershipLegacy.PromoCode | null; /** The end of the current billing period for this recurring membership. As a Unix timestamp. Null if the membership is not recurring. */ renewal_period_end: string | null; /** The start of the current billing period for this recurring membership. As a Unix timestamp. Null if the membership is not recurring. */ renewal_period_start: string | null; /** The current lifecycle status of the membership (e.g., active, trialing, past_due, canceled, expired, completed). */ status: Whop.MembershipStatus; /** The datetime the membership was last updated. */ updated_at: string; /** The user who owns this membership. Null if the user account has been deleted. */ user: MembershipLegacy.User | null; } export declare namespace MembershipLegacy { /** * The company this membership belongs to. */ interface Company { /** The unique identifier for the company. */ id: string; /** The display name of the company shown to customers. */ title: string; } type CustomFieldResponses = CustomFieldResponses.Item[]; namespace CustomFieldResponses { /** * The response from a custom field on checkout */ interface Item { /** The response a user gave to the specific question or field. */ answer: string; /** The unique identifier for the custom field response. */ id: string; /** The question asked by the custom field */ question: string; } } /** * The account's own cancel reason the member picked, as they saw it. `null` when the member picked a default category or gave no reason. */ interface FeedbackOption { /** The option's label when the member picked it. Renaming the option later does not change it. */ label: string; } /** * The member record linking the user to the company for this membership. Null if the member record has not been created yet. */ interface Member { /** The unique identifier for the member. */ id: string; } /** * The plan the customer purchased to create this membership. */ interface Plan { /** The unique identifier for the plan. */ id: string; /** Custom key-value pairs stored on the plan. Included in webhook payloads for payment and membership events. Max 50 keys, 100 chars per key, 500 chars per string value. The reserved keys `custom_cta` and `custom_cta_url`, when set, override the product's checkout call to action for this plan. */ metadata: Record | null; } /** * The product this membership grants access to. */ interface Product { /** The unique identifier for the product. */ id: string; /** Custom key-value pairs stored on the product and included in payment and membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters per string value. */ metadata: Record | null; /** The display name of the product shown to customers on the product page and in search results. */ title: string; } /** * The promotional code currently applied to this membership's billing. Null if no promo code is active. */ interface PromoCode { /** The unique identifier for the promo code. */ id: string; } /** * The user who owns this membership. Null if the user account has been deleted. */ interface User { /** The user's email address. Requires the member:email:read permission to access. Null if not authorized. */ email: string | null; /** The unique identifier for the user. */ id: string; /** The user's display name shown on their public profile. */ name: string | null; /** The URL of the user's profile picture. Use profilePicture for the full attachment object. */ profile_pic: string; /** The user's unique username shown on their public profile. */ username: string; } }