Skip to content
Join our SlackContact usGet started

Get Rate Card

client.RateCards.Get(ctx, rateCardID) (*RateCardResource, error)
get/rate-cards/{rate_card_id}

Get Rate Card

ParametersExpand Collapse
rateCardID string
ReturnsExpand Collapse
type RateCardResource struct{…}
ID string

The ID of the rate card.

BillingInterval RateCardResourceBillingInterval

How often the customer will be billed for this rate card.

Accepts one of the following:
const RateCardResourceBillingIntervalMonthly RateCardResourceBillingInterval = "monthly"
const RateCardResourceBillingIntervalYearly RateCardResourceBillingInterval = "yearly"
CreatedAt Time

The date and time the rate card was created.

formatdate-time
FixedRates []RateCardResourceFixedRate

The fixed rates of the rate card.

ID string
Description string
Name string
Price RateCardResourceFixedRatePriceUnion

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
Accepts one of the following:
const FlatPriceOutputPriceTypeFlat FlatPriceOutputPriceType = "flat"
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
Accepts one of the following:
const PackagePriceOutputPriceTypePackage PackagePriceOutputPriceType = "package"
Metadata map[string, string]

Additional metadata about the rate card. You may use this to store any custom data about the rate card.

Name string

The name of the rate card.

UpdatedAt Time

The date and time the rate card was last updated.

formatdate-time
UsageBasedRates []RateCardResourceUsageBasedRateUnion

The usage based rates of the rate card.

Accepts one of the following:
type RateCardResourceUsageBasedRateSimple struct{…}
ID string
Description string
IncludedUnits int64
Name string
Price RateCardResourceUsageBasedRateSimplePriceUnion

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
Accepts one of the following:
const FlatPriceOutputPriceTypeFlat FlatPriceOutputPriceType = "flat"
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
Accepts one of the following:
const PackagePriceOutputPriceTypePackage PackagePriceOutputPriceType = "package"
PricingMetricID string
UsageBasedRateType stringoptional
Accepts one of the following:
const RateCardResourceUsageBasedRateSimpleUsageBasedRateTypeSimple RateCardResourceUsageBasedRateSimpleUsageBasedRateType = "simple"
type RateCardResourceUsageBasedRateDimensional struct{…}
ID string
Description string
Dimensions []RateCardResourceUsageBasedRateDimensionalDimension
Description string
Key string
Values []string
IncludedUnits int64
Name string
PricingMatrix RateCardResourceUsageBasedRateDimensionalPricingMatrix
Cells []RateCardResourceUsageBasedRateDimensionalPricingMatrixCell
DimensionCoordinates map[string, string]
Price RateCardResourceUsageBasedRateDimensionalPricingMatrixCellPriceUnion

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
Accepts one of the following:
const FlatPriceOutputPriceTypeFlat FlatPriceOutputPriceType = "flat"
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
Accepts one of the following:
const PackagePriceOutputPriceTypePackage PackagePriceOutputPriceType = "package"
PricingMetricID string
UsageBasedRateType stringoptional
Accepts one of the following:
const RateCardResourceUsageBasedRateDimensionalUsageBasedRateTypeDimensional RateCardResourceUsageBasedRateDimensionalUsageBasedRateType = "dimensional"
Description stringoptional

The description of the rate card.

Get Rate Card
package main

import (
  "context"
  "fmt"

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

func main() {
  client := lark.NewClient(
    option.WithAPIKey("My API Key"),
  )
  rateCardResource, err := client.RateCards.Get(context.TODO(), "rate_card_id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", rateCardResource.ID)
}
{
  "id": "rc_jQK2n0wutCj6bBcAIrL6o07g",
  "billing_interval": "monthly",
  "created_at": "2025-11-01T00:00:00Z",
  "fixed_rates": [
    {
      "id": "fr_04EjnYJoQLC7gtLKI6mPzZny",
      "description": "description",
      "name": "Base Rate",
      "price": {
        "amount": {
          "currency_code": "usd",
          "value": "2500"
        },
        "price_type": "flat"
      }
    }
  ],
  "metadata": {},
  "name": "Pro Plan",
  "updated_at": "2025-11-01T00:00:00Z",
  "usage_based_rates": [
    {
      "id": "ubr_zoXOJrDXlGGJWRNq3HqFYhbP",
      "description": "description",
      "included_units": 30,
      "name": "Compute Hours",
      "price": {
        "amount": {
          "currency_code": "usd",
          "value": "100"
        },
        "price_type": "flat"
      },
      "pricing_metric_id": "pmtr_GlX5Tcm2HOn00CoRTFxw2Amw",
      "usage_based_rate_type": "simple"
    }
  ],
  "description": "For production applications with moderate usage."
}
Returns Examples
{
  "id": "rc_jQK2n0wutCj6bBcAIrL6o07g",
  "billing_interval": "monthly",
  "created_at": "2025-11-01T00:00:00Z",
  "fixed_rates": [
    {
      "id": "fr_04EjnYJoQLC7gtLKI6mPzZny",
      "description": "description",
      "name": "Base Rate",
      "price": {
        "amount": {
          "currency_code": "usd",
          "value": "2500"
        },
        "price_type": "flat"
      }
    }
  ],
  "metadata": {},
  "name": "Pro Plan",
  "updated_at": "2025-11-01T00:00:00Z",
  "usage_based_rates": [
    {
      "id": "ubr_zoXOJrDXlGGJWRNq3HqFYhbP",
      "description": "description",
      "included_units": 30,
      "name": "Compute Hours",
      "price": {
        "amount": {
          "currency_code": "usd",
          "value": "100"
        },
        "price_type": "flat"
      },
      "pricing_metric_id": "pmtr_GlX5Tcm2HOn00CoRTFxw2Amw",
      "usage_based_rate_type": "simple"
    }
  ],
  "description": "For production applications with moderate usage."
}