Class: Recurly::Requests::CouponCreate
- Inherits:
-
Recurly::Request
- Object
- Recurly::Request
- Recurly::Requests::CouponCreate
- Defined in:
- lib/recurly/requests/coupon_create.rb
Instance Attribute Summary collapse
-
#applies_to_all_plans ⇒ Boolean
The coupon is valid for all plans if true.
-
#applies_to_non_plan_charges ⇒ Boolean
The coupon is valid for one-time, non-plan charges if true.
-
#code ⇒ String
The code the customer enters to redeem the coupon.
-
#coupon_type ⇒ String
Whether the coupon is “single_code” or “bulk”.
-
#currencies ⇒ Array[CouponPricing]
Fixed discount currencies by currency.
-
#discount_percent ⇒ Integer
The percent of the price discounted by the coupon.
-
#discount_type ⇒ String
The type of discount provided by the coupon (how the amount discounted is calculated).
-
#duration ⇒ String
This field does not apply when the discount_type is
free_trial. -
#free_trial_amount ⇒ Integer
Sets the duration of time the
free_trial_unitis for. -
#free_trial_unit ⇒ String
Description of the unit of time the coupon is for.
-
#hosted_description ⇒ String
This description will show up when a customer redeems a coupon on your Hosted Payment Pages, or if you choose to show the description on your own checkout page.
-
#invoice_description ⇒ String
Description of the coupon on the invoice.
-
#max_redemptions ⇒ Integer
A maximum number of redemptions for the coupon.
-
#max_redemptions_per_account ⇒ Integer
Redemptions per account is the number of times a specific account can redeem the coupon.
-
#name ⇒ String
The internal name for the coupon.
-
#plan_codes ⇒ Array[String]
List of plan codes to which this coupon applies.
-
#redeem_by_date ⇒ String
The date and time the coupon will expire and can no longer be redeemed.
-
#redemption_resource ⇒ String
Whether the discount is for all eligible charges on the account, or only a specific subscription.
-
#temporal_amount ⇒ Integer
If
durationis “temporal” thantemporal_amountis an integer which is multiplied bytemporal_unitto define the duration that the coupon will be applied to invoices for. -
#temporal_unit ⇒ String
If
durationis “temporal” thantemporal_unitis multiplied bytemporal_amountto define the duration that the coupon will be applied to invoices for. -
#unique_code_template ⇒ String
On a bulk coupon, the template from which unique coupon codes are generated.
Attributes inherited from Recurly::Request
Method Summary
Methods inherited from Recurly::Request
Methods included from Schema::SchemaFactory
Methods included from Schema::RequestCaster
Methods included from Schema::ResourceCaster
Methods included from Schema::SchemaValidator
#get_did_you_mean, #validate!, #validate_attribute!
Instance Attribute Details
#applies_to_all_plans ⇒ Boolean
Returns The coupon is valid for all plans if true. If false then plans and plans_names will list the applicable plans.
11 |
# File 'lib/recurly/requests/coupon_create.rb', line 11 define_attribute :applies_to_all_plans, :Boolean |
#applies_to_non_plan_charges ⇒ Boolean
Returns The coupon is valid for one-time, non-plan charges if true.
15 |
# File 'lib/recurly/requests/coupon_create.rb', line 15 define_attribute :applies_to_non_plan_charges, :Boolean |
#code ⇒ String
Returns The code the customer enters to redeem the coupon.
19 |
# File 'lib/recurly/requests/coupon_create.rb', line 19 define_attribute :code, String |
#coupon_type ⇒ String
Returns Whether the coupon is “single_code” or “bulk”. Bulk coupons will require a unique_code_template and will generate unique codes through the /generate endpoint.
23 |
# File 'lib/recurly/requests/coupon_create.rb', line 23 define_attribute :coupon_type, String |
#currencies ⇒ Array[CouponPricing]
Returns Fixed discount currencies by currency. Required if the coupon type is fixed. This parameter should contain the coupon discount values.
27 |
# File 'lib/recurly/requests/coupon_create.rb', line 27 define_attribute :currencies, Array, { :item_type => :CouponPricing } |
#discount_percent ⇒ Integer
Returns The percent of the price discounted by the coupon. Required if discount_type is percent.
31 |
# File 'lib/recurly/requests/coupon_create.rb', line 31 define_attribute :discount_percent, Integer |
#discount_type ⇒ String
Returns The type of discount provided by the coupon (how the amount discounted is calculated).
35 |
# File 'lib/recurly/requests/coupon_create.rb', line 35 define_attribute :discount_type, String |
#duration ⇒ String
Returns This field does not apply when the discount_type is free_trial. - “single_use” coupons applies to the first invoice only. - “temporal” coupons will apply to invoices for the duration determined by the temporal_unit and temporal_amount attributes. - “forever” coupons will apply to invoices forever.
39 |
# File 'lib/recurly/requests/coupon_create.rb', line 39 define_attribute :duration, String |
#free_trial_amount ⇒ Integer
Returns Sets the duration of time the free_trial_unit is for. Required if discount_type is free_trial.
43 |
# File 'lib/recurly/requests/coupon_create.rb', line 43 define_attribute :free_trial_amount, Integer |
#free_trial_unit ⇒ String
Returns Description of the unit of time the coupon is for. Used with free_trial_amount to determine the duration of time the coupon is for. Required if discount_type is free_trial.
47 |
# File 'lib/recurly/requests/coupon_create.rb', line 47 define_attribute :free_trial_unit, String |
#hosted_description ⇒ String
Returns This description will show up when a customer redeems a coupon on your Hosted Payment Pages, or if you choose to show the description on your own checkout page.
51 |
# File 'lib/recurly/requests/coupon_create.rb', line 51 define_attribute :hosted_description, String |
#invoice_description ⇒ String
Returns Description of the coupon on the invoice.
55 |
# File 'lib/recurly/requests/coupon_create.rb', line 55 define_attribute :invoice_description, String |
#max_redemptions ⇒ Integer
Returns A maximum number of redemptions for the coupon. The coupon will expire when it hits its maximum redemptions.
59 |
# File 'lib/recurly/requests/coupon_create.rb', line 59 define_attribute :max_redemptions, Integer |
#max_redemptions_per_account ⇒ Integer
Returns Redemptions per account is the number of times a specific account can redeem the coupon. Set redemptions per account to 1 if you want to keep customers from gaming the system and getting more than one discount from the coupon campaign.
63 |
# File 'lib/recurly/requests/coupon_create.rb', line 63 define_attribute :max_redemptions_per_account, Integer |
#name ⇒ String
Returns The internal name for the coupon.
67 |
# File 'lib/recurly/requests/coupon_create.rb', line 67 define_attribute :name, String |
#plan_codes ⇒ Array[String]
Returns List of plan codes to which this coupon applies. See applies_to_all_plans.
71 |
# File 'lib/recurly/requests/coupon_create.rb', line 71 define_attribute :plan_codes, Array, { :item_type => String } |
#redeem_by_date ⇒ String
Returns The date and time the coupon will expire and can no longer be redeemed. Time is always 11:59:59, the end-of-day Pacific time.
75 |
# File 'lib/recurly/requests/coupon_create.rb', line 75 define_attribute :redeem_by_date, String |
#redemption_resource ⇒ String
Returns Whether the discount is for all eligible charges on the account, or only a specific subscription.
79 |
# File 'lib/recurly/requests/coupon_create.rb', line 79 define_attribute :redemption_resource, String |
#temporal_amount ⇒ Integer
Returns If duration is “temporal” than temporal_amount is an integer which is multiplied by temporal_unit to define the duration that the coupon will be applied to invoices for.
83 |
# File 'lib/recurly/requests/coupon_create.rb', line 83 define_attribute :temporal_amount, Integer |
#temporal_unit ⇒ String
Returns If duration is “temporal” than temporal_unit is multiplied by temporal_amount to define the duration that the coupon will be applied to invoices for.
87 |
# File 'lib/recurly/requests/coupon_create.rb', line 87 define_attribute :temporal_unit, String |
#unique_code_template ⇒ String
Returns On a bulk coupon, the template from which unique coupon codes are generated. - You must start the template with your coupon_code wrapped in single quotes. - Outside of single quotes, use a 9 for a character that you want to be a random number. - Outside of single quotes, use an “x” for a character that you want to be a random letter. - Outside of single quotes, use an * for a character that you want to be a random number or letter. - Use single quotes ‘ ’ for characters that you want to remain static. These strings can be alphanumeric and may contain a - _ or +. For example: “‘abc-’****‘-def’”.
91 |
# File 'lib/recurly/requests/coupon_create.rb', line 91 define_attribute :unique_code_template, String |