Class: WhopSDK::Models::Plan

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/whop_sdk/models/plan.rb

Defined Under Namespace

Classes: Company, CustomField, Invoice, PaymentMethodConfiguration, Product

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(disabled:, enabled:, include_platform_defaults:) ⇒ Object

Some parameter documentations has been truncated, see PaymentMethodConfiguration for more details.

The explicit payment method configuration specifying which payment methods are enabled or disabled for this plan. Null if the plan uses default settings.

Parameters:

  • disabled (Array<Symbol, WhopSDK::Models::PaymentMethodTypes>)

    An array of payment method identifiers that are explicitly disabled. Only applie

  • enabled (Array<Symbol, WhopSDK::Models::PaymentMethodTypes>)

    An array of payment method identifiers that are explicitly enabled. This means t

  • include_platform_defaults (Boolean)

    Whether Whop’s platform default payment method enablement settings are included



# File 'lib/whop_sdk/models/plan.rb', line 194

Instance Attribute Details

#billing_periodInteger?

The number of days between each recurring charge. Null for one-time plans. For example, 30 for monthly or 365 for annual billing.

Returns:

  • (Integer, nil)


17
# File 'lib/whop_sdk/models/plan.rb', line 17

required :billing_period, Integer, nil?: true

#collect_taxBoolean

Whether tax is collected on purchases of this plan, based on the company’s tax configuration.

Returns:

  • (Boolean)


24
# File 'lib/whop_sdk/models/plan.rb', line 24

required :collect_tax, WhopSDK::Internal::Type::Boolean

#companyWhopSDK::Models::Plan::Company?

The company that sells this plan. Null for standalone invoice plans not linked to a company.



31
# File 'lib/whop_sdk/models/plan.rb', line 31

required :company, -> { WhopSDK::Plan::Company }, nil?: true

#created_atTime

The datetime the plan was created.

Returns:

  • (Time)


37
# File 'lib/whop_sdk/models/plan.rb', line 37

required :created_at, Time

#currencySymbol, WhopSDK::Models::Currency

The currency used for all prices on this plan (e.g., ‘usd’, ‘eur’). All monetary amounts on the plan are denominated in this currency.

Returns:



44
# File 'lib/whop_sdk/models/plan.rb', line 44

required :currency, enum: -> { WhopSDK::Currency }

#custom_fieldsArray<WhopSDK::Models::Plan::CustomField>

Custom input fields displayed on the checkout form that collect additional information from the buyer.



51
# File 'lib/whop_sdk/models/plan.rb', line 51

required :custom_fields, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Plan::CustomField] }

#descriptionString?

A text description of the plan visible to customers. Maximum 1000 characters. Null if no description is set.

Returns:

  • (String, nil)


58
# File 'lib/whop_sdk/models/plan.rb', line 58

required :description, String, nil?: true

#expiration_daysInteger?

The number of days until the membership expires (for expiration-based plans). For example, 365 for a one-year access pass.

Returns:

  • (Integer, nil)


65
# File 'lib/whop_sdk/models/plan.rb', line 65

required :expiration_days, Integer, nil?: true

#idString

The unique identifier for the plan.

Returns:

  • (String)


10
# File 'lib/whop_sdk/models/plan.rb', line 10

required :id, String

#initial_priceFloat

The initial purchase price in the plan’s base_currency (e.g., 49.99 for $49.99). For one-time plans, this is the full price. For renewal plans, this is charged on top of the first renewal_price.

Returns:

  • (Float)


73
# File 'lib/whop_sdk/models/plan.rb', line 73

required :initial_price, Float

#internal_notesString?

Private notes visible only to the company owner and team members. Not shown to customers. Null if no notes have been added.

Returns:

  • (String, nil)


80
# File 'lib/whop_sdk/models/plan.rb', line 80

required :internal_notes, String, nil?: true

#invoiceWhopSDK::Models::Plan::Invoice?

The invoice this plan was generated for. Null if the plan was not created for a specific invoice.



87
# File 'lib/whop_sdk/models/plan.rb', line 87

required :invoice, -> { WhopSDK::Plan::Invoice }, nil?: true

#member_countInteger?

The number of users who currently hold an active membership through this plan. Only visible to authorized team members.

