Class: Recurly::Resources::Subscription

Inherits:
Recurly::Resource show all
Defined in:
lib/recurly/resources/subscription.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

#account ⇒ AccountMini

Returns Account mini details.

Returns:



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

define_attribute :account, :AccountMini

#activated_at ⇒ DateTime

Returns Activated at.

Returns:

  • (DateTime) —

    Activated at



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

define_attribute :activated_at, DateTime

#active_invoice_id ⇒ String

Returns The invoice ID of the latest invoice created for an active subscription.

Returns:

  • (String) —

    The invoice ID of the latest invoice created for an active subscription.



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

define_attribute :active_invoice_id, String

#add_ons ⇒ Array[SubscriptionAddOn]

Returns Add-ons.

Returns:



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

define_attribute :add_ons, Array, { :item_type => :SubscriptionAddOn }

#add_ons_total ⇒ Float

Returns Total price of add-ons.

Returns:

  • (Float) —

    Total price of add-ons



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

define_attribute :add_ons_total, Float

#auto_renew ⇒ Boolean

Returns Whether the subscription renews at the end of its term.

Returns:

  • (Boolean) —

    Whether the subscription renews at the end of its term.



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

define_attribute :auto_renew, :Boolean

#bank_account_authorized_at ⇒ DateTime

Returns Recurring subscriptions paid with ACH will have this attribute set. This timestamp is used for alerting customers to reauthorize in 3 years in accordance with NACHA rules. If a subscription becomes inactive or the billing info is no longer a bank account, this timestamp is cleared.

Returns:

  • (DateTime) —

    Recurring subscriptions paid with ACH will have this attribute set. This timestamp is used for alerting customers to reauthorize in 3 years in accordance with NACHA rules. If a subscription becomes inactive or the billing info is no longer a bank account, this timestamp is cleared.



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

define_attribute :bank_account_authorized_at, DateTime

#billing_info_id ⇒ String

Returns Billing Info ID.

Returns:

  • (String) —

    Billing Info ID.



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

define_attribute :billing_info_id, String

#canceled_at ⇒ DateTime

Returns Canceled at.

Returns:

  • (DateTime) —

    Canceled at



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

define_attribute :canceled_at, DateTime

#collection_method ⇒ String

Returns Collection method.

Returns:

  • (String) —

    Collection method



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

define_attribute :collection_method, String

#coupon_redemptions ⇒ Array[CouponRedemptionMini]

Returns subscription level coupon redemptions that are tied to this subscription.

Returns:

  • (Array[CouponRedemptionMini]) —

    Returns subscription level coupon redemptions that are tied to this subscription.



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

define_attribute :coupon_redemptions, Array, { :item_type => :CouponRedemptionMini }

#created_at ⇒ DateTime

Returns Created at.

Returns:

  • (DateTime) —

    Created at



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

define_attribute :created_at, DateTime

#credit_application_policy ⇒ CreditApplicationPolicy

Returns Controls whether credit invoices are automatically applied to new invoices. The mode field determines the application behavior. When mode is all, the optional allowed_origins array can restrict which credit invoice origins are applied. - all: All available credit invoices are applied (default) - none: No credit invoices are applied automatically.

Returns:

  • (CreditApplicationPolicy) —

    Controls whether credit invoices are automatically applied to new invoices. The mode field determines the application behavior. When mode is all, the optional allowed_origins array can restrict which credit invoice origins are applied. - all: All available credit invoices are applied (default) - none: No credit invoices are applied automatically



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

define_attribute :credit_application_policy, :CreditApplicationPolicy

#currency ⇒ String

Returns 3-letter ISO 4217 currency code.

Returns:

  • (String) —

    3-letter ISO 4217 currency code.



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

define_attribute :currency, String

#current_period_ends_at ⇒ DateTime

Returns Current billing period ends at.

Returns:

  • (DateTime) —

    Current billing period ends at



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

define_attribute :current_period_ends_at, DateTime

#current_period_started_at ⇒ DateTime

Returns Current billing period started at.

Returns:

  • (DateTime) —

    Current billing period started at



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

define_attribute :current_period_started_at, DateTime

