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_itemsBoolean

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_plansBoolean

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

Returns:

  • (Boolean)

    The coupon is valid for all plans if true. If false then ‘plans` 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_chargesBoolean

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

#codeString

Returns The code the customer enters to redeem the coupon.

Returns:

  • (String)

    The code the customer enters to redeem the coupon.



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

define_attribute :code, String

#coupon_typeString

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.



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

define_attribute :coupon_type, String

#created_atDateTime

Returns Created at.

Returns:

  • (DateTime)

    Created at



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

define_attribute :created_at, DateTime

#discountCouponDiscount

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



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

define_attribute :discount, :CouponDiscount

#durationString

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.



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

define_attribute :duration, String

#expired_atDateTime

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



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

define_attribute :expired_at, DateTime

#free_trial_amountInteger

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.



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

define_attribute :free_trial_amount, Integer

#free_trial_unitString

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.



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

define_attribute :free_trial_unit, String

#hosted_page_descriptionString

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.



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

define_attribute :hosted_page_description, String

#idString

Returns Coupon ID.

Returns:

  • (String)

    Coupon ID



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

define_attribute :id, String

#invoice_descriptionString

Returns Description of the coupon on the invoice.

Returns:

  • (String)

    Description of the coupon on the invoice.



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

define_attribute :invoice_description, String

#itemsArray[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`.



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

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

#max_redemptionsInteger

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.



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

define_attribute :max_redemptions, Integer

#max_redemptions_per_accountInteger

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.



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

define_attribute :max_redemptions_per_account, Integer

#nameString

Returns The internal name for the coupon.

Returns:

  • (String)

    The internal name for the coupon.



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

define_attribute :name, String

#objectString

Returns Object type.

Returns:

  • (String)

    Object type



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

define_attribute :object, String

#plansArray[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`.



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

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

#redeem_byDateTime

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.



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

define_attribute :redeem_by, DateTime

#redemption_resourceString

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.



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

define_attribute :redemption_resource, String

#stateString

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.



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

define_attribute :state, String

#temporal_amountInteger

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.



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

define_attribute :temporal_amount, Integer

#temporal_unitString

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.



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

define_attribute :temporal_unit, String

#unique_code_templateString

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.



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

define_attribute :unique_code_template, String

#unique_coupon_codeHash

Returns Will be populated when the Coupon being returned is a ‘UniqueCouponCode`.

Returns:

  • (Hash)

    Will be populated when the Coupon being returned is a ‘UniqueCouponCode`.



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

define_attribute :unique_coupon_code, Hash

#unique_coupon_codes_countInteger

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.



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

define_attribute :unique_coupon_codes_count, Integer

#updated_atDateTime

Returns Last updated at.

Returns:

  • (DateTime)

    Last updated at



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

define_attribute :updated_at, DateTime