Returns:

  • (Integer, nil)


94
# File 'lib/whop_sdk/models/plan.rb', line 94

required :member_count, Integer, nil?: true

#payment_method_configurationWhopSDK::Models::Plan::PaymentMethodConfiguration?

The explicit payment method configuration specifying which payment methods are enabled or disabled for this plan. Null if the plan uses default settings.



101
# File 'lib/whop_sdk/models/plan.rb', line 101

required :payment_method_configuration, -> { WhopSDK::Plan::PaymentMethodConfiguration }, nil?: true

#plan_typeSymbol, WhopSDK::Models::PlanType

The billing model for this plan: ‘renewal’ for recurring subscriptions or ‘one_time’ for single payments.

Returns:



108
# File 'lib/whop_sdk/models/plan.rb', line 108

required :plan_type, enum: -> { WhopSDK::PlanType }

#productWhopSDK::Models::Plan::Product?

The product that this plan belongs to. Null for standalone one-off purchases not linked to a product.



115
# File 'lib/whop_sdk/models/plan.rb', line 115

required :product, -> { WhopSDK::Plan::Product }, nil?: true

#purchase_urlString

The full URL where customers can purchase this plan directly, bypassing the product page.

Returns:

  • (String)


122
# File 'lib/whop_sdk/models/plan.rb', line 122

required :purchase_url, String

#release_methodSymbol, WhopSDK::Models::ReleaseMethod

The method used to sell this plan: ‘buy_now’ for immediate purchase or ‘waitlist’ for waitlist-based access.

Returns:



129
# File 'lib/whop_sdk/models/plan.rb', line 129

required :release_method, enum: -> { WhopSDK::ReleaseMethod }

#renewal_priceFloat

The recurring price charged every billing_period in the plan’s base_currency (e.g., 9.99 for $9.99/period). Zero for one-time plans.

Returns:

  • (Float)


136
# File 'lib/whop_sdk/models/plan.rb', line 136

required :renewal_price, Float

#split_pay_required_paymentsInteger?

The total number of installment payments required before the subscription pauses. Null if split pay is not configured. Must be greater than 1.

Returns:

  • (Integer, nil)


143
# File 'lib/whop_sdk/models/plan.rb', line 143

required :split_pay_required_payments, Integer, nil?: true

#stockInteger?

The number of units available for purchase. Only visible to authorized team members. Null if the requester lacks permission.

Returns:

  • (Integer, nil)


150
# File 'lib/whop_sdk/models/plan.rb', line 150

required :stock, Integer, nil?: true

#tax_typeSymbol, WhopSDK::Models::TaxType

How tax is handled for this plan: ‘inclusive’ (tax included in price), ‘exclusive’ (tax added at checkout), or ‘unspecified’ (tax not configured).

Returns:



157
# File 'lib/whop_sdk/models/plan.rb', line 157

required :tax_type, enum: -> { WhopSDK::TaxType }

#titleString?

The display name of the plan shown to customers on the product page and at checkout. Maximum 30 characters. Null if no title has been set.

Returns:

  • (String, nil)


164
# File 'lib/whop_sdk/models/plan.rb', line 164

required :title, String, nil?: true

#trial_period_daysInteger?

The number of free trial days before the first charge on a renewal plan. Null if no trial is configured or the current user has already used a trial for this plan.

Returns:

  • (Integer, nil)


172
# File 'lib/whop_sdk/models/plan.rb', line 172

required :trial_period_days, Integer, nil?: true

#unlimited_stockBoolean

When true, the plan has unlimited stock (stock field is ignored). When false, purchases are limited by the stock field.

Returns:

  • (Boolean)


179
# File 'lib/whop_sdk/models/plan.rb', line 179

required :unlimited_stock, WhopSDK::Internal::Type::Boolean

#updated_atTime

The datetime the plan was last updated.

Returns:

  • (Time)


185
# File 'lib/whop_sdk/models/plan.rb', line 185

required :updated_at, Time

#visibilitySymbol, WhopSDK::Models::Visibility

Controls whether the plan is visible to customers. When set to ‘hidden’, the plan is only accessible via direct link.

Returns:



192
# File 'lib/whop_sdk/models/plan.rb', line 192

required :visibility, enum: -> { WhopSDK::Visibility }