Module: Orb::Models::Subscription::DiscountInterval

Extended by:
Internal::Type::Union
Defined in:
lib/orb/models/subscription.rb

Instance Method Summary collapse

Methods included from Internal::Type::Union

==, ===, coerce, dump, hash, inspect, to_sorbet_type, variants

Methods included from Internal::Util::SorbetRuntimeSupport

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

Methods included from Internal::Type::Converter

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

Instance Method Details

#initialize(id: , active_plan_phase_order: , adjustment_intervals: , auto_collection: , billing_cycle_anchor_configuration: , billing_cycle_day: , created_at: , current_billing_period_end_date: , current_billing_period_start_date: , customer: , default_invoice_memo: , discount_intervals: , end_date: , fixed_fee_quantity_schedule: , invoicing_threshold: , maximum_intervals: , metadata: , minimum_intervals: , name: , net_terms: , pending_subscription_change: , plan: , price_intervals: , redeemed_coupon: , start_date: , status: , trial_info: ) ⇒ Object

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

A [subscription](/core-concepts#subscription) represents the purchase of a plan by a customer.

By default, subscriptions begin on the day that they’re created and renew automatically for each billing cycle at the cadence that’s configured in the plan definition.

Subscriptions also default to **beginning of month alignment**, which means the first invoice issued for the subscription will have pro-rated charges between the ‘start_date` and the first of the following month. Subsequent billing periods will always start and end on a month boundary (e.g. subsequent month starts for monthly billing).

Depending on the plan configuration, any flat recurring fees will be billed either at the beginning (in-advance) or end (in-arrears) of each billing cycle. Plans default to **in-advance billing**. Usage-based fees are billed in arrears as usage is accumulated. In the normal course of events, you can expect an invoice to contain usage-based charges for the previous period, and a recurring fee for the following period.

Parameters:

  • id (String) (defaults to: )
  • active_plan_phase_order (Integer, nil) (defaults to: )

    The current plan phase that is active, only if the subscription’s plan has phase

  • adjustment_intervals (Array<Orb::Models::AdjustmentInterval>) (defaults to: )

    The adjustment intervals for this subscription sorted by the start_date of the a

  • auto_collection (Boolean, nil) (defaults to: )

    Determines whether issued invoices for this subscription will automatically be c

  • billing_cycle_anchor_configuration (Orb::Models::BillingCycleAnchorConfiguration) (defaults to: )
  • billing_cycle_day (Integer) (defaults to: )

    The day of the month on which the billing cycle is anchored. If the maximum numb

  • created_at (Time) (defaults to: )
  • current_billing_period_end_date (Time, nil) (defaults to: )

    The end of the current billing period. This is an exclusive timestamp, such that

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

    The start date of the current billing period. This is an inclusive timestamp; th

  • customer (Orb::Models::Customer) (defaults to: )

    A customer is a buyer of your products, and the other party to the billing relat

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

    Determines the default memo on this subscriptions’ invoices. Note that if this i

  • discount_intervals (Array<Orb::Models::AmountDiscountInterval, Orb::Models::PercentageDiscountInterval, Orb::Models::UsageDiscountInterval>) (defaults to: )

    The discount intervals for this subscription sorted by the start_date. This fiel

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

    The date Orb stops billing for this subscription.

  • fixed_fee_quantity_schedule (Array<Orb::Models::FixedFeeQuantityScheduleEntry>) (defaults to: )
  • invoicing_threshold (String, nil) (defaults to: )
  • maximum_intervals (Array<Orb::Models::MaximumInterval>) (defaults to: )

    The maximum intervals for this subscription sorted by the start_date. This field

  • metadata (Hash{Symbol=>String}) (defaults to: )

    User specified key-value pairs for the resource. If not present, this defaults t

  • minimum_intervals (Array<Orb::Models::MinimumInterval>) (defaults to: )

    The minimum intervals for this subscription sorted by the start_date. This field

  • name (String) (defaults to: )

    The name of the subscription.

  • net_terms (Integer) (defaults to: )

    Determines the difference between the invoice issue date for subscription invoic

  • pending_subscription_change (Orb::Models::SubscriptionChangeMinified, nil) (defaults to: )

    A pending subscription change if one exists on this subscription.

  • plan (Orb::Models::Plan, nil) (defaults to: )

    The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be

  • price_intervals (Array<Orb::Models::PriceInterval>) (defaults to: )

    The price intervals for this subscription.

  • redeemed_coupon (Orb::Models::CouponRedemption, nil) (defaults to: )
  • start_date (Time) (defaults to: )

    The date Orb starts billing for this subscription.

  • status (Symbol, Orb::Models::Subscription::Status) (defaults to: )
  • trial_info (Orb::Models::SubscriptionTrialInfo) (defaults to: )


288
289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'lib/orb/models/subscription.rb', line 288

module DiscountInterval
  extend Orb::Internal::Type::Union

  discriminator :discount_type

  variant :amount, -> { Orb::AmountDiscountInterval }

  variant :percentage, -> { Orb::PercentageDiscountInterval }

  variant :usage, -> { Orb::UsageDiscountInterval }

  # @!method self.variants
  #   @return [Array(Orb::Models::AmountDiscountInterval, Orb::Models::PercentageDiscountInterval, Orb::Models::UsageDiscountInterval)]
end