pub struct Discount {
pub checkout_session: Option<String>,
pub coupon: Coupon,
pub customer: Option<Value>,
pub end: Option<i64>,
pub id: String,
pub invoice: Option<String>,
pub invoice_item: Option<String>,
pub object: String,
pub promotion_code: Option<Value>,
pub start: i64,
pub subscription: Option<String>,
}Expand description
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
Fields§
§checkout_session: Option<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.
coupon: CouponA 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.
customer: Option<Value>The ID of the customer associated with this discount.
end: Option<i64>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.
id: StringThe ID of the discount object. Discounts cannot be fetched by ID. Use expand[]=discounts in API calls to expand discount IDs in an array.
invoice: Option<String>The invoice that the discount’s coupon was applied to, if it was applied directly to a particular invoice.
invoice_item: Option<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.
object: StringString representing the object’s type. Objects of the same type share the same value.
promotion_code: Option<Value>The promotion code applied to create this discount.
start: i64Date that the coupon was applied.
subscription: Option<String>The subscription that this coupon is applied to, if it is applied to a particular subscription.