#current_term_ends_at ⇒ DateTime

Returns When the term ends. This is calculated by a plan's interval and total_billing_cycles in a term. Subscription changes with a timeframe=renewal will be applied on this date.

Returns:

  • (DateTime) —

    When the term ends. This is calculated by a plan's interval and total_billing_cycles in a term. Subscription changes with a timeframe=renewal will be applied on this date.



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

define_attribute :current_term_ends_at, DateTime

#current_term_started_at ⇒ DateTime

Returns The start date of the term when the first billing period starts. The subscription term is the length of time that a customer will be committed to a subscription. A term can span multiple billing periods.

Returns:

  • (DateTime) —

    The start date of the term when the first billing period starts. The subscription term is the length of time that a customer will be committed to a subscription. A term can span multiple billing periods.



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

define_attribute :current_term_started_at, DateTime

#custom_fields ⇒ Array[CustomField]

Returns The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.

Returns:

  • (Array[CustomField]) —

    The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.



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

define_attribute :custom_fields, Array, { :item_type => :CustomField }

#customer_notes ⇒ String

Returns Customer notes.

Returns:

  • (String) —

    Customer notes



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

define_attribute :customer_notes, String

#expiration_reason ⇒ String

Returns Expiration reason.

Returns:

  • (String) —

    Expiration reason



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

define_attribute :expiration_reason, String

#expires_at ⇒ DateTime

Returns Expires at.

Returns:

  • (DateTime) —

    Expires at



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

define_attribute :expires_at, DateTime

#id ⇒ String

Returns Subscription ID.

Returns:

  • (String) —

    Subscription ID



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

define_attribute :id, String

#net_terms ⇒ Integer

Returns Integer representing the number of days after an invoice's creation that the invoice will become past due. If an invoice's net terms are set to '0', it is due 'On Receipt' and will become past due 24 hours after it’s created. If an invoice is due net 30, it will become past due at 31 days exactly.

Returns:

  • (Integer) —

    Integer representing the number of days after an invoice's creation that the invoice will become past due. If an invoice's net terms are set to '0', it is due 'On Receipt' and will become past due 24 hours after it’s created. If an invoice is due net 30, it will become past due at 31 days exactly.



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

define_attribute :net_terms, Integer

#object ⇒ String

Returns Object type.

Returns:

  • (String) —

    Object type



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

define_attribute :object, String

#paused_at ⇒ DateTime

Returns Null unless subscription is paused or will pause at the end of the current billing period.

Returns:

  • (DateTime) —

    Null unless subscription is paused or will pause at the end of the current billing period.



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

define_attribute :paused_at, DateTime

#pending_change ⇒ SubscriptionChange

Returns Subscription Change.

Returns:



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

define_attribute :pending_change, :SubscriptionChange

#plan ⇒ PlanMini

Returns Just the important parts.

Returns:

  • (PlanMini) —

    Just the important parts.



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

define_attribute :plan, :PlanMini

#po_number ⇒ String

Returns For manual invoicing, this identifies the PO number associated with the subscription.

Returns:

  • (String) —

    For manual invoicing, this identifies the PO number associated with the subscription.



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

define_attribute :po_number, String

#quantity ⇒ Integer

Returns Subscription quantity.

Returns:

  • (Integer) —

    Subscription quantity



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

define_attribute :quantity, Integer

#ramp_intervals ⇒ Array[SubscriptionRampIntervalResponse]

Returns The ramp intervals representing the pricing schedule for the subscription.

Returns:



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

define_attribute :ramp_intervals, Array, { :item_type => :SubscriptionRampIntervalResponse }

#remaining_billing_cycles ⇒ Integer

Returns The remaining billing cycles in the current term.

Returns:

  • (Integer) —

    The remaining billing cycles in the current term.



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

define_attribute :remaining_billing_cycles, Integer

#remaining_pause_cycles ⇒ Integer

Returns Null unless subscription is paused or will pause at the end of the current billing period.

Returns:

  • (Integer) —

    Null unless subscription is paused or will pause at the end of the current billing period.



139
# File 'lib/recurly/resources/subscription.rb', line 139

