pub struct BillingCustomerDiscount {
pub id: Option<String>,
pub active: Option<bool>,
pub percent_off: Option<f64>,
pub amount_off: Option<f64>,
pub applies_to: Option<Vec<String>>,
}Expand description
BillingCustomerDiscount : Customer discount information from Stripe billing.
Fields§
§id: Option<String>The Stripe coupon ID (e.g., "cm3nHfO1").
active: Option<bool>Whether the discount is a recurring/perpetual discount with no expiration date. This property is true only when the discount has no end date, meaning it applies indefinitely to all future renewals. This is a product decision for Milestone 2 to only display perpetual discounts in the UI. Note: This does NOT indicate whether the discount is "currently active" in the billing sense. A discount with a future end date is functionally active and will be applied by Stripe, but this property will be false because it has an expiration date.
percent_off: Option<f64>Percentage discount applied to the subscription (e.g., 20.0 for 20% off). Null if this is an amount-based discount.
amount_off: Option<f64>Fixed amount discount in USD (e.g., 14.00 for $14 off). Converted from Stripe’s cent-based values (1400 cents → $14.00). Null if this is a percentage-based discount. Note: Stripe stores amounts in the smallest currency unit. This value is always in USD.
applies_to: Option<Vec<String>>List of Stripe product IDs that this discount applies to (e.g., ["prod_premium", "prod_families"]). Null: discount applies to all products with no restrictions (AppliesTo not specified in Stripe). Empty list: discount restricted to zero products (edge case - AppliesTo.Products = [] in Stripe). Non-empty list: discount applies only to the specified product IDs.
Implementations§
Source§impl BillingCustomerDiscount
impl BillingCustomerDiscount
Sourcepub fn new() -> BillingCustomerDiscount
pub fn new() -> BillingCustomerDiscount
Customer discount information from Stripe billing.
Trait Implementations§
Source§impl Clone for BillingCustomerDiscount
impl Clone for BillingCustomerDiscount
Source§fn clone(&self) -> BillingCustomerDiscount
fn clone(&self) -> BillingCustomerDiscount
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more