Class: Recurly::Requests::CouponCreate

Inherits:
Recurly::Request show all
Defined in:
lib/recurly/requests/coupon_create.rb

Instance Attribute Summary collapse

Attributes inherited from Recurly::Request

#attributes

Method Summary

Methods inherited from Recurly::Request

#==, #to_s

Methods included from Schema::SchemaFactory

#schema

Methods included from Schema::RequestCaster

#cast_request

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 To apply coupon to Items in your Catalog, include a list of ‘item_codes` in the request that the coupon will apply to. Or set value to true to apply to all Items in your Catalog. The following values are not permitted when `applies_to_all_items` is included: `free_trial_amount` and `free_trial_unit`.

Returns:

  • (Boolean)

    To apply coupon to Items in your Catalog, include a list of ‘item_codes` in the request that the coupon will apply to. Or set value to true to apply to all Items in your Catalog. The following values are not permitted when `applies_to_all_items` is included: `free_trial_amount` and `free_trial_unit`.



11
# File 'lib/recurly/requests/coupon_create.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/requests/coupon_create.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/requests/coupon_create.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/requests/coupon_create.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/requests/coupon_create.rb', line 27

define_attribute :coupon_type, String

#currenciesArray[CouponPricing]

Returns Fixed discount currencies by currency. Required if the coupon type is ‘fixed`. This parameter should contain the coupon discount values.

Returns:

  • (Array[CouponPricing])

    Fixed discount currencies by currency. Required if the coupon type is ‘fixed`. This parameter should contain the coupon discount values



31
# File 'lib/recurly/requests/coupon_create.rb', line 31

define_attribute :currencies, Array, { :item_type => :CouponPricing }

#discount_percentInteger

Returns The percent of the price discounted by the coupon. Required if ‘discount_type` is `percent`.

Returns:

  • (Integer)

    The percent of the price discounted by the coupon. Required if ‘discount_type` is `percent`.



35
# File 'lib/recurly/requests/coupon_create.rb', line 35

define_attribute :discount_percent, Integer

#discount_typeString

Returns The type of discount provided by the coupon (how the amount discounted is calculated).

Returns:

  • (String)

    The type of discount provided by the coupon (how the amount discounted is calculated)



39
# File 'lib/recurly/requests/coupon_create.rb', line 39

define_attribute :discount_type, String

#durationString

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.

Returns:

  • (String)

    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.



43
# File 'lib/recurly/requests/coupon_create.rb', line 43

define_attribute :duration, String

#free_trial_amountInteger

Returns Sets the duration of time the ‘free_trial_unit` is for. Required if `discount_type` is `free_trial`.

Returns:

  • (Integer)

    Sets the duration of time the ‘free_trial_unit` is for. Required if `discount_type` is `free_trial`.



47
# File 'lib/recurly/requests/coupon_create.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. Required if `discount_type` is `free_trial`.

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. Required if `discount_type` is `free_trial`.



51
# File 'lib/recurly/requests/coupon_create.rb', line 51

define_attribute :free_trial_unit, String

#hosted_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/requests/coupon_create.rb', line 55

define_attribute :hosted_description, String

#invoice_descriptionString

Returns Description of the coupon on the invoice.

Returns:

  • (String)

    Description of the coupon on the invoice.



59
# File 'lib/recurly/requests/coupon_create.rb', line 59

define_attribute :invoice_description, String

#item_codesArray[String]

Returns List of item codes to which this coupon applies. Sending ‘item_codes` is only permitted when `applies_to_all_items` is set to false. The following values are not permitted when `item_codes` is included: `free_trial_amount` and `free_trial_unit`.

Returns:

  • (Array[String])

    List of item codes to which this coupon applies. Sending ‘item_codes` is only permitted when `applies_to_all_items` is set to false. The following values are not permitted when `item_codes` is included: `free_trial_amount` and `free_trial_unit`.



63
# File 'lib/recurly/requests/coupon_create.rb', line 63

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

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



67
# File 'lib/recurly/requests/coupon_create.rb', line 67

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.



71
# File 'lib/recurly/requests/coupon_create.rb', line 71

define_attribute :max_redemptions_per_account, Integer

#nameString

Returns The internal name for the coupon.

Returns:

  • (String)

    The internal name for the coupon.



75
# File 'lib/recurly/requests/coupon_create.rb', line 75

define_attribute :name, String

#plan_codesArray[String]

Returns List of plan codes to which this coupon applies. Required if ‘applies_to_all_plans` is false. Overrides `applies_to_all_plans` when `applies_to_all_plans` is true.

Returns:

  • (Array[String])

    List of plan codes to which this coupon applies. Required if ‘applies_to_all_plans` is false. Overrides `applies_to_all_plans` when `applies_to_all_plans` is true.



79
# File 'lib/recurly/requests/coupon_create.rb', line 79

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

#redeem_by_dateString

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:

  • (String)

    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.



83
# File 'lib/recurly/requests/coupon_create.rb', line 83

define_attribute :redeem_by_date, String

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



87
# File 'lib/recurly/requests/coupon_create.rb', line 87

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



91
# File 'lib/recurly/requests/coupon_create.rb', line 91

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.



95
# File 'lib/recurly/requests/coupon_create.rb', line 95

define_attribute :temporal_unit, String

#unique_code_templateString

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’”.

Returns:

  • (String)

    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’”



99
# File 'lib/recurly/requests/coupon_create.rb', line 99

define_attribute :unique_code_template, String