Class: WhopSDK::Models::Product

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

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 164

Instance Attribute Details

#companyWhopSDK::Models::Product::Company

The company this product belongs to.

Parameters:

  • value (WhopSDK::Product::Company)

Returns:



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

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

#created_atTime

The datetime the product was created.

Parameters:

  • value (Time)

Returns:

  • (Time)


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

required :created_at, Time

#custom_ctaSymbol, WhopSDK::Models::CustomCta

Call-to-action button label shown on the product purchase page.

Parameters:

  • value (WhopSDK::Models::custom_cta)

Returns:



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

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.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

required :custom_cta_url, String, nil?: true

#custom_statement_descriptorString?

Custom bank statement descriptor for product purchases. Maximum 22 characters, including required WHOP* prefix.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

required :custom_statement_descriptor, String, nil?: true

#descriptionString?

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

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

required :description, String, nil?: true

#external_identifierString?

External identifier for the product. Providing it on a product creation endpoint updates the existing product with this identifier instead of creating a new one.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

required :external_identifier, String, nil?: true

The gallery images for this product, ordered by position.

Parameters:

  • value (::Array[WhopSDK::Product::GalleryImage])

Returns:



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

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

#global_affiliate_percentageFloat?

Marketplace affiliate commission percentage for this product, or null if program is inactive.

Parameters:

  • value (Float, nil)

Returns:

  • (Float, nil)


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

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.

Parameters:

  • value (WhopSDK::Models::global_affiliate_status)

Returns:



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

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

#headlineString?

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

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

required :headline, String, nil?: true

#idString

The unique identifier for the product.

Parameters:

  • value (String)

Returns:

  • (String)


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

required :id, String

#member_affiliate_percentageFloat?

Member referral commission percentage for this product, or null if program is inactive.

Parameters:

  • value (Float, nil)

Returns:

  • (Float, nil)


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

required :member_affiliate_percentage, Float, nil?: true

#member_affiliate_statusSymbol, WhopSDK::Models::GlobalAffiliateStatus

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

Parameters:

  • value (WhopSDK::Models::global_affiliate_status)

Returns:



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

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

#member_countInteger

Active memberships for this product. Returns 0 if the account has disabled public member counts.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


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

required :member_count, Integer

#metadataHash{Symbol=>Object}?

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.

Parameters:

  • value (::Hash[Symbol, top], nil)

Returns:

  • (Hash{Symbol=>Object}, nil)


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

required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true

#owner_userWhopSDK::Models::Product::OwnerUser

The user who owns the company that sells this product.

Parameters:

  • value (WhopSDK::Product::OwnerUser)

Returns:



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

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.

Parameters:

  • value (WhopSDK::Product::ProductTaxCode, nil)

Returns:



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

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

#published_reviews_countInteger

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

Parameters:

  • value (Integer)

Returns:

  • (Integer)


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

required :published_reviews_count, Integer

#routeString

URL slug in the product's public link, e.g. pickaxe-analytics in whop.com/company/pickaxe-analytics.

Parameters:

  • value (String)

Returns:

  • (String)


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

required :route, String

#titleString

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

Parameters:

  • value (String)

Returns:

  • (String)


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

required :title, String

#updated_atTime

The datetime the product was last updated.

Parameters:

  • value (Time)

Returns:

  • (Time)


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

required :updated_at, Time

#verifiedBoolean

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

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


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

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.

Parameters:

  • value (WhopSDK::Models::visibility)

Returns:



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

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

Instance Method Details

#to_hash{

Returns:

  • ({)


107
# File 'sig/whop_sdk/models/product.rbs', line 107

def to_hash: -> {