Retrieve Rate Schedule
Get the rate schedule for a contract
client.V1.Contracts.GetRateSchedule(ctx, params) (*DataarrayNextPagestringV1ContractGetRateScheduleResponse, error)
post/v1/contracts/getContractRateSchedule
Get the rate schedule for the rate card on a given contract.
Parameters
paramsContractIDfieldCustomerIDfieldLimitfieldNextPagefieldAtfieldSelectorsfieldV1ContractGetRateScheduleParams
Returns
V1ContractGetRateScheduleResponsestruct
package main
import (
"context"
"fmt"
"time"
"github.com/Metronome-Industries/metronome-go"
"github.com/Metronome-Industries/metronome-go/option"
)
func main() {
client := metronome.NewClient(
option.WithBearerToken("My Bearer Token"),
)
response, err := client.V1.Contracts.GetRateSchedule(context.TODO(), metronome.V1ContractGetRateScheduleParams{
ContractID: metronome.F("d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc"),
CustomerID: metronome.F("13117714-3f05-48e5-a6e9-a66093f13b4d"),
At: metronome.F(time.Now()),
Selectors: metronome.F([]metronome.V1ContractGetRateScheduleParamsSelector{metronome.V1ContractGetRateScheduleParamsSelector{
ProductID: metronome.F("d6300dbb-882e-4d2d-8dec-5125d16b65d0"),
PartialPricingGroupValues: metronome.F(map[string]string{
"region": "us-west-2",
"cloud": "aws",
}),
}}),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", 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"
}