Class: Dodopayments::Models::Subscription

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/dodopayments/models/subscription.rb

Overview

Direct Known Subclasses

WebhookPayload::Data::Subscription

Defined Under Namespace

Classes: ScheduledChange

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(addons:, billing:, cancel_at_next_billing_date:, created_at:, credit_entitlement_cart:, currency:, customer:, metadata:, meter_credit_entitlement_cart:, meters:, next_billing_date:, on_demand:, payment_frequency_count:, payment_frequency_interval:, previous_billing_date:, product_id:, quantity:, recurring_pre_tax_amount:, status:, subscription_id:, subscription_period_count:, subscription_period_interval:, tax_inclusive:, trial_period_days:, cancelled_at: nil, custom_field_responses: nil, discount_cycles_remaining: nil, discount_id: nil, expires_at: nil, payment_method_id: nil, scheduled_change: nil, tax_id: nil) ⇒ Object

Some parameter documentations has been truncated, see Dodopayments::Models::Subscription for more details.

Response struct representing subscription details

Parameters:

  • addons (Array<Dodopayments::Models::AddonCartResponseItem>)

    Addons associated with this subscription

  • billing (Dodopayments::Models::BillingAddress)

    Billing address details for payments

  • cancel_at_next_billing_date (Boolean)

    Indicates if the subscription will cancel at the next billing date

  • created_at (Time)

    Timestamp when the subscription was created

  • credit_entitlement_cart (Array<Dodopayments::Models::CreditEntitlementCartResponse>)

    Credit entitlement cart settings for this subscription

  • currency (Symbol, Dodopayments::Models::Currency)

    Currency used for the subscription payments

  • customer (Dodopayments::Models::CustomerLimitedDetails)

    Customer details associated with the subscription

  • metadata (Hash{Symbol=>String})

    Additional custom data associated with the subscription

  • meter_credit_entitlement_cart (Array<Dodopayments::Models::MeterCreditEntitlementCartResponse>)

    Meter credit entitlement cart settings for this subscription

  • meters (Array<Dodopayments::Models::MeterCartResponseItem>)

    Meters associated with this subscription (for usage-based billing)

  • next_billing_date (Time)

    Timestamp of the next scheduled billing. Indicates the end of current billing pe

  • on_demand (Boolean)

    Wether the subscription is on-demand or not

  • payment_frequency_count (Integer)

    Number of payment frequency intervals

  • payment_frequency_interval (Symbol, Dodopayments::Models::TimeInterval)

    Time interval for payment frequency (e.g. month, year)

  • previous_billing_date (Time)

    Timestamp of the last payment. Indicates the start of current billing period

  • product_id (String)

    Identifier of the product associated with this subscription

  • quantity (Integer)

    Number of units/items included in the subscription

  • recurring_pre_tax_amount (Integer)

    Amount charged before tax for each recurring payment in smallest currency unit (

  • status (Symbol, Dodopayments::Models::SubscriptionStatus)

    Current status of the subscription

  • subscription_id (String)

    Unique identifier for the subscription

  • subscription_period_count (Integer)

    Number of subscription period intervals

  • subscription_period_interval (Symbol, Dodopayments::Models::TimeInterval)

    Time interval for the subscription period (e.g. month, year)

  • tax_inclusive (Boolean)

    Indicates if the recurring_pre_tax_amount is tax inclusive

  • trial_period_days (Integer)

    Number of days in the trial period (0 if no trial)

  • cancelled_at (Time, nil) (defaults to: nil)

    Cancelled timestamp if the subscription is cancelled

  • custom_field_responses (Array<Dodopayments::Models::CustomFieldResponse>, nil) (defaults to: nil)

    Customer’s responses to custom fields collected during checkout

  • discount_cycles_remaining (Integer, nil) (defaults to: nil)

    Number of remaining discount cycles if discount is applied

  • discount_id (String, nil) (defaults to: nil)

    The discount id if discount is applied

  • expires_at (Time, nil) (defaults to: nil)

    Timestamp when the subscription will expire

  • payment_method_id (String, nil) (defaults to: nil)

    Saved payment method id used for recurring charges

  • scheduled_change (Dodopayments::Models::Subscription::ScheduledChange, nil) (defaults to: nil)

    Scheduled plan change details, if any

  • tax_id (String, nil) (defaults to: nil)

    Tax identifier provided for this subscription (if applicable)



# File 'lib/dodopayments/models/subscription.rb', line 205

Instance Attribute Details

#addonsArray<Dodopayments::Models::AddonCartResponseItem>

Addons associated with this subscription



11
# File 'lib/dodopayments/models/subscription.rb', line 11

required :addons, -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::AddonCartResponseItem] }

