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
-
Field Summary
Fields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
The Checkout session that this coupon is applied to, if it is applied to a particular session in payment mode.A coupon contains information about a percent-off or amount-off discount you might want to apply to a customer.Get ID of expandablecustomer
object.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 itemid
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.String representing the object's type.Get ID of expandablepromotionCode
object.Get expandedpromotionCode
.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.int
hashCode()
void
setCheckoutSession
(String checkoutSession) The Checkout session that this coupon is applied to, if it is applied to a particular session in payment mode.void
A coupon contains information about a percent-off or amount-off discount you might want to apply to a customer.void
setCustomer
(String id) void
setCustomerObject
(Customer expandableObject) void
setDeleted
(Boolean deleted) Always true for a deleted object.void
If the coupon has a duration ofrepeating
, the date that this discount will end.void
The ID of the discount object.void
setInvoice
(String invoice) The invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice.void
setInvoiceItem
(String invoiceItem) The invoice itemid
(or invoice line itemid
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.void
String representing the object's type.void
void
setPromotionCodeObject
(PromotionCode expandableObject) void
Date that the coupon was applied.void
setSubscription
(String subscription) The subscription that this coupon is applied to, if it is applied to a particular subscription.void
setSubscriptionItem
(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, equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
-
Constructor Details
-
Discount
public Discount()
-
-
Method Details
-
getCustomer
Get ID of expandablecustomer
object. -
setCustomer
-
getCustomerObject
Get expandedcustomer
. -
setCustomerObject
-
getPromotionCode
Get ID of expandablepromotionCode
object. -
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. -
getCoupon
A coupon contains information about a percent-off or amount-off discount you might want to apply to a customer. Coupons may be applied to subscriptions, invoices, checkout sessions, quotes, and more. Coupons do not work with conventional one-off charges or payment intents. -
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 ofonce
orforever
, 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 itemid
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. -
getObject
String representing the object's type. Objects of the same type share the same value.Equal to
discount
. -
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. -
setCoupon
A coupon contains information about a percent-off or amount-off discount you might want to apply to a customer. Coupons may be applied to subscriptions, invoices, checkout sessions, quotes, and more. Coupons do not work with conventional one-off charges or payment intents. -
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 ofonce
orforever
, this attribute will be null. -
setId
The ID of the discount object. Discounts cannot be fetched by ID. Useexpand[]=discounts
in 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 itemid
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. -
setObject
String representing the object's type. Objects of the same type share the same value.Equal to
discount
. -
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[]=discounts
in API calls to expand discount IDs in an array.
-