Skip to content
Book a demoContact usGet started

Add Rates To Rate Catalog

post/rate-catalogs/{rate_catalog_id}/add_rates

Add Rates To Rate Catalog

Path ParametersExpand Collapse
rate_catalog_id: string
Body ParametersExpand Collapse
billing_interval: "monthly" or "yearly"

How often the customer will be billed for these rates.

Accepts one of the following:
"monthly"
"yearly"
fixed_rates: optional array of object { code, name, price, description }

The fixed rate to create in the catalog.

code: string

Code of this rate to be used for setting quantity and price multipliers. This code must be unique within the rate card.

name: string

The name of the rate displayed to the customer.

price: FlatPriceInput { amount, price_type } or PackagePriceInput { amount, package_units, rounding_behavior, price_type }

Flat price is a price that linearly scales with the quantity.

Accepts one of the following:
FlatPriceInput = object { amount, price_type }

Flat price is a price that linearly scales with the quantity.

amount: AmountInput { currency_code, value }
currency_code: string

The currency code of the amount.

value: number or string

The value of the amount in the smallest unit of the currency.

Accepts one of the following:
UnionMember0 = number
UnionMember1 = string
price_type: optional "flat"
PackagePriceInput = object { amount, package_units, rounding_behavior, price_type }

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.

amount: AmountInput { currency_code, value }
currency_code: string

The currency code of the amount.

value: number or string

The value of the amount in the smallest unit of the currency.

Accepts one of the following:
UnionMember0 = number
UnionMember1 = string
package_units: number
rounding_behavior: "round_up" or "round_down"
Accepts one of the following:
"round_up"
"round_down"
price_type: optional "package"
description: optional string

The description of the rate displayed to the customer.

usage_based_rates: optional array of object { code, name, price, 4 more } or object { code, dimensions, name, 5 more }

The usage based rates to create in the catalog.

Accepts one of the following:
Simple = object { code, name, price, 4 more }
code: string

Code of this rate to be used for price multipliers. This code must be unique within the rate card.

name: string

The name of the rate displayed to the customer.

price: FlatPriceInput { amount, price_type } or PackagePriceInput { amount, package_units, rounding_behavior, price_type }

Flat price is a price that linearly scales with the quantity.

Accepts one of the following:
FlatPriceInput = object { amount, price_type }

Flat price is a price that linearly scales with the quantity.

amount: AmountInput { currency_code, value }
currency_code: string

The currency code of the amount.

value: number or string

The value of the amount in the smallest unit of the currency.

Accepts one of the following:
UnionMember0 = number
UnionMember1 = string
price_type: optional "flat"
PackagePriceInput = object { amount, package_units, rounding_behavior, price_type }

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.

amount: AmountInput { currency_code, value }
currency_code: string

The currency code of the amount.

value: number or string

The value of the amount in the smallest unit of the currency.

Accepts one of the following:
UnionMember0 = number
UnionMember1 = string
package_units: number
rounding_behavior: "round_up" or "round_down"
Accepts one of the following:
"round_up"
"round_down"
price_type: optional "package"
pricing_metric_id: string

The ID of the pricing metric to use for this rate.

usage_based_rate_type: "simple"
description: optional string

The description of the rate displayed to the customer.

included_units: optional number

The number of units included in the rate before the price is applied.

minimum0
Dimensional = object { code, dimensions, name, 5 more }
code: string

Code of this rate to be used for price multipliers. This code must be unique within the rate card.

dimensions: array of object { key, values, description }

The dimensions of the rate.

key: string

The name of the dimension. This is used to identify the dimension in the pricing matrix.

values: array of string

A list of possible values for the dimension.

description: optional string

The description of the dimension.

name: string

The name of the rate displayed to the customer.

pricing_matrix: object { cells }

The pricing matrix of the rate.

cells: array of object { dimension_coordinates, price }
dimension_coordinates: map[string]

A key-value mapping of dimension keys and values to identify the price for a given set of dimension values.

price: FlatPriceInput { amount, price_type } or PackagePriceInput { amount, package_units, rounding_behavior, price_type }

The price for the cell.

Accepts one of the following:
FlatPriceInput = object { amount, price_type }

Flat price is a price that linearly scales with the quantity.

amount: AmountInput { currency_code, value }
currency_code: string

The currency code of the amount.

value: number or string

The value of the amount in the smallest unit of the currency.

Accepts one of the following:
UnionMember0 = number
UnionMember1 = string
price_type: optional "flat"
PackagePriceInput = object { amount, package_units, rounding_behavior, price_type }

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.

amount: AmountInput { currency_code, value }
currency_code: string

The currency code of the amount.

value: number or string

The value of the amount in the smallest unit of the currency.

Accepts one of the following:
UnionMember0 = number
UnionMember1 = string
package_units: number
rounding_behavior: "round_up" or "round_down"
Accepts one of the following:
"round_up"
"round_down"
price_type: optional "package"
pricing_metric_id: string

The ID of the pricing metric to use for this rate.

usage_based_rate_type: "dimensional"
description: optional string

The description of the rate displayed to the customer.

included_units: optional number

The number of units included in the rate before the price is applied.

minimum0
ReturnsExpand Collapse
id: string
description: string
name: string
rate_count: number
Add Rates To Rate Catalog
curl https://api.uselark.ai/rate-catalogs/$RATE_CATALOG_ID/add_rates \
    -H 'Content-Type: application/json' \
    -H "X-API-Key: $LARK_API_KEY" \
    -d '{
          "billing_interval": "monthly"
        }'
{
  "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
}