Add Rates To Rate Catalog
Add Rates To Rate Catalog
ParametersExpand Collapse
billing_interval: Literal["monthly", "yearly"]How often the customer will be billed for these rates.
How often the customer will be billed for these rates.
The fixed rate to create in the catalog.
The fixed rate to create in the catalog.
Code of this rate to be used for setting quantity and price multipliers. This code must be unique within the rate card.
The name of the rate displayed to the customer.
price: FixedRatePriceFlat price is a price that linearly scales with the quantity.
Flat price is a price that linearly scales with the quantity.
class FlatPriceInput: …Flat price is a price that linearly scales with the quantity.
Flat price is a price that linearly scales with the quantity.
The currency code of the amount.
value: Union[float, str]The value of the amount in the smallest unit of the currency.
The value of the amount in the smallest unit of the currency.
class PackagePriceInput: …Package price is a price that is charged for a fixed number of units. For example, $10 per 1000 units. If the quantity is not a multiple of the package units, the rounding behavior will be applied.
Package price is a price that is charged for a fixed number of units. For example, $10 per 1000 units. If the quantity is not a multiple of the package units, the rounding behavior will be applied.
The currency code of the amount.
value: Union[float, str]The value of the amount in the smallest unit of the currency.
The value of the amount in the smallest unit of the currency.
rounding_behavior: Literal["round_up", "round_down"]
The description of the rate displayed to the customer.
The usage based rates to create in the catalog.
The usage based rates to create in the catalog.
class UsageBasedRateCreateSimpleUsageBasedRateRequest: …
Code of this rate to be used for price multipliers. This code must be unique within the rate card.
The name of the rate displayed to the customer.
price: UsageBasedRateCreateSimpleUsageBasedRateRequestPriceFlat price is a price that linearly scales with the quantity.
Flat price is a price that linearly scales with the quantity.
class FlatPriceInput: …Flat price is a price that linearly scales with the quantity.
Flat price is a price that linearly scales with the quantity.
The currency code of the amount.
value: Union[float, str]The value of the amount in the smallest unit of the currency.
The value of the amount in the smallest unit of the currency.
class PackagePriceInput: …Package price is a price that is charged for a fixed number of units. For example, $10 per 1000 units. If the quantity is not a multiple of the package units, the rounding behavior will be applied.
Package price is a price that is charged for a fixed number of units. For example, $10 per 1000 units. If the quantity is not a multiple of the package units, the rounding behavior will be applied.
The currency code of the amount.
value: Union[float, str]The value of the amount in the smallest unit of the currency.
The value of the amount in the smallest unit of the currency.
rounding_behavior: Literal["round_up", "round_down"]
The ID of the pricing metric to use for this rate.
The description of the rate displayed to the customer.
The number of units included in the rate before the price is applied.
class UsageBasedRateCreateDimensionalUsageBasedRateRequest: …
Code of this rate to be used for price multipliers. This code must be unique within the rate card.
dimensions: Iterable[UsageBasedRateCreateDimensionalUsageBasedRateRequestDimension]The dimensions of the rate.
The dimensions of the rate.
The name of the dimension. This is used to identify the dimension in the pricing matrix.
A list of possible values for the dimension.
The description of the dimension.
The name of the rate displayed to the customer.
pricing_matrix: UsageBasedRateCreateDimensionalUsageBasedRateRequestPricingMatrixThe pricing matrix of the rate.
The pricing matrix of the rate.
cells: Iterable[UsageBasedRateCreateDimensionalUsageBasedRateRequestPricingMatrixCell]
A key-value mapping of dimension keys and values to identify the price for a given set of dimension values.
price: UsageBasedRateCreateDimensionalUsageBasedRateRequestPricingMatrixCellPriceThe price for the cell.
The price for the cell.
class FlatPriceInput: …Flat price is a price that linearly scales with the quantity.
Flat price is a price that linearly scales with the quantity.
The currency code of the amount.
value: Union[float, str]The value of the amount in the smallest unit of the currency.
The value of the amount in the smallest unit of the currency.
class PackagePriceInput: …Package price is a price that is charged for a fixed number of units. For example, $10 per 1000 units. If the quantity is not a multiple of the package units, the rounding behavior will be applied.
Package price is a price that is charged for a fixed number of units. For example, $10 per 1000 units. If the quantity is not a multiple of the package units, the rounding behavior will be applied.
The currency code of the amount.
value: Union[float, str]The value of the amount in the smallest unit of the currency.
The value of the amount in the smallest unit of the currency.
rounding_behavior: Literal["round_up", "round_down"]
The ID of the pricing metric to use for this rate.
The description of the rate displayed to the customer.
The number of units included in the rate before the price is applied.
ReturnsExpand Collapse
class RateCatalogAddRatesResponse: …
Add Rates To Rate Catalog
import os
from lark import Lark
client = Lark(
api_key=os.environ.get("LARK_API_KEY"), # This is the default and can be omitted
)
response = client.rate_catalogs.add_rates(
rate_catalog_id="rate_catalog_id",
billing_interval="monthly",
)
print(response.id)
{
"id": "rate_catalog_AJWMxR81jxoRlli6p13uf3JB",
"description": "Rates for EC2 usage",
"name": "EC2 Rates",
"rate_count": 5
}
Returns Examples
{
"id": "rate_catalog_AJWMxR81jxoRlli6p13uf3JB",
"description": "Rates for EC2 usage",
"name": "EC2 Rates",
"rate_count": 5
}