Subscription class

Inheritance
Annotations
  • @JsonSerializable.new()

Constructors

Subscription({required _SubscriptionObject object, required String id, required int created, required String customer, required SubscriptionStatus status, required DataList<SubscriptionItem> items, required DateTime currentPeriodStart, required DateTime currentPeriodEnd, required DateTime startDate, required DateTime billingCycleAnchor, DateTime? cancelAt, bool cancelAtPeriodEnd = false, DateTime? endedAt, Map<String, dynamic>? metadata, String? latestInvoice})
Subscription.fromJson(Map<String, dynamic> json)
factory

Properties

billingCycleAnchor DateTime
The reference point that aligns future billing cycle dates. It sets the day of week for week intervals, the day of month for month and year intervals, and the month of year for year intervals. The timestamp is in UTC format.
final
cancelAt DateTime?
A date in the future at which the subscription will automatically get canceled.
final
cancelAtPeriodEnd bool
If the subscription has been canceled with the at_period_end flag set to true, cancel_at_period_end on the subscription will be true. You can use this attribute to determine whether a subscription that has a status of active is scheduled to be canceled at the end of the current period.
final
created int
Time at which the object was created. Measured in seconds since the Unix epoch.
final
currentPeriodEnd DateTime
End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created.
final
currentPeriodStart DateTime
Start of the current period that the subscription has been invoiced for.
final
customer String
ID of the customer who owns the subscription.
final
endedAt DateTime?
If the subscription has ended, the date the subscription ended.
final
hashCode int
The hash code for this object.
no setterinherited
id String
Unique identifier for the object.
final
items DataList<SubscriptionItem>
List of subscription items, each with an attached price.
final
latestInvoice String?
The most recent invoice this subscription has generated.
final
metadata Map<String, dynamic>?
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
final
object → _SubscriptionObject
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
startDate DateTime
Date when the subscription was first created. The date might differ from the created date due to backdating.
final
status SubscriptionStatus
Possible values are incomplete, incomplete_expired, trialing, active, past_due, canceled, or unpaid.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited