Subscription class final
Subscription
Subscriptions allow you to charge a customer on a recurring basis. Related guide: [Creating subscriptions](https://stripe.com/docs/billing/subscriptions/creating)
- Implemented types
Constructors
-
Subscription({BillingPortalConfigurationApplicationOrId? application, double? applicationFeePercent, required SubscriptionAutomaticTax automaticTax, required DateTime billingCycleAnchor, SubscriptionBillingCycleAnchorConfig? billingCycleAnchorConfig, SubscriptionBillingThresholds? billingThresholds, DateTime? cancelAt, required bool cancelAtPeriodEnd, DateTime? canceledAt, CancellationDetails? cancellationDetails, required InvoiceCollectionMethod collectionMethod, required DateTime created, required String currency, required DateTime currentPeriodEnd, required DateTime currentPeriodStart, required BankAccountCustomerOrId customer, int? daysUntilDue, PaymentMethodOrId? defaultPaymentMethod, PaymentSourceOrId? defaultSource, List<
TaxRate> ? defaultTaxRates, String? description, Discount? discount, DateTime? endedAt, required String id, required SubscriptionItems items, InvoiceOrId? latestInvoice, required bool livemode, required Map<String, String> metadata, DateTime? nextPendingInvoiceItemInvoice, AccountOrId? onBehalfOf, SubscriptionPauseCollection? pauseCollection, SubscriptionPaymentSettings? paymentSettings, SubscriptionPendingInvoiceItemInterval? pendingInvoiceItemInterval, SetupIntentOrId? pendingSetupIntent, SubscriptionPendingUpdate? pendingUpdate, SubscriptionScheduleOrId? schedule, required DateTime startDate, required SubscriptionStatus status, TestHelpersTestClockOrId? testClock, SubscriptionTransferData? transferData, DateTime? trialEnd, PaymentLinkSubscriptionDataTrialSettings? trialSettings, DateTime? trialStart}) -
Subscription
const
- Subscription.fromJson(Object? json)
-
factory
Properties
- application → BillingPortalConfigurationApplicationOrId?
-
final
- applicationFeePercent → double?
-
final
- automaticTax → SubscriptionAutomaticTax
-
final
- billingCycleAnchor → DateTime
-
final
- billingCycleAnchorConfig → SubscriptionBillingCycleAnchorConfig?
-
The fixed values used to calculate the `billing_cycle_anchor`.
final
- billingThresholds → SubscriptionBillingThresholds?
-
Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period
final
- cancelAt → DateTime?
-
final
- cancelAtPeriodEnd → bool
-
final
- canceledAt → DateTime?
-
final
- cancellationDetails → CancellationDetails?
-
final
- collectionMethod → InvoiceCollectionMethod
-
final
- created → DateTime
-
final
- currency → String
-
final
- currentPeriodEnd → DateTime
-
final
- currentPeriodStart → DateTime
-
final
- customer → BankAccountCustomerOrId
-
final
- daysUntilDue → int?
-
final
- defaultPaymentMethod → PaymentMethodOrId?
-
final
- defaultSource → PaymentSourceOrId?
-
final
-
defaultTaxRates
→ List<
TaxRate> ? -
final
- description → String?
-
final
- discount → Discount?
-
final
- endedAt → DateTime?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
The ID of the Subscription.
final
- items → SubscriptionItems
-
SubscriptionItemList
final
- latestInvoice → InvoiceOrId?
-
final
- livemode → bool
-
final
-
metadata
→ Map<
String, String> -
final
- nextPendingInvoiceItemInvoice → DateTime?
-
final
- object → String
-
The resource's type.
final
- onBehalfOf → AccountOrId?
-
final
- pauseCollection → SubscriptionPauseCollection?
-
If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](/billing/subscriptions/pause-payment).
final
- paymentSettings → SubscriptionPaymentSettings?
-
Payment settings passed on to invoices created by the subscription.
final
- pendingInvoiceItemInterval → SubscriptionPendingInvoiceItemInterval?
-
Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval.
final
- pendingSetupIntent → SetupIntentOrId?
-
final
- pendingUpdate → SubscriptionPendingUpdate?
-
If specified, [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates) that will be applied to the subscription once the `latest_invoice` has been paid.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- schedule → SubscriptionScheduleOrId?
-
final
- startDate → DateTime
-
final
- status → SubscriptionStatus
-
final
- testClock → TestHelpersTestClockOrId?
-
final
- transferData → SubscriptionTransferData?
-
The account (if any) the subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices.
final
- trialEnd → DateTime?
-
final
- trialSettings → PaymentLinkSubscriptionDataTrialSettings?
-
final
- trialStart → DateTime?
-
final
Methods
-
encodeWith<
V> (Encoder< V> encoder) → V -
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, Object?> -
override
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
encode<
V> (Subscription instance, Encoder< V> encoder) → V -
override