Class: WhopSDK::Models::PromoCodeCreateParams

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/whop_sdk/models/promo_code_create_params.rb

Overview

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

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(amount_off: , base_currency: , code: , company_id: , new_users_only: , promo_duration_months: , promo_type: , churned_users_only: nil, existing_memberships_only: nil, expires_at: nil, one_per_customer: nil, plan_ids: nil, product_id: nil, stock: nil, unlimited_stock: nil, request_options: {}) ⇒ Object

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

Parameters:

  • amount_off (Float) (defaults to: )

    The amount off (% or flat amount) for the promo.

  • base_currency (Symbol, WhopSDK::Models::Currency) (defaults to: )

    The monetary currency of the promo code.

  • code (String) (defaults to: )

    The specific code used to apply the promo at checkout.

  • company_id (String) (defaults to: )

    The id of the company to create the promo code for.

  • new_users_only (Boolean) (defaults to: )

    Restricts promo use to only users who have never purchased from the company befo

  • promo_duration_months (Integer) (defaults to: )

    The number of months this promo code is applied and valid for.

  • promo_type (Symbol, WhopSDK::Models::PromoType) (defaults to: )

    The type (% or flat amount) of the promo.

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

    Restricts promo use to only users who have churned from the company before.

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

    Whether this promo code is for existing memberships only (cancelations)

  • expires_at (Time, nil) (defaults to: nil)

    The date/time of when the promo expires.

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

    Restricts promo use to only be applied once per customer.

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

    The IDs of the plans that the promo code applies to. If product_id is provided,

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

    The product to lock the promo code to, if any. If provided will filter out any p

  • stock (Integer, nil) (defaults to: nil)

    The quantity limit on the number of uses.

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

    Whether or not the promo code should have unlimited stock.

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


# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 103

Instance Attribute Details

#amount_offFloat

The amount off (% or flat amount) for the promo.

Returns:

  • (Float)


14
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 14

required :amount_off, Float

#base_currencySymbol, WhopSDK::Models::Currency

The monetary currency of the promo code.

Returns:



20
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 20

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

#churned_users_onlyBoolean?

Restricts promo use to only users who have churned from the company before.

Returns:

  • (Boolean, nil)


57
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 57

optional :churned_users_only, WhopSDK::Internal::Type::Boolean, nil?: true

#codeString

The specific code used to apply the promo at checkout.

Returns:

  • (String)


26
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 26

required :code, String

#company_idString

The id of the company to create the promo code for.

Returns:

  • (String)


32
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 32

required :company_id, String

#existing_memberships_onlyBoolean?

Whether this promo code is for existing memberships only (cancelations)

Returns:

  • (Boolean, nil)


63
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 63

optional :existing_memberships_only, WhopSDK::Internal::Type::Boolean, nil?: true

#expires_atTime?

The date/time of when the promo expires.

Returns:

  • (Time, nil)


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

optional :expires_at, Time, nil?: true

#new_users_onlyBoolean

Restricts promo use to only users who have never purchased from the company before.

Returns:

  • (Boolean)


39
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 39

required :new_users_only, WhopSDK::Internal::Type::Boolean

#one_per_customerBoolean?

Restricts promo use to only be applied once per customer.

Returns:

  • (Boolean, nil)


75
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 75

optional :one_per_customer, WhopSDK::Internal::Type::Boolean, nil?: true

#plan_idsArray<String>?

The IDs of the plans that the promo code applies to. If product_id is provided, it will only apply to plans attached to that product

Returns:

  • (Array<String>, nil)


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

optional :plan_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true

#product_idString?

The product to lock the promo code to, if any. If provided will filter out any plan ids not attached to this product

Returns:

  • (String, nil)


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

optional :product_id, String, nil?: true

#promo_duration_monthsInteger

The number of months this promo code is applied and valid for.

Returns:

  • (Integer)


45
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 45

required :promo_duration_months, Integer

#promo_typeSymbol, WhopSDK::Models::PromoType

The type (% or flat amount) of the promo.

Returns:



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

required :promo_type, enum: -> { WhopSDK::PromoType }

#stockInteger?

The quantity limit on the number of uses.

Returns:

  • (Integer, nil)


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

optional :stock, Integer, nil?: true

#unlimited_stockBoolean?

Whether or not the promo code should have unlimited stock.

Returns:

  • (Boolean, nil)


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

optional :unlimited_stock, WhopSDK::Internal::Type::Boolean, nil?: true