[−][src]Struct stripe::CreatePlan
The parameters for Plan::create
.
Fields
active: Option<bool>
Whether the plan is currently available for new subscriptions.
Defaults to true
.
aggregate_usage: Option<PlanAggregateUsage>
Specifies a usage aggregation strategy for plans of usage_type=metered
.
Allowed values are sum
for summing up all usage during a period, last_during_period
for picking the last usage record reported within a period, last_ever
for picking the last usage record ever (across period bounds) or max
which picks the usage record with the maximum reported usage during a period.
Defaults to sum
.
amount: Option<i64>
A positive integer in %s (or 0 for a free plan) representing how much to charge on a recurring basis.
billing_scheme: Option<PlanBillingScheme>
Describes how to compute the price per period.
Either per_unit
or tiered
.
per_unit
indicates that the fixed amount (specified in amount
) will be charged per unit in quantity
(for plans with usage_type=licensed
), or per unit of total usage (for plans with usage_type=metered
).
tiered
indicates that the unit pricing will be computed using a tiering strategy as defined using the tiers
and tiers_mode
attributes.
currency: Currency
Three-letter ISO currency code, in lowercase.
Must be a supported currency.
expand: &'a [&'a str]
Specifies which fields in the response should be expanded.
id: Option<&'a str>
An identifier randomly generated by Stripe.
Used to identify this plan when subscribing a customer. You can optionally override this ID, but the ID must be unique across all plans in your Stripe account. You can, however, use the same plan ID in both live and test modes.
interval: PlanInterval
Specifies billing frequency.
Either day
, week
, month
or year
.
interval_count: Option<u64>
The number of intervals between subscription billings.
For example, interval=month
and interval_count=3
bills every 3 months.
Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
metadata: Option<Metadata>
A set of key-value pairs that you can attach to a plan object.
It can be useful for storing additional information about the plan in a structured format.
nickname: Option<&'a str>
A brief description of the plan, hidden from customers.
tiers: Option<Vec<CreatePlanTiers>>
Each element represents a pricing tier.
This parameter requires billing_scheme
to be set to tiered
.
See also the documentation for billing_scheme
.
tiers_mode: Option<PlanTiersMode>
Defines if the tiering price should be graduated
or volume
based.
In volume
-based tiering, the maximum quantity within a period determines the per unit price, in graduated
tiering pricing can successively change as the quantity grows.
transform_usage: Option<CreatePlanTransformUsage>
Apply a transformation to the reported usage or set quantity before computing the billed price.
Cannot be combined with tiers
.
trial_period_days: Option<u32>
Default number of trial days when subscribing a customer to this plan using trial_from_plan=true
.
usage_type: Option<PlanUsageType>
Configures how the quantity per period should be determined, can be either metered
or licensed
.
licensed
will automatically bill the quantity
set for a plan when adding it to a subscription, metered
will aggregate the total usage based on usage records.
Defaults to licensed
.
Methods
impl<'a> CreatePlan<'a>
[src]
pub fn new(currency: Currency, interval: PlanInterval) -> Self
[src]
Trait Implementations
impl<'a> Clone for CreatePlan<'a>
[src]
fn clone(&self) -> CreatePlan<'a>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a> Debug for CreatePlan<'a>
[src]
impl<'a> Serialize for CreatePlan<'a>
[src]
Auto Trait Implementations
impl<'a> Unpin for CreatePlan<'a>
impl<'a> Sync for CreatePlan<'a>
impl<'a> Send for CreatePlan<'a>
impl<'a> UnwindSafe for CreatePlan<'a>
impl<'a> RefUnwindSafe for CreatePlan<'a>
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self