Class: WhopSDK::Models::ProductCreateParams::PlanOptions

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

Defined Under Namespace

Classes: CustomField

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(company_id:, title:, collect_shipping_address: nil, custom_cta: nil, custom_cta_url: nil, custom_statement_descriptor: nil, description: nil, experience_ids: nil, global_affiliate_percentage: nil, global_affiliate_status: nil, headline: nil, member_affiliate_percentage: nil, member_affiliate_status: nil, plan_options: nil, product_tax_code_id: nil, redirect_purchase_url: nil, route: nil, send_welcome_message: nil, visibility: nil, request_options: {}) ⇒ Object

Some parameter documentations has been truncated, see WhopSDK::Models::ProductCreateParams for more details.

Parameters:

  • company_id (String)

    The unique identifier of the company to create this product for.

  • title (String)

    The display name of the product. Maximum 80 characters.

  • collect_shipping_address (Boolean, nil) (defaults to: nil)

    Whether the checkout flow collects a shipping address from the customer.

  • custom_cta (Symbol, WhopSDK::Models::CustomCta, nil) (defaults to: nil)

    The different types of custom CTAs that can be selected.

  • custom_cta_url (String, nil) (defaults to: nil)

    A URL that the call-to-action button links to instead of the default checkout fl

  • custom_statement_descriptor (String, nil) (defaults to: nil)

    A custom text label that appears on the customer’s bank statement. Must be 5-22

  • description (String, nil) (defaults to: nil)

    A written description of the product displayed on its product page.

  • experience_ids (Array<String>, nil) (defaults to: nil)

    The unique identifiers of experiences to connect to this product.

  • global_affiliate_percentage (Float, nil) (defaults to: nil)

    The commission rate as a percentage that affiliates earn through the global affi

  • global_affiliate_status (Symbol, WhopSDK::Models::GlobalAffiliateStatus, nil) (defaults to: nil)

    The different statuses of the global affiliate program for a product.

  • headline (String, nil) (defaults to: nil)

    A short marketing headline displayed prominently on the product page.

  • member_affiliate_percentage (Float, nil) (defaults to: nil)

    The commission rate as a percentage that members earn through the member affilia

  • member_affiliate_status (Symbol, WhopSDK::Models::GlobalAffiliateStatus, nil) (defaults to: nil)

    The different statuses of the global affiliate program for a product.

  • plan_options (WhopSDK::Models::ProductCreateParams::PlanOptions, nil) (defaults to: nil)

    Configuration for an automatically generated plan to attach to this product.

  • product_tax_code_id (String, nil) (defaults to: nil)

    The unique identifier of the tax classification code to apply to this product.

  • redirect_purchase_url (String, nil) (defaults to: nil)

    A URL to redirect the customer to after completing a purchase.

  • route (String, nil) (defaults to: nil)

    The URL slug for the product’s public link.

  • send_welcome_message (Boolean, nil) (defaults to: nil)

    Whether to send an automated welcome message via support chat when a user joins

  • visibility (Symbol, WhopSDK::Models::Visibility, nil) (defaults to: nil)

    Visibility of a resource

  • request_options (WhopSDK::RequestOptions, Hash{Symbol=>Object}) (defaults to: {})


174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'lib/whop_sdk/models/product_create_params.rb', line 174

