Skip to content
Book a demoContact usGet started

List Rates In Catalog

client.RateCatalogs.ListRates(ctx, rateCatalogID, query) (*RateCatalogListRatesResponse, error)
get/rate-catalogs/{rate_catalog_id}/rates

List Rates In Catalog

ParametersExpand Collapse
rateCatalogID string
query RateCatalogListRatesParams
Limit param.Field[int64]optional
maximum100
minimum1
Offset param.Field[int64]optional
minimum0
ReturnsExpand Collapse
type RateCatalogListRatesResponse struct{…}
HasMore bool
Rates []RateCatalogListRatesResponseRate
ID string
Interval string
Accepts one of the following:
const RateCatalogListRatesResponseRateIntervalMonthly RateCatalogListRatesResponseRateInterval = "monthly"
const RateCatalogListRatesResponseRateIntervalYearly RateCatalogListRatesResponseRateInterval = "yearly"
RateCatalogID string
Type string
Accepts one of the following:
const RateCatalogListRatesResponseRateTypeFixed RateCatalogListRatesResponseRateType = "fixed"
const RateCatalogListRatesResponseRateTypeUsageBased RateCatalogListRatesResponseRateType = "usage_based"
Fixed RateCatalogListRatesResponseRateFixedoptional
ID string
Code string
Description string
Name string
Price RateCatalogListRatesResponseRateFixedPriceUnion

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

Accepts one of the following:
type FlatPriceOutput struct{…}

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

CurrencyCode string

The currency code of the amount.

Value string

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

PriceType FlatPriceOutputPriceTypeoptional
type PackagePriceOutput struct{…}

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.

CurrencyCode string

The currency code of the amount.

Value string

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

PackageUnits int64
RoundingBehavior PackagePriceOutputRoundingBehavior
Accepts one of the following:
const PackagePriceOutputRoundingBehaviorRoundUp PackagePriceOutputRoundingBehavior = "round_up"
const PackagePriceOutputRoundingBehaviorRoundDown PackagePriceOutputRoundingBehavior = "round_down"
PriceType PackagePriceOutputPriceTypeoptional
UsageBased RateCatalogListRatesResponseRateUsageBasedUnionoptional
Accepts one of the following:
type RateCatalogListRatesResponseRateUsageBasedSimple struct{…}
ID string
Code string
Description string
IncludedUnits int64
Name string
Price RateCatalogListRatesResponseRateUsageBasedSimplePriceUnion

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

Accepts one of the following:
type FlatPriceOutput struct{…}

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

CurrencyCode string

The currency code of the amount.

Value string

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

PriceType FlatPriceOutputPriceTypeoptional
type PackagePriceOutput struct{…}

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.

CurrencyCode string

The currency code of the amount.

Value string

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

PackageUnits int64
RoundingBehavior PackagePriceOutputRoundingBehavior
Accepts one of the following:
const PackagePriceOutputRoundingBehaviorRoundUp PackagePriceOutputRoundingBehavior = "round_up"
const PackagePriceOutputRoundingBehaviorRoundDown PackagePriceOutputRoundingBehavior = "round_down"
PriceType PackagePriceOutputPriceTypeoptional
PricingMetricID string
UsageBasedRateType stringoptional
type RateCatalogListRatesResponseRateUsageBasedDimensional struct{…}
ID string
Code string
Description string
Dimensions []RateCatalogListRatesResponseRateUsageBasedDimensionalDimension
Description string
Key string
Values []string
IncludedUnits int64
Name string
PricingMatrix RateCatalogListRatesResponseRateUsageBasedDimensionalPricingMatrix
Cells []RateCatalogListRatesResponseRateUsageBasedDimensionalPricingMatrixCell
DimensionCoordinates map[string, string]
Price RateCatalogListRatesResponseRateUsageBasedDimensionalPricingMatrixCellPriceUnion

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

Accepts one of the following:
type FlatPriceOutput struct{…}

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

CurrencyCode string

The currency code of the amount.

Value string

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

PriceType FlatPriceOutputPriceTypeoptional
type PackagePriceOutput struct{…}

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.

CurrencyCode string

The currency code of the amount.

Value string

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

PackageUnits int64
RoundingBehavior PackagePriceOutputRoundingBehavior
Accepts one of the following:
const PackagePriceOutputRoundingBehaviorRoundUp PackagePriceOutputRoundingBehavior = "round_up"
const PackagePriceOutputRoundingBehaviorRoundDown PackagePriceOutputRoundingBehavior = "round_down"
PriceType PackagePriceOutputPriceTypeoptional
PricingMetricID string
UsageBasedRateType stringoptional
List Rates In Catalog
package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/lark-go"
  "github.com/stainless-sdks/lark-go/option"
)

func main() {
  client := lark.NewClient(
    option.WithAPIKey("My API Key"),
  )
  response, err := client.RateCatalogs.ListRates(
    context.TODO(),
    "rate_catalog_id",
    lark.RateCatalogListRatesParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.HasMore)
}
{
  "has_more": true,
  "rates": [
    {
      "id": "rate_AJWMxR81jxoRlli6p13uf3JB",
      "interval": "monthly",
      "rate_catalog_id": "rcat_AJWMxR81jxoRlli6p13uf3JB",
      "type": "usage_based",
      "fixed": {
        "id": "id",
        "code": "code",
        "description": "description",
        "name": "name",
        "price": {
          "amount": {
            "currency_code": "usd",
            "value": "2500"
          },
          "price_type": "flat"
        }
      },
      "usage_based": {
        "id": "ubr_AJWMxR81jxoRlli6p13uf3JB",
        "code": "compute_hours",
        "description": "Compute hours usage",
        "included_units": 0,
        "name": "Compute Hours",
        "price": {
          "amount": {
            "currency_code": "usd",
            "value": "100"
          },
          "price_type": "flat"
        },
        "pricing_metric_id": "pmtr_GlX5Tcm2HOn00CoRTFxw2Amw",
        "usage_based_rate_type": "simple"
      }
    }
  ]
}
Returns Examples
{
  "has_more": true,
  "rates": [
    {
      "id": "rate_AJWMxR81jxoRlli6p13uf3JB",
      "interval": "monthly",
      "rate_catalog_id": "rcat_AJWMxR81jxoRlli6p13uf3JB",
      "type": "usage_based",
      "fixed": {
        "id": "id",
        "code": "code",
        "description": "description",
        "name": "name",
        "price": {
          "amount": {
            "currency_code": "usd",
            "value": "2500"
          },
          "price_type": "flat"
        }
      },
      "usage_based": {
        "id": "ubr_AJWMxR81jxoRlli6p13uf3JB",
        "code": "compute_hours",
        "description": "Compute hours usage",
        "included_units": 0,
        "name": "Compute Hours",
        "price": {
          "amount": {
            "currency_code": "usd",
            "value": "100"
          },
          "price_type": "flat"
        },
        "pricing_metric_id": "pmtr_GlX5Tcm2HOn00CoRTFxw2Amw",
        "usage_based_rate_type": "simple"
      }
    }
  ]
}