Discount class

auto generated A discount represents the actual application of a coupon or promotion code.It contains information about when the discount began, when it will end, and what it is applied to.Related guide: Applying discounts to subscriptions

Constructors

Discount()
Instantiates a new Discount and sets the default values.

Properties

additionalData Map<String, Object?>
Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
getter/setter pairoverride
checkoutSession String?
The Checkout session that this coupon is applied to, if it is applied to a particular session in payment mode. Will not be present for subscription mode.
getter/setter pair
customer DiscountCustomer?
The ID of the customer associated with this discount.
getter/setter pair
customerAccount String?
The ID of the account representing the customer associated with this discount.
getter/setter pair
end int?
If the coupon has a duration of repeating, the date that this discount will end. If the coupon has a duration of once or forever, this attribute will be null.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
id String?
The ID of the discount object. Discounts cannot be fetched by ID. Use expand[]=discounts in API calls to expand discount IDs in an array.
getter/setter pair
invoice String?
The invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice.
getter/setter pair
invoiceItem String?
The invoice item id (or invoice line item id for invoice line items of type='subscription') that the discount's coupon was applied to, if it was applied directly to a particular invoice item or invoice line item.
getter/setter pair
object DiscountObject?
String representing the object's type. Objects of the same type share the same value.
getter/setter pair
promotionCode DiscountPromotionCode?
The promotion code applied to create this discount.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
source DiscountSource?
The source property
getter/setter pair
start int?
Date that the coupon was applied.
getter/setter pair
subscription String?
The subscription that this coupon is applied to, if it is applied to a particular subscription.
getter/setter pair
subscriptionItem String?
The subscription item that this coupon is applied to, if it is applied to a particular subscription item.
getter/setter pair

Methods

getFieldDeserializers() Map<String, void Function(ParseNode)>
The deserialization information for the current model
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
serialize(SerializationWriter writer) → void
Serializes information the current object writer Serialization writer to use to serialize this model
override
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

createFromDiscriminatorValue(ParseNode parseNode) Discount
Creates a new instance of the appropriate class based on discriminator value parseNode The parse node to use to read the discriminator value and create the object