Skip to main content
POST
/
v1
/
contract-pricing
/
rate-cards
/
getRateSchedule
Get a rate schedule
curl --request POST \
  --url https://api.metronome.com/v1/contract-pricing/rate-cards/getRateSchedule \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "rate_card_id": "f3d51ae8-f283-44e1-9933-a3cf9ad7a6fe",
  "starting_at": "2024-01-01T00:00:00.000Z",
  "selectors": [
    {
      "product_id": "d6300dbb-882e-4d2d-8dec-5125d16b65d0",
      "partial_pricing_group_values": {
        "region": "us-west-2",
        "cloud": "aws"
      }
    }
  ]
}
'
import requests

url = "https://api.metronome.com/v1/contract-pricing/rate-cards/getRateSchedule"

payload = {
"rate_card_id": "f3d51ae8-f283-44e1-9933-a3cf9ad7a6fe",
"starting_at": "2024-01-01T00:00:00.000Z",
"selectors": [
{
"product_id": "d6300dbb-882e-4d2d-8dec-5125d16b65d0",
"partial_pricing_group_values": {
"region": "us-west-2",
"cloud": "aws"
}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
rate_card_id: 'f3d51ae8-f283-44e1-9933-a3cf9ad7a6fe',
starting_at: '2024-01-01T00:00:00.000Z',
selectors: [
{
product_id: 'd6300dbb-882e-4d2d-8dec-5125d16b65d0',
partial_pricing_group_values: {region: 'us-west-2', cloud: 'aws'}
}
]
})
};

fetch('https://api.metronome.com/v1/contract-pricing/rate-cards/getRateSchedule', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.metronome.com/v1/contract-pricing/rate-cards/getRateSchedule",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'rate_card_id' => 'f3d51ae8-f283-44e1-9933-a3cf9ad7a6fe',
'starting_at' => '2024-01-01T00:00:00.000Z',
'selectors' => [
[
'product_id' => 'd6300dbb-882e-4d2d-8dec-5125d16b65d0',
'partial_pricing_group_values' => [
'region' => 'us-west-2',
'cloud' => 'aws'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.metronome.com/v1/contract-pricing/rate-cards/getRateSchedule"

payload := strings.NewReader("{\n \"rate_card_id\": \"f3d51ae8-f283-44e1-9933-a3cf9ad7a6fe\",\n \"starting_at\": \"2024-01-01T00:00:00.000Z\",\n \"selectors\": [\n {\n \"product_id\": \"d6300dbb-882e-4d2d-8dec-5125d16b65d0\",\n \"partial_pricing_group_values\": {\n \"region\": \"us-west-2\",\n \"cloud\": \"aws\"\n }\n }\n ]\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.metronome.com/v1/contract-pricing/rate-cards/getRateSchedule")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rate_card_id\": \"f3d51ae8-f283-44e1-9933-a3cf9ad7a6fe\",\n \"starting_at\": \"2024-01-01T00:00:00.000Z\",\n \"selectors\": [\n {\n \"product_id\": \"d6300dbb-882e-4d2d-8dec-5125d16b65d0\",\n \"partial_pricing_group_values\": {\n \"region\": \"us-west-2\",\n \"cloud\": \"aws\"\n }\n }\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.metronome.com/v1/contract-pricing/rate-cards/getRateSchedule")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"rate_card_id\": \"f3d51ae8-f283-44e1-9933-a3cf9ad7a6fe\",\n \"starting_at\": \"2024-01-01T00:00:00.000Z\",\n \"selectors\": [\n {\n \"product_id\": \"d6300dbb-882e-4d2d-8dec-5125d16b65d0\",\n \"partial_pricing_group_values\": {\n \"region\": \"us-west-2\",\n \"cloud\": \"aws\"\n }\n }\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "data": [
    {
      "product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "product_name": "<string>",
      "product_tags": [
        "<string>"
      ],
      "product_custom_fields": {},
      "starting_at": "2023-11-07T05:31:56Z",
      "entitled": true,
      "rate": {
        "price": 123,
        "tiers": [
          {
            "price": 123,
            "size": 123
          }
        ],
        "pricing_group_values": {},
        "credit_type": {
          "name": "<string>",
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
        }
      },
      "pricing_group_values": {},
      "ending_before": "2023-11-07T05:31:56Z",
      "commit_rate": {
        "price": 123,
        "tiers": [
          {
            "price": 123,
            "size": 123
          }
        ]
      }
    }
  ],
  "next_page": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

limit
integer

Max number of results that should be returned

Required range: 1 <= x <= 100
next_page
string

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

Body

application/json

Rate schedule filter options.

rate_card_id
string<uuid>
required

ID of the rate card to get the schedule for

starting_at
string<date-time>
required

inclusive starting point for the rates schedule

ending_before
string<date-time>

optional exclusive end date for the rates schedule. When not specified rates will show all future schedule segments.

selectors
object[]

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

Response

200 - application/json

Success

data
object[]
required
next_page
string | null