pub struct Discount {Show 18 fields
pub id: DiscountID,
pub status: DiscountStatus,
pub description: String,
pub enabled_for_checkout: bool,
pub code: Option<String>,
pub type: DiscountType,
pub amount: String,
pub currency_code: Option<CurrencyCode>,
pub recur: bool,
pub maximum_recurring_intervals: Option<i64>,
pub usage_limit: Option<i64>,
pub restrict_to: Option<Vec<String>>,
pub expires_at: Option<DateTime<Utc>>,
pub custom_data: Option<Value>,
pub times_used: i64,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub import_meta: Option<ImportMeta>,
}Expand description
Represents a discount entity.
Fields§
§id: DiscountIDUnique Paddle ID for this discount, prefixed with dsc_.
status: DiscountStatusWhether this entity can be used in Paddle.
description: StringShort description for this discount for your reference. Not shown to customers.
enabled_for_checkout: boolWhether this discount can be redeemed by customers at checkout (true) or not (false).
code: Option<String>Unique code that customers can use to redeem this discount at checkout. Not case-sensitive.
type: DiscountTypeType of discount. Determines how this discount impacts the checkout or transaction total.
amount: StringAmount to discount by. For percentage discounts, must be an amount between 0.01 and 100. For flat and flat_per_seat discounts, amount in the lowest denomination for a currency.
currency_code: Option<CurrencyCode>Supported three-letter ISO 4217 currency code. Required where discount type is flat or flat_per_seat.
recur: boolWhether this discount applies for multiple subscription billing periods (true) or not (false).
maximum_recurring_intervals: Option<i64>Number of subscription billing periods that this discount recurs for. Requires recur. null if this discount recurs forever.
Subscription renewals, midcycle changes, and one-time charges billed to a subscription aren’t considered a redemption. times_used is not incremented in these cases.
usage_limit: Option<i64>Maximum number of times this discount can be redeemed. This is an overall limit for this discount, rather than a per-customer limit. null if this discount can be redeemed an unlimited amount of times.
Paddle counts a usage as a redemption on a checkout, transaction, or the initial application against a subscription. Transactions created for subscription renewals, midcycle changes, and one-time charges aren’t considered a redemption.
restrict_to: Option<Vec<String>>Product or price IDs that this discount is for. When including a product ID, all prices for that product can be discounted. null if this discount applies to all products and prices.
expires_at: Option<DateTime<Utc>>RFC 3339 datetime string of when this discount expires. Discount can no longer be redeemed after this date has elapsed. null if this discount can be redeemed forever.
Expired discounts can’t be redeemed against transactions or checkouts, but can be applied when updating subscriptions.
custom_data: Option<Value>Your own structured key-value data.
times_used: i64How many times this discount has been redeemed. Automatically incremented by Paddle.
Paddle counts a usage as a redemption on a checkout, transaction, or subscription. Transactions created for subscription renewals, midcycle changes, and one-time charges aren’t considered a redemption.
created_at: DateTime<Utc>RFC 3339 datetime string of when this entity was created. Set automatically by Paddle.
updated_at: DateTime<Utc>RFC 3339 datetime string of when this entity was updated. Set automatically by Paddle.
import_meta: Option<ImportMeta>Import information for this entity. null if this entity is not imported.