Package com.stripe.model
Class Discount
java.lang.Object
com.stripe.model.StripeObject
com.stripe.model.Discount
- All Implemented Interfaces:
HasId,StripeObjectInterface
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classFor more details about Source, please refer to the API Reference. -
Field Summary
Fields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanThe Checkout session that this coupon is applied to, if it is applied to a particular session in payment mode.Get ID of expandablecustomerobject.The ID of the account associated with this discount.Get expandedcustomer.Always true for a deleted object.getEnd()If the coupon has a duration ofrepeating, the date that this discount will end.getId()The ID of the discount object.The invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice.The invoice itemid(or invoice line itemidfor 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.String representing the object's type.Get ID of expandablepromotionCodeobject.Get expandedpromotionCode.The subscription schedule that this coupon is applied to, if it is applied to a particular subscription schedule.getStart()Date that the coupon was applied.The subscription that this coupon is applied to, if it is applied to a particular subscription.The subscription item that this coupon is applied to, if it is applied to a particular subscription item.inthashCode()voidsetCheckoutSession(String checkoutSession) The Checkout session that this coupon is applied to, if it is applied to a particular session in payment mode.voidsetCustomer(String id) voidsetCustomerAccount(String customerAccount) The ID of the account associated with this discount.voidsetCustomerObject(Customer expandableObject) voidsetDeleted(Boolean deleted) Always true for a deleted object.voidIf the coupon has a duration ofrepeating, the date that this discount will end.voidThe ID of the discount object.voidsetInvoice(String invoice) The invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice.voidsetInvoiceItem(String invoiceItem) The invoice itemid(or invoice line itemidfor 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.voidString representing the object's type.voidvoidsetPromotionCodeObject(PromotionCode expandableObject) voidsetSchedule(String schedule) The subscription schedule that this coupon is applied to, if it is applied to a particular subscription schedule.voidsetSource(Discount.Source source) voidDate that the coupon was applied.voidsetSubscription(String subscription) The subscription that this coupon is applied to, if it is applied to a particular subscription.voidsetSubscriptionItem(String subscriptionItem) The subscription item that this coupon is applied to, if it is applied to a particular subscription item.Methods inherited from class com.stripe.model.StripeObject
deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
-
Constructor Details
-
Discount
public Discount()
-
-
Method Details
-
getCustomer
Get ID of expandablecustomerobject. -
setCustomer
-
getCustomerObject
Get expandedcustomer. -
setCustomerObject
-
getPromotionCode
Get ID of expandablepromotionCodeobject. -
setPromotionCode
-
getPromotionCodeObject
Get expandedpromotionCode. -
setPromotionCodeObject
-
getCheckoutSession
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. -
getCustomerAccount
The ID of the account associated with this discount. -
getDeleted
Always true for a deleted object. -
getEnd
If the coupon has a duration ofrepeating, the date that this discount will end. If the coupon has a duration ofonceorforever, this attribute will be null. -
getInvoice
The invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice. -
getInvoiceItem
The invoice itemid(or invoice line itemidfor 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. -
getObject
String representing the object's type. Objects of the same type share the same value.Equal to
discount. -
getSchedule
The subscription schedule that this coupon is applied to, if it is applied to a particular subscription schedule. -
getSource
-
getStart
Date that the coupon was applied. -
getSubscription
The subscription that this coupon is applied to, if it is applied to a particular subscription. -
getSubscriptionItem
The subscription item that this coupon is applied to, if it is applied to a particular subscription item. -
setCheckoutSession
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. -
setCustomerAccount
The ID of the account associated with this discount. -
setDeleted
Always true for a deleted object. -
setEnd
If the coupon has a duration ofrepeating, the date that this discount will end. If the coupon has a duration ofonceorforever, this attribute will be null. -
setId
The ID of the discount object. Discounts cannot be fetched by ID. Useexpand[]=discountsin API calls to expand discount IDs in an array. -
setInvoice
The invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice. -
setInvoiceItem
The invoice itemid(or invoice line itemidfor 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. -
setObject
String representing the object's type. Objects of the same type share the same value.Equal to
discount. -
setSchedule
The subscription schedule that this coupon is applied to, if it is applied to a particular subscription schedule. -
setSource
-
setStart
Date that the coupon was applied. -
setSubscription
The subscription that this coupon is applied to, if it is applied to a particular subscription. -
setSubscriptionItem
The subscription item that this coupon is applied to, if it is applied to a particular subscription item. -
equals
-
canEqual
-
hashCode
public int hashCode() -
getId
The ID of the discount object. Discounts cannot be fetched by ID. Useexpand[]=discountsin API calls to expand discount IDs in an array.
-