Class: Recurly::Resources::Coupon

Inherits:
Recurly::Resource show all
Defined in:
lib/recurly/resources/coupon.rb

Instance Attribute Summary collapse

Attributes inherited from Recurly::Resource

#attributes

Method Summary

Methods inherited from Recurly::Resource

#==, #get_response, #inspect, #requires_client?, #to_json, #to_s

Methods included from Schema::SchemaFactory

#schema

Methods included from Schema::ResourceCaster

#cast

Methods included from Schema::SchemaValidator

#get_did_you_mean, #validate!, #validate_attribute!

Instance Attribute Details

#applies_to_all_items ⇒ Boolean

Returns The coupon is valid for all items if true. If false then items will list the applicable items.

Returns:

  • (Boolean) —

    The coupon is valid for all items if true. If false then items will list the applicable items.



11
# File 'lib/recurly/resources/coupon.rb', line 11

define_attribute :applies_to_all_items, :Boolean

#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.

Returns:

  • (Boolean) —

    The coupon is valid for all plans if true. If false then plans and plans_names will list the applicable plans.



15
# File 'lib/recurly/resources/coupon.rb', line 15

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.

Returns:

  • (Boolean) —

    The coupon is valid for one-time, non-plan charges if true.



19
# File 'lib/recurly/resources/coupon.rb', line 19

define_attribute :applies_to_non_plan_charges, :Boolean

#bulk_coupon_code ⇒ String

Returns The Coupon code of the parent Bulk Coupon.

Returns:

  • (String) —

    The Coupon code of the parent Bulk Coupon



23
# File 'lib/recurly/resources/coupon.rb', line 23

define_attribute :bulk_coupon_code, String

#bulk_coupon_id ⇒ String

Returns The Coupon ID of the parent Bulk Coupon.

Returns:

  • (String) —

    The Coupon ID of the parent Bulk Coupon



27
# File 'lib/recurly/resources/coupon.rb', line 27

define_attribute :bulk_coupon_id, String

#code ⇒ String

Returns The code the customer enters to redeem the coupon.

Returns:

  • (String) —

    The code the customer enters to redeem the coupon.



31
# File 'lib/recurly/resources/coupon.rb', line 31

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.

Returns:

  • (String) —

    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.



35
# File 'lib/recurly/resources/coupon.rb', line 35

define_attribute :coupon_type, String

#created_at ⇒ DateTime

Returns Created at.

Returns:

  • (DateTime) —

    Created at



39
# File 'lib/recurly/resources/coupon.rb', line 39

define_attribute :created_at, DateTime

#discount ⇒ CouponDiscount

Returns Details of the discount a coupon applies. Will contain a type property and one of the following properties: percent, fixed, trial.

Returns:

  • (CouponDiscount) —

    Details of the discount a coupon applies. Will contain a type property and one of the following properties: percent, fixed, trial.



43
# File 'lib/recurly/resources/coupon.rb', line 43

define_attribute :discount, :CouponDiscount

#duration ⇒ String

Returns - "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.

Returns:

  • (String) —
    • "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.


47
# File 'lib/recurly/resources/coupon.rb', line 47

define_attribute :duration, String

#expired_at ⇒ DateTime

Returns The date and time the coupon was expired early or reached its max_redemptions.

Returns:

  • (DateTime) —

    The date and time the coupon was expired early or reached its max_redemptions.



51
# File 'lib/recurly/resources/coupon.rb', line 51

define_attribute :expired_at, DateTime

#free_trial_amount ⇒ Integer

Returns Sets the duration of time the free_trial_unit is for.

Returns:

  • (Integer) —

    Sets the duration of time the free_trial_unit is for.



55
# File 'lib/recurly/resources/coupon.rb', line 55

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.

Returns:

  • (String) —

    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.



59
# File 'lib/recurly/resources/coupon.rb', line 59

define_attribute :free_trial_unit, String

#hosted_page_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.

