Skip to main content
PUT
/
billing_rules
/
{billing_rule_token}
Update billing rule
curl --request PUT \
  --url https://api.vantage.sh/v2/billing_rules/{billing_rule_token} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "<string>",
  "charge_type": "<string>",
  "percentage": 123,
  "service": "<string>",
  "category": "<string>",
  "sub_category": "<string>",
  "start_period": "<string>",
  "amount": 123,
  "start_date": "<string>",
  "end_date": "<string>",
  "apply_to_all": true,
  "sql_query": "<string>"
}
'
{
  "token": "bllng_rule_16c2d217f026d23e",
  "title": "Updated Adjustment",
  "type": "Adjustment",
  "created_by_token": "usr_cef510966067477f",
  "created_at": "2024-07-02T15:26:52Z",
  "service": "Amazon S3",
  "category": "Data Transfer",
  "adjusted_rate": "0.85"
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

billing_rule_token
string
required

Body

application/json

Update a BillingRule.

title
string

The title of the BillingRule.

charge_type
string

The charge type of the BillingRule.

percentage
number<double>

The percentage of the cost shown. Example value: 75.0

service
string

The service of the BillingRule.

category
string

The category of the BillingRule.

sub_category
string

The subcategory of the BillingRule.

start_period
string

The start period of the BillingRule.

amount
number<double>

The credit amount for the BillingRule. Example value: 300

start_date
string

The start date of the BillingRule. ISO 8601 formatted.

end_date
string

The end date of the BillingRule. ISO 8601 formatted.

apply_to_all
boolean

Determines if the BillingRule applies to all current and future managed accounts.

sql_query
string

The SQL query of the BillingRule.

Response

BillingRule model

token
string
title
string

The title of the BillingRule.

Example:

"Credit for Unused EC2 Instances"

type
string

The type of the BillingRule.

Example:

"credit"

start_date
string

The start date of the BillingRule.

Example:

"2024-06-28T00:00:00Z"

end_date
string

The end date of the BillingRule.

Example:

"2024-06-28T00:00:00Z"

apply_to_all
boolean

Whether the BillingRule applies to all future managed accounts.

Example:

true

created_by_token
string

The token of the Creator of the BillingRule.

Example:

"usr_1234"

created_at
string

The date and time, in UTC, the BillingRule was created. ISO 8601 Formatted.

Example:

"2024-06-28T00:00:00Z"

service
string

The service for the BillingRule (Charge).

Example:

"AWS Cloudfront"

category
string

The category for the BillingRule (Charge).

Example:

"MSP Fee"

percentage
string

The percentage of the cost shown for the BillingRule (Adjustment).

Example:

"75.0"

charge_type
string

The charge type for the BillingRule.

Example:

"RIFee"

sub_category
string

The subcategory for the BillingRule (Charge).

Example:

"One-time"

start_period
string

The start period for the BillingRule (Charge).

Example:

"2024-05-01"

amount
string

The amount for the BillingRule (Charge).

Example:

"5000.25"

sql_query
string

The SQL query for the BillingRule (Custom).

Example:

"UPDATE costs SET costs.amount = costs.amount * 0.95"