#billingDodopayments::Models::BillingAddress

Billing address details for payments



17
# File 'lib/dodopayments/models/subscription.rb', line 17

required :billing, -> { Dodopayments::BillingAddress }

#cancel_at_next_billing_dateBoolean

Indicates if the subscription will cancel at the next billing date

Returns:

  • (Boolean)


23
# File 'lib/dodopayments/models/subscription.rb', line 23

required :cancel_at_next_billing_date, Dodopayments::Internal::Type::Boolean

#cancelled_atTime?

Cancelled timestamp if the subscription is cancelled

Returns:

  • (Time, nil)


159
# File 'lib/dodopayments/models/subscription.rb', line 159

optional :cancelled_at, Time, nil?: true

#created_atTime

Timestamp when the subscription was created

Returns:

  • (Time)


29
# File 'lib/dodopayments/models/subscription.rb', line 29

required :created_at, Time

#credit_entitlement_cartArray<Dodopayments::Models::CreditEntitlementCartResponse>

Credit entitlement cart settings for this subscription



35
36
# File 'lib/dodopayments/models/subscription.rb', line 35

required :credit_entitlement_cart,
-> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::CreditEntitlementCartResponse] }

#currencySymbol, Dodopayments::Models::Currency

Currency used for the subscription payments

Returns:



42
# File 'lib/dodopayments/models/subscription.rb', line 42

required :currency, enum: -> { Dodopayments::Currency }

#custom_field_responsesArray<Dodopayments::Models::CustomFieldResponse>?

Customer’s responses to custom fields collected during checkout



165
166
167
# File 'lib/dodopayments/models/subscription.rb', line 165

optional :custom_field_responses,
-> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::CustomFieldResponse] },
nil?: true

#customerDodopayments::Models::CustomerLimitedDetails

Customer details associated with the subscription



48
# File 'lib/dodopayments/models/subscription.rb', line 48

required :customer, -> { Dodopayments::CustomerLimitedDetails }

#discount_cycles_remainingInteger?

Number of remaining discount cycles if discount is applied

Returns:

  • (Integer, nil)


173
# File 'lib/dodopayments/models/subscription.rb', line 173

optional :discount_cycles_remaining, Integer, nil?: true

#discount_idString?

The discount id if discount is applied

Returns:

  • (String, nil)


179
# File 'lib/dodopayments/models/subscription.rb', line 179

optional :discount_id, String, nil?: true

#expires_atTime?

Timestamp when the subscription will expire

Returns:

  • (Time, nil)


185
# File 'lib/dodopayments/models/subscription.rb', line 185

optional :expires_at, Time, nil?: true

#metadataHash{Symbol=>String}

Additional custom data associated with the subscription

Returns:

  • (Hash{Symbol=>String})


54
# File 'lib/dodopayments/models/subscription.rb', line 54

required :metadata, Dodopayments::Internal::Type::HashOf[String]

#meter_credit_entitlement_cartArray<Dodopayments::Models::MeterCreditEntitlementCartResponse>

Meter credit entitlement cart settings for this subscription



60
61
# File 'lib/dodopayments/models/subscription.rb', line 60

required :meter_credit_entitlement_cart,
-> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::MeterCreditEntitlementCartResponse] }

#metersArray<Dodopayments::Models::MeterCartResponseItem>

Meters associated with this subscription (for usage-based billing)



