pub struct PricesCreate<'a> { /* private fields */ }
Expand description
Request builder for creating a new price in Paddle API.
Implementations§
Source§impl<'a> PricesCreate<'a>
impl<'a> PricesCreate<'a>
pub fn new( client: &'a Paddle, product_id: impl Into<ProductID>, description: impl Into<String>, amount: u64, currency: CurrencyCode, ) -> Self
Sourcepub fn catalog_type(&mut self, catalog_type: CatalogType) -> &mut Self
pub fn catalog_type(&mut self, catalog_type: CatalogType) -> &mut Self
Set the price type.
Sourcepub fn name(&mut self, name: impl Into<String>) -> &mut Self
pub fn name(&mut self, name: impl Into<String>) -> &mut Self
Name of this price, shown to customers at checkout and on invoices. Typically describes how often the related product bills.
Sourcepub fn billing_cycle(&mut self, frequency: u64, interval: Interval) -> &mut Self
pub fn billing_cycle(&mut self, frequency: u64, interval: Interval) -> &mut Self
How often this price should be charged.
Sourcepub fn trial_period(&mut self, frequency: u64, interval: Interval) -> &mut Self
pub fn trial_period(&mut self, frequency: u64, interval: Interval) -> &mut Self
Trial period for the product related to this price. The billing cycle begins once the trial period is over. Requires billing_cycle.
Sourcepub fn tax_mode(&mut self, tax_mode: TaxMode) -> &mut Self
pub fn tax_mode(&mut self, tax_mode: TaxMode) -> &mut Self
How tax is calculated for this price. If omitted, defaults to TaxMode::AccountSetting. See TaxMode for more information.
Sourcepub fn add_unit_price_override(
&mut self,
country_codes: impl IntoIterator<Item = CountryCodeSupported>,
amount: u64,
currency: CurrencyCode,
) -> &mut Self
pub fn add_unit_price_override( &mut self, country_codes: impl IntoIterator<Item = CountryCodeSupported>, amount: u64, currency: CurrencyCode, ) -> &mut Self
Use to override the base price with a custom price and currency for a country or group of countries. See UnitPriceOverride for more information. See CountryCodeSupported for more information. See Money for more information. See CurrencyCode for more information.
Sourcepub fn set_unit_price_overrides(
&mut self,
overrides: Vec<UnitPriceOverride>,
) -> &mut Self
pub fn set_unit_price_overrides( &mut self, overrides: Vec<UnitPriceOverride>, ) -> &mut Self
Use to override the base price with a custom price and currency for a country or group of countries.
This will replace any existing overrides.
Use add_unit_price_override
to add additional overrides.
See UnitPriceOverride for more information.
See CountryCodeSupported for more information.
See Money for more information.
See CurrencyCode for more information.
Sourcepub fn quantity(&mut self, range: Range<u64>) -> &mut Self
pub fn quantity(&mut self, range: Range<u64>) -> &mut Self
Limits on how many times the related product can be purchased at this price. Useful for discount campaigns. If omitted, defaults to 1..100.
Sourcepub fn custom_data(&mut self, custom_data: HashMap<String, String>) -> &mut Self
pub fn custom_data(&mut self, custom_data: HashMap<String, String>) -> &mut Self
Set custom data for this price.