Skip to main content
DELETE
/
billing_rules
/
{billing_rule_token}
Delete billing rule
curl --request DELETE \
  --url https://api.vantage.sh/v2/billing_rules/{billing_rule_token} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.vantage.sh/v2/billing_rules/{billing_rule_token}"

headers = {"Authorization": "Bearer <token>"}

response = requests.delete(url, headers=headers)

print(response.text)
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.vantage.sh/v2/billing_rules/{billing_rule_token}', 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.vantage.sh/v2/billing_rules/{billing_rule_token}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

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

curl_close($curl);

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

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

func main() {

url := "https://api.vantage.sh/v2/billing_rules/{billing_rule_token}"

req, _ := http.NewRequest("DELETE", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

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

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

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.delete("https://api.vantage.sh/v2/billing_rules/{billing_rule_token}")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.vantage.sh/v2/billing_rules/{billing_rule_token}")

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

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "token": "<string>",
  "title": "Credit for Unused EC2 Instances",
  "type": "credit",
  "apply_to_all": true,
  "created_by_token": "usr_1234",
  "created_at": "2024-06-28T00:00:00Z",
  "start_date": "2024-06-28T00:00:00Z",
  "end_date": "2024-06-28T00:00:00Z",
  "service": "AWS Cloudfront",
  "category": "MSP Fee",
  "percentage": "75.0",
  "charge_type": "RIFee",
  "sub_category": "One-time",
  "start_period": "2024-05-01",
  "amount": "5000.25",
  "sql_query": "UPDATE costs SET costs.amount = costs.amount * 0.95"
}
{
"errors": [
"<string>"
],
"links": {
"self": "<string>",
"first": "<string>",
"next": "<string>",
"last": "<string>",
"prev": "<string>"
}
}

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

Response

BillingRule model

token
string
required
title
string
required

The title of the BillingRule.

Example:

"Credit for Unused EC2 Instances"

type
string
required

The type of the BillingRule.

Example:

"credit"

apply_to_all
boolean | null
required

Whether the BillingRule applies to all future managed accounts.

Example:

true

created_by_token
string
required

The token of the Creator of the BillingRule.

Example:

"usr_1234"

created_at
string
required

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

Example:

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

start_date
string | null

The start date of the BillingRule.

Example:

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

end_date
string | null

The end date of the BillingRule.

Example:

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

service
string | null

The service for the BillingRule (Charge).

Example:

"AWS Cloudfront"

category
string | null

The category for the BillingRule (Charge).

Example:

"MSP Fee"

percentage
string | null

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

Example:

"75.0"

charge_type
string | null

The charge type for the BillingRule.

Example:

"RIFee"

sub_category
string | null

The subcategory for the BillingRule (Charge).

Example:

"One-time"

start_period
string | null

The start period for the BillingRule (Charge).

Example:

"2024-05-01"

amount
string | null

The amount for the BillingRule (Charge).

Example:

"5000.25"

sql_query
string | null

The SQL query for the BillingRule (Custom).

Example:

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