Class: WhopSDK::Models::PromoCodeCreateParams
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- WhopSDK::Models::PromoCodeCreateParams
- 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
-
#amount_off ⇒ Float
The discount amount.
-
#base_currency ⇒ Symbol, WhopSDK::Models::Currency
The three-letter ISO currency code for the promo code discount.
-
#churned_users_only ⇒ Boolean?
Whether to restrict this promo code to only users who have previously churned from the company.
-
#code ⇒ String
The alphanumeric code customers enter at checkout to apply the discount.
-
#company_id ⇒ String
The unique identifier of the company to create this promo code for.
-
#existing_memberships_only ⇒ Boolean?
Whether this promo code can only be applied to existing memberships, such as for cancellation retention offers.
-
#expires_at ⇒ Time?
The datetime when the promo code expires and can no longer be used.
-
#new_users_only ⇒ Boolean
Whether to restrict this promo code to only users who have never purchased from the company before.
-
#one_per_customer ⇒ Boolean?
Whether each customer can only use this promo code once.
-
#plan_ids ⇒ Array<String>?
The identifiers of plans this promo code applies to.
-
#product_id ⇒ String?
The identifier of the product to scope this promo code to.
-
#promo_duration_months ⇒ Integer
The number of billing months the discount remains active.
-
#promo_type ⇒ Symbol, WhopSDK::Models::PromoType
The discount type, either percentage or flat_amount.
-
#stock ⇒ Integer?
The maximum number of times this promo code can be used.
-
#unlimited_stock ⇒ Boolean?
Whether the promo code can be used an unlimited number of times.
Attributes included from Internal::Type::RequestParameters
Instance Method Summary collapse
-
#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
constructor
Some parameter documentations has been truncated, see PromoCodeCreateParams for more details.
Methods included from Internal::Type::RequestParameters::Converter
Methods included from Internal::Type::RequestParameters
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.
unlimited_
|
|
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 110
|
Instance Attribute Details
#amount_off ⇒ Float
The discount amount. When promo_type is percentage, this is the percent off (e.g., 20 for 20% off). When promo_type is flat_amount, this is the currency amount off (e.g., 10.00 for $10.00 off).
16 |
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 16 required :amount_off, Float |
#base_currency ⇒ Symbol, WhopSDK::Models::Currency
The three-letter ISO currency code for the promo code discount.
22 |
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 22 required :base_currency, enum: -> { WhopSDK::Currency } |
#churned_users_only ⇒ Boolean?
Whether to restrict this promo code to only users who have previously churned from the company.
61 |
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 61 optional :churned_users_only, WhopSDK::Internal::Type::Boolean, nil?: true |
#code ⇒ String
The alphanumeric code customers enter at checkout to apply the discount.
28 |
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 28 required :code, String |
#company_id ⇒ String
The unique identifier of the company to create this promo code for.
34 |
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 34 required :company_id, String |
#existing_memberships_only ⇒ Boolean?
Whether this promo code can only be applied to existing memberships, such as for cancellation retention offers.
68 |
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 68 optional :existing_memberships_only, WhopSDK::Internal::Type::Boolean, nil?: true |
#expires_at ⇒ Time?
The datetime when the promo code expires and can no longer be used. Null means it never expires.
75 |
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 75 optional :expires_at, Time, nil?: true |
#new_users_only ⇒ Boolean
Whether to restrict this promo code to only users who have never purchased from the company before.
41 |
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 41 required :new_users_only, WhopSDK::Internal::Type::Boolean |
#one_per_customer ⇒ Boolean?
Whether each customer can only use this promo code once.
81 |
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 81 optional :one_per_customer, WhopSDK::Internal::Type::Boolean, nil?: true |
#plan_ids ⇒ Array<String>?
The identifiers of plans this promo code applies to. When product_id is also provided, only plans attached to that product are included.
88 |
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 88 optional :plan_ids, WhopSDK::Internal::Type::ArrayOf[String], nil?: true |
#product_id ⇒ String?
The identifier of the product to scope this promo code to. When provided, the promo code only applies to plans attached to this product.
95 |
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 95 optional :product_id, String, nil?: true |
#promo_duration_months ⇒ Integer
The number of billing months the discount remains active. For example, 3 means the discount applies to the first 3 billing cycles.
48 |
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 48 required :promo_duration_months, Integer |
#promo_type ⇒ Symbol, WhopSDK::Models::PromoType
The discount type, either percentage or flat_amount.
54 |
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 54 required :promo_type, enum: -> { WhopSDK::PromoType } |
#stock ⇒ Integer?
The maximum number of times this promo code can be used. Ignored when unlimited_stock is true.
102 |
# File 'lib/whop_sdk/models/promo_code_create_params.rb', line 102 optional :stock, Integer, nil?: true |