Returns:

  • (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.



63
# File 'lib/recurly/resources/coupon.rb', line 63

define_attribute :hosted_page_description, String

#id ⇒ String

Returns Coupon ID.

Returns:

  • (String) —

    Coupon ID



67
# File 'lib/recurly/resources/coupon.rb', line 67

define_attribute :id, String

#invoice_description ⇒ String

Returns Description of the coupon on the invoice.

Returns:

  • (String) —

    Description of the coupon on the invoice.



71
# File 'lib/recurly/resources/coupon.rb', line 71

define_attribute :invoice_description, String

#items ⇒ Array[ItemMini]

Returns A list of items for which this coupon applies. This will be null if applies_to_all_items=true.

Returns:

  • (Array[ItemMini]) —

    A list of items for which this coupon applies. This will be null if applies_to_all_items=true.



75
# File 'lib/recurly/resources/coupon.rb', line 75

define_attribute :items, Array, { :item_type => :ItemMini }

#max_redemptions ⇒ Integer

Returns A maximum number of redemptions for the coupon. The coupon will expire when it hits its maximum redemptions.

Returns:

  • (Integer) —

    A maximum number of redemptions for the coupon. The coupon will expire when it hits its maximum redemptions.



79
# File 'lib/recurly/resources/coupon.rb', line 79

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.

Returns:

  • (Integer) —

    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.



83
# File 'lib/recurly/resources/coupon.rb', line 83

define_attribute :max_redemptions_per_account, Integer

#name ⇒ String

Returns The internal name for the coupon.

Returns:

  • (String) —

    The internal name for the coupon.



87
# File 'lib/recurly/resources/coupon.rb', line 87

define_attribute :name, String

#object ⇒ String

Returns Object type.

Returns:

  • (String) —

    Object type



91
# File 'lib/recurly/resources/coupon.rb', line 91

define_attribute :object, String

#plans ⇒ Array[PlanMini]

Returns A list of plans for which this coupon applies. This will be null if applies_to_all_plans=true.

Returns:

  • (Array[PlanMini]) —

    A list of plans for which this coupon applies. This will be null if applies_to_all_plans=true.



95
# File 'lib/recurly/resources/coupon.rb', line 95

define_attribute :plans, Array, { :item_type => :PlanMini }

#plans_names ⇒ Array[String]

Returns A list of plan names for which this coupon applies.

Returns:

  • (Array[String]) —

    A list of plan names for which this coupon applies.



99
# File 'lib/recurly/resources/coupon.rb', line 99

define_attribute :plans_names, Array, { :item_type => String }

#redeem_by ⇒ DateTime

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.

Returns:

  • (DateTime) —

    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.



103
# File 'lib/recurly/resources/coupon.rb', line 103

define_attribute :redeem_by, DateTime

#redeemed_at ⇒ DateTime

Returns The date and time the unique coupon code was redeemed. This is only present for bulk coupons.

Returns:

  • (DateTime) —

    The date and time the unique coupon code was redeemed. This is only present for bulk coupons.



107
# File 'lib/recurly/resources/coupon.rb', line 107

define_attribute :redeemed_at, DateTime

#redemption_resource ⇒ String

Returns Whether the discount is for all eligible charges on the account, or only a specific subscription.

Returns:

  • (String) —

    Whether the discount is for all eligible charges on the account, or only a specific subscription.



111
# File 'lib/recurly/resources/coupon.rb', line 111

define_attribute :redemption_resource, String

#state ⇒ String

Returns Indicates if the coupon is redeemable, and if it is not, why.

Returns:

  • (String) —

    Indicates if the coupon is redeemable, and if it is not, why.



115
# File 'lib/recurly/resources/coupon.rb', line 115

define_attribute :state, 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.

Returns:

  • (Integer) —

    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.



119
# File 'lib/recurly/resources/coupon.rb', line 119

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.

Returns:

  • (String) —

    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.



123
# File 'lib/recurly/resources/coupon.rb', line 123

define_attribute :temporal_unit, String

#unique_code_template ⇒ String

Returns On a bulk coupon, the template from which unique coupon codes are generated.

Returns:

  • (String) —

    On a bulk coupon, the template from which unique coupon codes are generated.



127
# File 'lib/recurly/resources/coupon.rb', line 127

define_attribute :unique_code_template, String

#unique_coupon_codes_count ⇒ Integer

Returns When this number reaches max_redemptions the coupon will no longer be redeemable.

Returns:

  • (Integer) —

    When this number reaches max_redemptions the coupon will no longer be redeemable.



131
# File 'lib/recurly/resources/coupon.rb', line 131

define_attribute :unique_coupon_codes_count, Integer

#updated_at ⇒ DateTime

Returns Last updated at.

Returns:

  • (DateTime) —

    Last updated at



135
# File 'lib/recurly/resources/coupon.rb', line 135

define_attribute :updated_at, DateTime