67
# File 'lib/dodopayments/models/subscription.rb', line 67

required :meters, -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::MeterCartResponseItem] }

#next_billing_dateTime

Timestamp of the next scheduled billing. Indicates the end of current billing period

Returns:

  • (Time)


74
# File 'lib/dodopayments/models/subscription.rb', line 74

required :next_billing_date, Time

#on_demandBoolean

Wether the subscription is on-demand or not

Returns:

  • (Boolean)


80
# File 'lib/dodopayments/models/subscription.rb', line 80

required :on_demand, Dodopayments::Internal::Type::Boolean

#payment_frequency_countInteger

Number of payment frequency intervals

Returns:

  • (Integer)


86
# File 'lib/dodopayments/models/subscription.rb', line 86

required :payment_frequency_count, Integer

#payment_frequency_intervalSymbol, Dodopayments::Models::TimeInterval

Time interval for payment frequency (e.g. month, year)



92
# File 'lib/dodopayments/models/subscription.rb', line 92

required :payment_frequency_interval, enum: -> { Dodopayments::TimeInterval }

#payment_method_idString?

Saved payment method id used for recurring charges

Returns:

  • (String, nil)


191
# File 'lib/dodopayments/models/subscription.rb', line 191

optional :payment_method_id, String, nil?: true

#previous_billing_dateTime

Timestamp of the last payment. Indicates the start of current billing period

Returns:

  • (Time)


98
# File 'lib/dodopayments/models/subscription.rb', line 98

required :previous_billing_date, Time

#product_idString

Identifier of the product associated with this subscription

Returns:

  • (String)


104
# File 'lib/dodopayments/models/subscription.rb', line 104

required :product_id, String

#quantityInteger

Number of units/items included in the subscription

Returns:

  • (Integer)


110
# File 'lib/dodopayments/models/subscription.rb', line 110

required :quantity, Integer

#recurring_pre_tax_amountInteger

Amount charged before tax for each recurring payment in smallest currency unit (e.g. cents)

Returns:

  • (Integer)


117
# File 'lib/dodopayments/models/subscription.rb', line 117

required :recurring_pre_tax_amount, Integer

#scheduled_changeDodopayments::Models::Subscription::ScheduledChange?

Scheduled plan change details, if any



197
# File 'lib/dodopayments/models/subscription.rb', line 197

optional :scheduled_change, -> { Dodopayments::Subscription::ScheduledChange }, nil?: true

#statusSymbol, Dodopayments::Models::SubscriptionStatus

Current status of the subscription



123
# File 'lib/dodopayments/models/subscription.rb', line 123

required :status, enum: -> { Dodopayments::SubscriptionStatus }

#subscription_idString

Unique identifier for the subscription

Returns:

  • (String)


129
# File 'lib/dodopayments/models/subscription.rb', line 129

required :subscription_id, String

#subscription_period_countInteger

Number of subscription period intervals

Returns:

  • (Integer)


135
# File 'lib/dodopayments/models/subscription.rb', line 135

required :subscription_period_count, Integer

#subscription_period_intervalSymbol, Dodopayments::Models::TimeInterval

Time interval for the subscription period (e.g. month, year)



141
# File 'lib/dodopayments/models/subscription.rb', line 141

required :subscription_period_interval, enum: -> { Dodopayments::TimeInterval }

#tax_idString?

Tax identifier provided for this subscription (if applicable)

Returns:

  • (String, nil)


203
# File 'lib/dodopayments/models/subscription.rb', line 203

optional :tax_id, String, nil?: true

#tax_inclusiveBoolean

Indicates if the recurring_pre_tax_amount is tax inclusive

Returns:

  • (Boolean)


147
# File 'lib/dodopayments/models/subscription.rb', line 147

required :tax_inclusive, Dodopayments::Internal::Type::Boolean

#trial_period_daysInteger

Number of days in the trial period (0 if no trial)

Returns:

  • (Integer)


153
# File 'lib/dodopayments/models/subscription.rb', line 153

required :trial_period_days, Integer