Class: WhopSDK::Models::Product

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

Defined Under Namespace

Classes: Company, GalleryImage, OwnerUser, ProductTaxCode

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(id:, name:, username:) ⇒ Object

The user who owns the company that sells this product.

Parameters:

  • id (String)

    The unique identifier for the user.

  • name (String, nil)

    The user’s display name shown on their public profile.

  • username (String)

    The user’s unique username shown on their public profile.



# File 'lib/whop_sdk/models/product.rb', line 160

Instance Attribute Details

#companyWhopSDK::Models::Product::Company

The company this product belongs to.



16
# File 'lib/whop_sdk/models/product.rb', line 16

required :company, -> { WhopSDK::Product::Company }

#created_atTime

The datetime the product was created.

Returns:

  • (Time)


22
# File 'lib/whop_sdk/models/product.rb', line 22

required :created_at, Time

#custom_ctaSymbol, WhopSDK::Models::CustomCta

The call-to-action button label displayed on the product’s purchase page (e.g., ‘join’, ‘buy’, ‘subscribe’).

Returns:



29
# File 'lib/whop_sdk/models/product.rb', line 29

required :custom_cta, enum: -> { WhopSDK::CustomCta }

#custom_cta_urlString?

An optional URL that the call-to-action button links to instead of the default checkout flow. Null if no custom URL is set.

Returns:

  • (String, nil)


36
# File 'lib/whop_sdk/models/product.rb', line 36

required :custom_cta_url, String, nil?: true

#custom_statement_descriptorString?

A custom text label that appears on the customer’s bank or credit card statement for purchases of this product. Maximum 22 characters, including the required prefix WHOP*.

Returns:

  • (String, nil)


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

required :custom_statement_descriptor, String, nil?: true

#descriptionString?

A brief summary of what the product offers, displayed on product pages and search results.

Returns:

  • (String, nil)


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

required :description, String, nil?: true

#external_identifierString?

A unique identifier used to create or update products via the API. When provided on product creation endpoints, an existing product with this identifier will be updated instead of creating a new one.

Returns:

  • (String, nil)


59
# File 'lib/whop_sdk/models/product.rb', line 59

required :external_identifier, String, nil?: true

The gallery images for this product, ordered by position.



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

required :gallery_images, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Product::GalleryImage] }

#global_affiliate_percentageFloat?

The commission rate (as a percentage) that affiliates earn on sales through the Whop marketplace global affiliate program. Null if the program is not active.

Returns:

  • (Float, nil)


72
# File 'lib/whop_sdk/models/product.rb', line 72

required :global_affiliate_percentage, Float, nil?: true

#global_affiliate_statusSymbol, WhopSDK::Models::GlobalAffiliateStatus

The enrollment status of this product in the Whop marketplace global affiliate program.



79
# File 'lib/whop_sdk/models/product.rb', line 79

required :global_affiliate_status, enum: -> { WhopSDK::GlobalAffiliateStatus }

#headlineString?

A short marketing headline displayed prominently on the product’s product page.

Returns:

  • (String, nil)


85
# File 'lib/whop_sdk/models/product.rb', line 85

required :headline, String, nil?: true

#idString

The unique identifier for the product.

Returns:

  • (String)


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

required :id, String

#member_affiliate_percentageFloat?

The commission rate (as a percentage) that existing members earn when referring new customers through the member affiliate program. Null if the program is not active.

Returns:

  • (Float, nil)


93
# File 'lib/whop_sdk/models/product.rb', line 93

required :member_affiliate_percentage, Float, nil?: true

#member_affiliate_statusSymbol, WhopSDK::Models::GlobalAffiliateStatus

The enrollment status of this product in the member affiliate program.



99
# File 'lib/whop_sdk/models/product.rb', line 99

required :member_affiliate_status, enum: -> { WhopSDK::GlobalAffiliateStatus }

#member_countInteger

The number of users who currently hold an active membership to this product. Returns 0 if the company has disabled public member counts.

Returns:

  • (Integer)


106
# File 'lib/whop_sdk/models/product.rb', line 106

required :member_count, Integer

#owner_userWhopSDK::Models::Product::OwnerUser

The user who owns the company that sells this product.



112
# File 'lib/whop_sdk/models/product.rb', line 112

required :owner_user, -> { WhopSDK::Product::OwnerUser }

#product_tax_codeWhopSDK::Models::Product::ProductTaxCode?

The tax classification code applied to purchases of this product for sales tax calculation. Null if no tax code is assigned.



119
# File 'lib/whop_sdk/models/product.rb', line 119

required :product_tax_code, -> { WhopSDK::Product::ProductTaxCode }, nil?: true

#published_reviews_countInteger

The total number of published customer reviews for this product’s company.

Returns:

  • (Integer)


125
# File 'lib/whop_sdk/models/product.rb', line 125

required :published_reviews_count, Integer

#routeString

The URL slug used in the product’s public link (e.g., ‘my-product’ in whop.com/company/my-product).

Returns:

  • (String)


132
# File 'lib/whop_sdk/models/product.rb', line 132

required :route, String

#titleString

The display name of the product shown to customers on the product page and in search results.

Returns:

  • (String)


139
# File 'lib/whop_sdk/models/product.rb', line 139

required :title, String

#updated_atTime

The datetime the product was last updated.

Returns:

  • (Time)


145
# File 'lib/whop_sdk/models/product.rb', line 145

required :updated_at, Time

#verifiedBoolean

Whether this company has been verified by Whop’s trust and safety team.

Returns:

  • (Boolean)


151
# File 'lib/whop_sdk/models/product.rb', line 151

required :verified, WhopSDK::Internal::Type::Boolean

#visibilitySymbol, WhopSDK::Models::Visibility

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

Returns:



158
# File 'lib/whop_sdk/models/product.rb', line 158

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