define_attribute :remaining_pause_cycles, Integer

#renewal_billing_cycles ⇒ Integer

Returns If auto_renew=true, when a term completes, total_billing_cycles takes this value as the length of subsequent terms. Defaults to the plan's total_billing_cycles.

Returns:

  • (Integer) —

    If auto_renew=true, when a term completes, total_billing_cycles takes this value as the length of subsequent terms. Defaults to the plan's total_billing_cycles.



143
# File 'lib/recurly/resources/subscription.rb', line 143

define_attribute :renewal_billing_cycles, Integer

#resume_at ⇒ DateTime

Returns The date the subscription billing resumes following a pause. Null unless the subscription is paused or scheduled to be paused.

Returns:

  • (DateTime) —

    The date the subscription billing resumes following a pause. Null unless the subscription is paused or scheduled to be paused.



147
# File 'lib/recurly/resources/subscription.rb', line 147

define_attribute :resume_at, DateTime

#revenue_schedule_type ⇒ String

Returns Revenue schedule type.

Returns:

  • (String) —

    Revenue schedule type



151
# File 'lib/recurly/resources/subscription.rb', line 151

define_attribute :revenue_schedule_type, String

#shipping ⇒ SubscriptionShipping

Returns Subscription shipping details.

Returns:



155
# File 'lib/recurly/resources/subscription.rb', line 155

define_attribute :shipping, :SubscriptionShipping

#state ⇒ String

Returns State.

Returns:

  • (String) —

    State



159
# File 'lib/recurly/resources/subscription.rb', line 159

define_attribute :state, String

#subtotal ⇒ Float

Returns Estimated total, before tax.

Returns:

  • (Float) —

    Estimated total, before tax.



163
# File 'lib/recurly/resources/subscription.rb', line 163

define_attribute :subtotal, Float

#tax_inclusive ⇒ Boolean

Returns Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to utilize this flag.

Returns:

  • (Boolean) —

    Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to utilize this flag.



167
# File 'lib/recurly/resources/subscription.rb', line 167

define_attribute :tax_inclusive, :Boolean

#terms_and_conditions ⇒ String

Returns Terms and conditions.

Returns:

  • (String) —

    Terms and conditions



171
# File 'lib/recurly/resources/subscription.rb', line 171

define_attribute :terms_and_conditions, String

#total_billing_cycles ⇒ Integer

Returns The number of cycles/billing periods in a term. When remaining_billing_cycles=0, if auto_renew=true the subscription will renew and a new term will begin, otherwise the subscription will expire.

Returns:

  • (Integer) —

    The number of cycles/billing periods in a term. When remaining_billing_cycles=0, if auto_renew=true the subscription will renew and a new term will begin, otherwise the subscription will expire.



175
# File 'lib/recurly/resources/subscription.rb', line 175

define_attribute :total_billing_cycles, Integer

#trial_ends_at ⇒ DateTime

Returns Trial period ends at.

Returns:

  • (DateTime) —

    Trial period ends at



179
# File 'lib/recurly/resources/subscription.rb', line 179

define_attribute :trial_ends_at, DateTime

#trial_started_at ⇒ DateTime

Returns Trial period started at.

Returns:

  • (DateTime) —

    Trial period started at



183
# File 'lib/recurly/resources/subscription.rb', line 183

define_attribute :trial_started_at, DateTime

#unit_amount ⇒ Float

Returns Subscription unit price.

Returns:

  • (Float) —

    Subscription unit price



187
# File 'lib/recurly/resources/subscription.rb', line 187

define_attribute :unit_amount, Float

#updated_at ⇒ DateTime

Returns Last updated at.

Returns:

  • (DateTime) —

    Last updated at



191
# File 'lib/recurly/resources/subscription.rb', line 191

define_attribute :updated_at, DateTime

#uuid ⇒ String

Returns The UUID is useful for matching data with the CSV exports and building URLs into Recurly's UI.

Returns:

  • (String) —

    The UUID is useful for matching data with the CSV exports and building URLs into Recurly's UI.



195
# File 'lib/recurly/resources/subscription.rb', line 195

define_attribute :uuid, String