class PlanOptions < WhopSDK::Internal::Type::BaseModel
  # @!attribute base_currency
  #   The available currencies on the platform
  #
  #   @return [Symbol, WhopSDK::Models::Currency, nil]
  optional :base_currency, enum: -> { WhopSDK::Currency }, nil?: true

  # @!attribute billing_period
  #   The interval at which the plan charges (renewal plans).
  #
  #   @return [Integer, nil]
  optional :billing_period, Integer, nil?: true

  # @!attribute custom_fields
  #   An array of custom field objects.
  #
  #   @return [Array<WhopSDK::Models::ProductCreateParams::PlanOptions::CustomField>, nil]
  optional :custom_fields,
           -> {
             WhopSDK::Internal::Type::ArrayOf[WhopSDK::ProductCreateParams::PlanOptions::CustomField]
           },
           nil?: true

  # @!attribute initial_price
  #   An additional amount charged upon first purchase. Provided as a number in the
  #   specified currency. Eg: 10.43 for $10.43 USD.
  #
  #   @return [Float, nil]
  optional :initial_price, Float, nil?: true

  # @!attribute plan_type
  #   The type of plan that can be attached to a product
  #
  #   @return [Symbol, WhopSDK::Models::PlanType, nil]
  optional :plan_type, enum: -> { WhopSDK::PlanType }, nil?: true

  # @!attribute release_method
  #   The methods of how a plan can be released.
  #
  #   @return [Symbol, WhopSDK::Models::ReleaseMethod, nil]
  optional :release_method, enum: -> { WhopSDK::ReleaseMethod }, nil?: true

  # @!attribute renewal_price
  #   The amount the customer is charged every billing period. Provided as a number in
  #   the specified currency. Eg: 10.43 for $10.43 USD.
  #
  #   @return [Float, nil]
  optional :renewal_price, Float, nil?: true

  # @!attribute visibility
  #   Visibility of a resource
  #
  #   @return [Symbol, WhopSDK::Models::Visibility, nil]
  optional :visibility, enum: -> { WhopSDK::Visibility }, nil?: true

  # @!method initialize(base_currency: nil, billing_period: nil, custom_fields: nil, initial_price: nil, plan_type: nil, release_method: nil, renewal_price: nil, visibility: nil)
  #   Some parameter documentations has been truncated, see
  #   {WhopSDK::Models::ProductCreateParams::PlanOptions} for more details.
  #
  #   Configuration for an automatically generated plan to attach to this product.
  #
  #   @param base_currency [Symbol, WhopSDK::Models::Currency, nil] The available currencies on the platform
  #
  #   @param billing_period [Integer, nil] The interval at which the plan charges (renewal plans).
  #
  #   @param custom_fields [Array<WhopSDK::Models::ProductCreateParams::PlanOptions::CustomField>, nil] An array of custom field objects.
  #
  #   @param initial_price [Float, nil] An additional amount charged upon first purchase. Provided as a number in the sp
  #
  #   @param plan_type [Symbol, WhopSDK::Models::PlanType, nil] The type of plan that can be attached to a product
  #
  #   @param release_method [Symbol, WhopSDK::Models::ReleaseMethod, nil] The methods of how a plan can be released.
  #
  #   @param renewal_price [Float, nil] The amount the customer is charged every billing period. Provided as a number in
  #
  #   @param visibility [Symbol, WhopSDK::Models::Visibility, nil] Visibility of a resource

  class CustomField < WhopSDK::Internal::Type::BaseModel
    # @!attribute field_type
    #   The type of the custom field.
    #
    #   @return [Symbol, :text]
    required :field_type, const: :text

    # @!attribute name
    #   The name of the custom field.
    #
    #   @return [String]
    required :name, String

    # @!attribute id
    #   The ID of the custom field (if being updated)
    #
    #   @return [String, nil]
    optional :id, String, nil?: true

    # @!attribute order
    #   The order of the field.
    #
    #   @return [Integer, nil]
    optional :order, Integer, nil?: true

    # @!attribute placeholder
    #   The placeholder value of the field.
    #
    #   @return [String, nil]
    optional :placeholder, String, nil?: true

    # @!attribute required
    #   Whether or not the field is required.
    #
    #   @return [Boolean, nil]
    optional :required, WhopSDK::Internal::Type::Boolean, nil?: true

    # @!method initialize(name:, id: nil, order: nil, placeholder: nil, required: nil, field_type: :text)
    #   @param name [String] The name of the custom field.
    #
    #   @param id [String, nil] The ID of the custom field (if being updated)
    #
    #   @param order [Integer, nil] The order of the field.
    #
    #   @param placeholder [String, nil] The placeholder value of the field.
    #
    #   @param required [Boolean, nil] Whether or not the field is required.
    #
    #   @param field_type [Symbol, :text] The type of the custom field.
  end
end

Instance Attribute Details

#base_currencySymbol, ...

The available currencies on the platform

Returns:



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

optional :base_currency, enum: -> { WhopSDK::Currency }, nil?: true

#billing_periodInteger?

The interval at which the plan charges (renewal plans).

Returns:

  • (Integer, nil)


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

optional :billing_period, Integer, nil?: true

#custom_fieldsArray<WhopSDK::Models::ProductCreateParams::PlanOptions::CustomField>?

An array of custom field objects.



191
192
193
194
195
# File 'lib/whop_sdk/models/product_create_params.rb', line 191

optional :custom_fields,
-> {
  WhopSDK::Internal::Type::ArrayOf[WhopSDK::ProductCreateParams::PlanOptions::CustomField]
},
nil?: true

#initial_priceFloat?

An additional amount charged upon first purchase. Provided as a number in the specified currency. Eg: 10.43 for $10.43 USD.

Returns:

  • (Float, nil)


202
# File 'lib/whop_sdk/models/product_create_params.rb', line 202

optional :initial_price, Float, nil?: true

#plan_typeSymbol, ...

The type of plan that can be attached to a product

Returns:



208
# File 'lib/whop_sdk/models/product_create_params.rb', line 208

optional :plan_type, enum: -> { WhopSDK::PlanType }, nil?: true

#release_methodSymbol, ...

The methods of how a plan can be released.

Returns:



214
# File 'lib/whop_sdk/models/product_create_params.rb', line 214

optional :release_method, enum: -> { WhopSDK::ReleaseMethod }, nil?: true

#renewal_priceFloat?

The amount the customer is charged every billing period. Provided as a number in the specified currency. Eg: 10.43 for $10.43 USD.

Returns:

  • (Float, nil)


221
# File 'lib/whop_sdk/models/product_create_params.rb', line 221

optional :renewal_price, Float, nil?: true

#visibilitySymbol, ...

Visibility of a resource

Returns:



227
# File 'lib/whop_sdk/models/product_create_params.rb', line 227

optional :visibility, enum: -> { WhopSDK::Visibility }, nil?: true