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

#accountAccountMini

Returns Account mini details.

Returns:



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

define_attribute :account, :AccountMini

#activated_atDateTime

Returns Activated at.

Returns:

  • (DateTime)

    Activated at



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

define_attribute :activated_at, DateTime

#add_onsArray[SubscriptionAddOn]

Returns Add-ons.

Returns:



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

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

#add_ons_totalFloat

Returns Total price of add-ons.

Returns:

  • (Float)

    Total price of add-ons



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

define_attribute :add_ons_total, Float

#auto_renewBoolean

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

Returns:

  • (Boolean)

    Whether the subscription renews at the end of its term.



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

define_attribute :auto_renew, :Boolean

#bank_account_authorized_atDateTime

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.



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

define_attribute :bank_account_authorized_at, DateTime

#billing_info_idString

Returns Billing Info ID.

Returns:

  • (String)

    Billing Info ID.



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

define_attribute :billing_info_id, String

#canceled_atDateTime

Returns Canceled at.

Returns:

  • (DateTime)

    Canceled at



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

define_attribute :canceled_at, DateTime

#collection_methodString

Returns Collection method.

Returns:

  • (String)

    Collection method



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

define_attribute :collection_method, String

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



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

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

#created_atDateTime

Returns Created at.

Returns:

  • (DateTime)

    Created at



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

define_attribute :created_at, DateTime

#currencyString

Returns 3-letter ISO 4217 currency code.

Returns:

  • (String)

    3-letter ISO 4217 currency code.



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

define_attribute :currency, String

#current_period_ends_atDateTime

Returns Current billing period ends at.

Returns:

  • (DateTime)

    Current billing period ends at



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

define_attribute :current_period_ends_at, DateTime

#current_period_started_atDateTime

Returns Current billing period started at.

Returns:

  • (DateTime)

    Current billing period started at



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

define_attribute :current_period_started_at, DateTime

#current_term_ends_atDateTime

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.



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

define_attribute :current_term_ends_at, DateTime

#current_term_started_atDateTime

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.



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

define_attribute :current_term_started_at, DateTime

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



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

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

#customer_notesString

Returns Customer notes.

Returns:

  • (String)

    Customer notes



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

define_attribute :customer_notes, String

#expiration_reasonString

Returns Expiration reason.

Returns:

  • (String)

    Expiration reason



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

define_attribute :expiration_reason, String

#expires_atDateTime

Returns Expires at.

Returns:

  • (DateTime)

    Expires at



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

define_attribute :expires_at, DateTime

#idString

Returns Subscription ID.

Returns:

  • (String)

    Subscription ID



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

define_attribute :id, String

#net_termsInteger

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.



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

define_attribute :net_terms, Integer

#objectString

Returns Object type.

Returns:

  • (String)

    Object type



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

define_attribute :object, String

#paused_atDateTime

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.



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

define_attribute :paused_at, DateTime

#pending_changeSubscriptionChange

Returns Subscription Change.

Returns:



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

define_attribute :pending_change, :SubscriptionChange

#planPlanMini

Returns Just the important parts.

Returns:

  • (PlanMini)

    Just the important parts.



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

define_attribute :plan, :PlanMini

#po_numberString

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.



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

define_attribute :po_number, String

#quantityInteger

Returns Subscription quantity.

Returns:

  • (Integer)

    Subscription quantity



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

define_attribute :quantity, Integer

#remaining_billing_cyclesInteger

Returns The remaining billing cycles in the current term.

Returns:

  • (Integer)

    The remaining billing cycles in the current term.



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

define_attribute :remaining_billing_cycles, Integer

#remaining_pause_cyclesInteger

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.



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

define_attribute :remaining_pause_cycles, Integer

#renewal_billing_cyclesInteger

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



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

define_attribute :renewal_billing_cycles, Integer

#revenue_schedule_typeString

Returns Revenue schedule type.

Returns:

  • (String)

    Revenue schedule type



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

define_attribute :revenue_schedule_type, String

#shippingSubscriptionShipping

Returns Subscription shipping details.

Returns:



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

define_attribute :shipping, :SubscriptionShipping

#stateString

Returns State.

Returns:

  • (String)

    State



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

define_attribute :state, String

#subtotalFloat

Returns Estimated total, before tax.

Returns:

  • (Float)

    Estimated total, before tax.



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

define_attribute :subtotal, Float

#terms_and_conditionsString

Returns Terms and conditions.

Returns:

  • (String)

    Terms and conditions



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

define_attribute :terms_and_conditions, String

#total_billing_cyclesInteger

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.



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

define_attribute :total_billing_cycles, Integer

#trial_ends_atDateTime

Returns Trial period ends at.

Returns:

  • (DateTime)

    Trial period ends at



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

define_attribute :trial_ends_at, DateTime

#trial_started_atDateTime

Returns Trial period started at.

Returns:

  • (DateTime)

    Trial period started at



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

define_attribute :trial_started_at, DateTime

#unit_amountFloat

Returns Subscription unit price.

Returns:

  • (Float)

    Subscription unit price



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

define_attribute :unit_amount, Float

#updated_atDateTime

Returns Last updated at.

Returns:

  • (DateTime)

    Last updated at



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

define_attribute :updated_at, DateTime

#uuidString

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.



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

define_attribute :uuid, String