import type * as Whop from "../index.js"; export interface Membership { /** The account (seller) this membership belongs to. */ account: Whop.StorefrontAccount; /** The membership's affiliate commission. `null` without an affiliate, without `affiliate:basic:read` on the account, and always in webhooks. */ affiliate: Whop.MembershipAffiliate | null; /** Number of days between recurring charges. `null` for non-renewing memberships or memberships with multiple renewal schedules. */ billing_period_days: number | null; /** Whether the membership is set to cancel when the current billing period ends. Only meaningful for recurring variants. */ cancel_at_period_end: boolean; /** The category the member picked for why they canceled. `null` when no category was picked. */ cancel_option: Membership.CancelOption | null; /** When cancellation was requested, or when the membership was canceled if no request time is recorded, as an ISO 8601 timestamp. `null` when neither is recorded. */ canceled_at: string | null; /** Free-text explanation provided when canceling. `null` when no reason was provided. */ cancellation_reason: string | null; /** How renewals are collected. `charge_automatically` charges the saved payment method each period; `send_invoice` emails the buyer an invoice each period. `null` when not set. */ collection_method: Membership.CollectionMethod | null; /** When the membership was created, as an ISO 8601 timestamp. */ created_at: string; /** When the current billing period renews, or when a non-renewing membership expires, as an ISO 8601 timestamp. `null` for one-time purchases with no expiration. */ current_period_end: string | null; /** When the current billing period started, as an ISO 8601 timestamp. `null` when no billing period is recorded. */ current_period_start: string | null; /** When access ends for a membership with a fixed expiration, as an ISO 8601 timestamp. `null` when the membership has no expiration, such as a renewing membership. */ expires_at: string | null; /** 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: Whop.MembershipFeedbackOption | null; /** Membership ID, prefixed `mem_`. */ id: string; /** The variant's current up-front price, in the variant's currency. A list price, not necessarily what the buyer paid. `amount` is `"0.00"` when the first charge is free. */ initial_price: Whop.Money; /** The software license key for this membership. Only present when the product includes a software licensing experience. */ license_key: string | null; /** URL where the buyer can sign in to manage billing. `null` without a member record or unless the caller is the buyer or has `member:manage` on the account. */ manage_url: string | null; /** The caller's member row on the account. Present only when the membership belongs to the caller; `null` on seller-side reads. */ member: Whop.MembershipMember | null; /** The buyer's member record on the account, prefixed `mber_`. `null` when the membership has no member record, such as an unclaimed membership. */ member_id: string | null; /** Custom key-value pairs stored on the membership, commonly used for software licensing. */ metadata: Record; /** The membership's latest lifecycle event, such as `renewing_on` or `canceled_on`. Pair it with `most_recent_action_at`. `null` when none is recorded. */ most_recent_action: Membership.MostRecentAction | null; /** When `most_recent_action` happened or is scheduled to happen, as an ISO 8601 timestamp. A future time for upcoming events such as `renewing_on`. `null` when no action is recorded. */ most_recent_action_at: string | null; /** The buyer's phone number recorded for this membership, or `null`. The number collected (or verified) at checkout when the seller's phone collection is on; falls back to the buyer's account number when they have shared one with this seller. */ phone_number: string | null; /** The product this membership grants access to. */ product: Whop.MembershipProduct; /** The product this membership grants access to, prefixed `prod_`. */ product_id: string; /** The promo code discounting this membership, prefixed `promo_`. `null` when none is applied. Set at checkout or by Apply Promo Code to Membership. */ promo_code_id: string | null; /** What the next renewal charges, after any promo code that still applies. `null` for non-renewing memberships. */ renewal_price: Whop.Money | null; /** Paid installments counted so far on a split pay membership. `null` when the membership is not on split pay, or before its first installment is counted. */ split_pay_current_payments: number | null; /** Installment payments required before the membership stops billing. `null` when the membership is not on split pay. */ split_pay_required_payments: number | null; /** Billing state of the membership. `active`/`trialing` memberships grant access; `past_due` is the grace period after a failed payment; `completed` one-time purchases keep access; `canceled`/`expired` do not. */ status: Whop.MembershipStatus; /** When the membership was last changed, as an ISO 8601 timestamp. Reflects the most recent change to the membership itself, so you can reconcile against webhook retries, replays, and backfills. */ updated_at: string; /** The buyer, prefixed `user_`. `null` when the buyer is another business or the membership is unclaimed. */ user_id: string | null; /** The variant the buyer purchased, prefixed `plan_`. */ variant_id: string; } export declare namespace Membership { /** The category the member picked for why they canceled. `null` when no category was picked. */ const CancelOption: { readonly TooExpensive: "too_expensive"; readonly Switching: "switching"; readonly MissingFeatures: "missing_features"; readonly TechnicalIssues: "technical_issues"; readonly BadExperience: "bad_experience"; readonly Unused: "unused"; readonly Other: "other"; readonly Testing: "testing"; }; type CancelOption = (typeof CancelOption)[keyof typeof CancelOption]; /** How renewals are collected. `charge_automatically` charges the saved payment method each period; `send_invoice` emails the buyer an invoice each period. `null` when not set. */ const CollectionMethod: { readonly ChargeAutomatically: "charge_automatically"; readonly SendInvoice: "send_invoice"; }; type CollectionMethod = (typeof CollectionMethod)[keyof typeof CollectionMethod]; /** The membership's latest lifecycle event, such as `renewing_on` or `canceled_on`. Pair it with `most_recent_action_at`. `null` when none is recorded. */ const MostRecentAction: { readonly CanceledOn: "canceled_on"; readonly FinishedSplitPayAt: "finished_split_pay_at"; readonly CancelingOn: "canceling_on"; readonly EndingOn: "ending_on"; readonly RenewingOn: "renewing_on"; readonly PastDue: "past_due"; readonly NextPaymentAttempt: "next_payment_attempt"; readonly PausedAt: "paused_at"; readonly TrialEndsAt: "trial_ends_at"; readonly UnresolvedAt: "unresolved_at"; readonly TrialCancelingOn: "trial_canceling_on"; }; type MostRecentAction = (typeof MostRecentAction)[keyof typeof MostRecentAction]; }