Skip to content
  • Auto
  • Light
  • Dark
Talk to an expert

Retrieve Rate Schedule

Get the rate schedule for a contract
v1.contracts.retrieve_rate_schedule(ContractRetrieveRateScheduleParams**kwargs) -> datalistnext_pagestrContractRetrieveRateScheduleResponse
post/v1/contracts/getContractRateSchedule

Get the rate schedule for the rate card on a given contract.

Parameters
contract_idstr

ID of the contract to get the rate schedule for.

formatuuid
customer_idstr

ID of the customer for whose contract to get the rate schedule for.

formatuuid
limitint
optional

Max number of results that should be returned

minimum1
maximum100
next_pagestr
optional

Cursor that indicates where the next page of results should start.

atunion
optional
Union[str, datetime]

optional timestamp which overlaps with the returned rate schedule segments. When not specified, the current timestamp will be used.

formatdate-time
selectorsiterable
optional
billing_frequencyliteralpartial_pricing_group_valuesDict[str, str]pricing_group_valuesDict[str, str]product_idstrproduct_tagslistIterable[Selector]

List of rate selectors, rates matching ANY of the selectors will be included in the response. Passing no selectors will result in all rates being returned.

Hide ParametersShow Parameters
billing_frequencyliteral
optional
Literal["MONTHLY", "QUARTERLY", "ANNUAL", "WEEKLY"]

Subscription rates matching the billing frequency will be included in the response.

Hide ParametersShow Parameters
"MONTHLY"
"QUARTERLY"
"ANNUAL"
"WEEKLY"
partial_pricing_group_valuesDict[str, str]
optional
Dict[str, str]

List of pricing group key value pairs, rates containing the matching key / value pairs will be included in the response.

pricing_group_valuesDict[str, str]
optional
Dict[str, str]

List of pricing group key value pairs, rates matching all of the key / value pairs will be included in the response.

product_idstr
optional

Rates matching the product id will be included in the response.

formatuuid
product_tagslist
optional
List[str]

List of product tags, rates matching any of the tags will be included in the response.

Returns
ContractRetrieveRateScheduleResponseclass
Hide ParametersShow Parameters
datalist
List[Data]
Hide ParametersShow Parameters
entitledbool
list_raterate_typeliteralcredit_typeCreditTypeDatacustom_rateDict[str, object]is_proratedboolpricefloatpricing_group_valuesDict[str, str]quantityfloattierslistuse_list_pricesboolRate
product_custom_fieldsDict[str, str]
Dict[str, str]
product_idstr
formatuuid
product_namestr
product_tagslist
List[str]
rate_card_idstr
formatuuid
starting_atdatetime
formatdate-time
billing_frequencyliteral
optional
Optional[Literal["MONTHLY", "QUARTERLY", "ANNUAL", "WEEKLY"]]
Hide ParametersShow Parameters
"MONTHLY"
"QUARTERLY"
"ANNUAL"
"WEEKLY"
commit_raterate_typeliteralpricefloattierslistDataCommitRate
optional

A distinct rate on the rate card. You can choose to use this rate rather than list rate when consuming a credit or commit.

Hide ParametersShow Parameters
rate_typeliteral
Literal["FLAT", "PERCENTAGE", "SUBSCRIPTION", 2 more]
Hide ParametersShow Parameters
"FLAT"
"PERCENTAGE"
"SUBSCRIPTION"
"TIERED"
"CUSTOM"
pricefloat
optional

Commit rate price. For FLAT rate_type, this must be >=0.

tierslist
optional
Optional[List[pricefloatsizefloatTier]]

Only set for TIERED rate_type.

Hide ParametersShow Parameters
pricefloat
sizefloat
optional
ending_beforedatetime
optional
formatdate-time
override_rateRate
optional
pricing_group_valuesDict[str, str]
optional
Optional[Dict[str, str]]
next_pagestr
optional
from datetime import datetime
from metronome import Metronome

client = Metronome(
    bearer_token="My Bearer Token",
)
response = client.v1.contracts.retrieve_rate_schedule(
    contract_id="d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc",
    customer_id="13117714-3f05-48e5-a6e9-a66093f13b4d",
    at=datetime.fromisoformat("2020-01-01T00:00:00.000"),
    selectors=[{
        "product_id": "d6300dbb-882e-4d2d-8dec-5125d16b65d0",
        "partial_pricing_group_values": {
            "region": "us-west-2",
            "cloud": "aws",
        },
    }],
)
print(response.data)
200 Example
{
  "data": [
    {
      "entitled": true,
      "list_rate": {
        "rate_type": "FLAT",
        "credit_type": {
          "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
          "name": "name"
        },
        "custom_rate": {
          "foo": "bar"
        },
        "is_prorated": true,
        "price": 0,
        "pricing_group_values": {
          "foo": "string"
        },
        "quantity": 0,
        "tiers": [
          {
            "price": 0,
            "size": 0
          }
        ],
        "use_list_prices": true
      },
      "product_custom_fields": {
        "foo": "string"
      },
      "product_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "product_name": "product_name",
      "product_tags": [
        "string"
      ],
      "rate_card_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "starting_at": "2019-12-27T18:11:19.117Z",
      "billing_frequency": "MONTHLY",
      "commit_rate": {
        "rate_type": "FLAT",
        "price": 0,
        "tiers": [
          {
            "price": 0,
            "size": 0
          }
        ]
      },
      "ending_before": "2019-12-27T18:11:19.117Z",
      "override_rate": {
        "rate_type": "FLAT",
        "credit_type": {
          "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
          "name": "name"
        },
        "custom_rate": {
          "foo": "bar"
        },
        "is_prorated": true,
        "price": 0,
        "pricing_group_values": {
          "foo": "string"
        },
        "quantity": 0,
        "tiers": [
          {
            "price": 0,
            "size": 0
          }
        ],
        "use_list_prices": true
      },
      "pricing_group_values": {
        "foo": "string"
      }
    }
  ],
  "next_page": "next_page"
}