pub struct AddRateV1Body {Show 16 fields
pub billing_frequency: Option<String>,
pub commit_rate: Option<AddRateV1BodyCommitRate>,
pub credit_type_id: Option<Uuid>,
pub custom_rate: Map<String, Value>,
pub ending_before: Option<DateTime<Utc>>,
pub entitled: bool,
pub is_prorated: Option<bool>,
pub minimum_config: Option<AddRateV1BodyMinimumConfig>,
pub price: Option<f64>,
pub pricing_group_values: HashMap<String, String>,
pub product_id: Uuid,
pub quantity: Option<f64>,
pub rate_card_id: Uuid,
pub rate_type: String,
pub starting_at: DateTime<Utc>,
pub tiers: Vec<AddRateV1BodyTiersItem>,
}Expand description
AddRateV1Body
JSON schema
{
"type": "object",
"required": [
"entitled",
"product_id",
"rate_card_id",
"rate_type",
"starting_at"
],
"properties": {
"billing_frequency": {
"description": "Optional. Frequency to bill subscriptions with.
Required for subscription type products with Flat rate.",
"type": "string"
},
"commit_rate": {
"description": "A distinct rate on the rate card. You can choose to use this rate rather than list rate when consuming a credit or commit.",
"type": "object",
"required": [
"rate_type"
],
"properties": {
"minimum_config": {
"description": "Only set for TIERED_PERCENTAGE or PERCENTAGE
rate_type. Any commit-specific overrides will not apply if there is a
minimum set on the rate/applied override.",
"type": "object",
"required": [
"minimum"
],
"properties": {
"minimum": {
"type": "number"
}
},
"x-mint": {
"groups": [
"ff:support-charge-ga"
]
},
"x-stainless-skip": true
},
"price": {
"description": "Commit rate price. For FLAT rate_type, this
must be >=0. For PERCENTAGE rate_type, this is a decimal fraction, e.g.
use 0.1 for 10%; this must be >=0 and <=1.",
"type": "number"
},
"rate_type": {
"type": "string",
"x-mint-enum": {
"CUSTOM": [
"client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be",
"client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560",
"client_id:f157d376-0781-4ef3-9db9-775a9052148e",
"client_id:7dd2f652-7629-4925-9069-77f5c5d3db37",
"client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5",
"client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33",
"client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7"
],
"PERCENTAGE": [
"client_id:11db091c-975b-4908-9f67-b1ceb126acdf"
],
"SUBSCRIPTION": [
"client_id:11db091c-975b-4908-9f67-b1ceb126acdf"
],
"TIERED_PERCENTAGE": [
"ff:support-charge-ga"
],
"custom": [
"client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be",
"client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560",
"client_id:f157d376-0781-4ef3-9db9-775a9052148e",
"client_id:7dd2f652-7629-4925-9069-77f5c5d3db37",
"client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5",
"client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33",
"client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7"
],
"percentage": [
"client_id:11db091c-975b-4908-9f67-b1ceb126acdf"
],
"subscription": [
"client_id:11db091c-975b-4908-9f67-b1ceb126acdf"
],
"tiered_percentage": [
"ff:support-charge-ga"
]
}
},
"tiers": {
"description": "Only set for TIERED rate_type.",
"type": "array",
"items": {
"type": "object",
"required": [
"price"
],
"properties": {
"price": {
"type": "number"
},
"size": {
"type": "number"
}
}
}
}
}
},
"credit_type_id": {
"description": "The Metronome ID of the credit type to associate
with price, defaults to USD (cents) if not passed. Used by all
rate_types except type PERCENTAGE. PERCENTAGE rates use the credit type
of associated rates.",
"examples": [
"2714e483-4ff1-48e4-9e25-ac732e8f24f2"
],
"type": "string",
"format": "uuid"
},
"custom_rate": {
"description": "Only set for CUSTOM rate_type. This field is
interpreted by custom rate processors.",
"type": "object",
"additionalProperties": true,
"x-mint": {
"groups": [
"client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be",
"client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560",
"client_id:f157d376-0781-4ef3-9db9-775a9052148e",
"client_id:7dd2f652-7629-4925-9069-77f5c5d3db37",
"client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5",
"client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33",
"client_id:9c7e2b27-9b4c-4b76-9df7-f9cb05665a6a"
]
}
},
"ending_before": {
"description": "exclusive end date",
"type": "string",
"format": "date-time"
},
"entitled": {
"type": "boolean"
},
"is_prorated": {
"description": "Default proration configuration. Only valid for
SUBSCRIPTION rate_type. Must be set to true.",
"type": "boolean",
"x-mint": {
"groups": [
"ff:legacy-subscriptions-enabled"
]
}
},
"minimum_config": {
"description": "Only set for TIERED_PERCENTAGE or PERCENTAGE
rate_type. Any commit-specific overrides will not apply if there is a
minimum set on the rate/applied override.",
"type": "object",
"required": [
"minimum"
],
"properties": {
"minimum": {
"type": "number"
}
},
"x-mint": {
"groups": [
"ff:support-charge-ga"
]
},
"x-stainless-skip": true
},
"price": {
"description": "Default price. For FLAT and SUBSCRIPTION rate_type,
this must be >=0. For PERCENTAGE rate_type, this is a decimal fraction,
e.g. use 0.1 for 10%; this must be >=0 and <=1.",
"type": "number"
},
"pricing_group_values": {
"description": "Optional. List of pricing group key value pairs
which will be used to calculate the price.",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"product_id": {
"description": "ID of the product to add a rate for",
"type": "string",
"format": "uuid"
},
"quantity": {
"description": "Default quantity. For SUBSCRIPTION rate_type, this
must be >=0.",
"type": "number",
"x-mint": {
"groups": [
"ff:legacy-subscriptions-enabled"
]
}
},
"rate_card_id": {
"description": "ID of the rate card to update",
"type": "string",
"format": "uuid"
},
"rate_type": {
"type": "string",
"x-mint-enum": {
"CUSTOM": [
"client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be",
"client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560",
"client_id:f157d376-0781-4ef3-9db9-775a9052148e",
"client_id:7dd2f652-7629-4925-9069-77f5c5d3db37",
"client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5",
"client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33",
"client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7"
],
"SUBSCRIPTION": [
"ff:legacy-subscriptions-enabled"
],
"TIERED_PERCENTAGE": [
"ff:support-charge-ga"
],
"custom": [
"client_id:5b9e3072-415b-4842-94f0-0b6700c8b6be",
"client_id:179e395f-5349-4fe2-bf12-64ab4e5bc560",
"client_id:f157d376-0781-4ef3-9db9-775a9052148e",
"client_id:7dd2f652-7629-4925-9069-77f5c5d3db37",
"client_id:c0ce3dc0-6d3e-4f6b-aadf-dfb90f2bf9f5",
"client_id:cf874b25-ca3b-460b-b6fe-5f33b3c2ea33",
"client_id:97c07a0c-70db-448a-a1d4-adcd2b8bd1c7"
],
"subscription": [
"ff:legacy-subscriptions-enabled"
],
"tiered_percentage": [
"ff:support-charge-ga"
]
}
},
"starting_at": {
"description": "inclusive effective date",
"type": "string",
"format": "date-time"
},
"tiers": {
"description": "Only set for TIERED rate_type.",
"type": "array",
"items": {
"type": "object",
"required": [
"price"
],
"properties": {
"price": {
"type": "number"
},
"size": {
"type": "number"
}
}
}
}
}
}Fields§
§billing_frequency: Option<String>Optional. Frequency to bill subscriptions with. Required for subscription type products with Flat rate.
commit_rate: Option<AddRateV1BodyCommitRate>§credit_type_id: Option<Uuid>The Metronome ID of the credit type to associate with price, defaults to USD (cents) if not passed. Used by all rate_types except type PERCENTAGE. PERCENTAGE rates use the credit type of associated rates.
custom_rate: Map<String, Value>Only set for CUSTOM rate_type. This field is interpreted by custom rate processors.
ending_before: Option<DateTime<Utc>>exclusive end date
entitled: bool§is_prorated: Option<bool>Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be set to true.
minimum_config: Option<AddRateV1BodyMinimumConfig>§price: Option<f64>Default price. For FLAT and SUBSCRIPTION rate_type, this must be
=0. For PERCENTAGE rate_type, this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
pricing_group_values: HashMap<String, String>Optional. List of pricing group key value pairs which will be used to calculate the price.
product_id: UuidID of the product to add a rate for
quantity: Option<f64>Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
rate_card_id: UuidID of the rate card to update
rate_type: String§starting_at: DateTime<Utc>inclusive effective date
tiers: Vec<AddRateV1BodyTiersItem>Only set for TIERED rate_type.
Trait Implementations§
Source§impl Clone for AddRateV1Body
impl Clone for AddRateV1Body
Source§fn clone(&self) -> AddRateV1Body
fn clone(&self) -> AddRateV1Body
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more