Delete rate card
curl --request DELETE \
--url https://api.getlago.com/api/v2/rate_cards/{code} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.getlago.com/api/v2/rate_cards/{code}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.getlago.com/api/v2/rate_cards/{code}', 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.getlago.com/api/v2/rate_cards/{code}",
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.getlago.com/api/v2/rate_cards/{code}"
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.getlago.com/api/v2/rate_cards/{code}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getlago.com/api/v2/rate_cards/{code}")
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{
"rate_card": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "example",
"code": "example",
"description": "example",
"created_at": "2022-04-29T08:59:51.123456Z",
"updated_at": "2022-04-29T08:59:51.123456Z",
"deleted_at": null,
"product_code": "api_requests",
"product_filter_code": "eu",
"currency": "USD",
"billing_timing": "arrears",
"proration": false,
"display_on_invoice": false,
"regroup_paid_fees": "invoice",
"applied_pricing_unit_code": "example",
"active_rate": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"code": "example",
"rate_card_code": "compute_usd",
"status": "pending",
"rate_model": "standard",
"rate_properties": {
"amount": "1.5",
"free_units": 0,
"package_size": 100,
"rate": "1.5",
"fixed_amount": "1.5",
"free_units_per_events": 0,
"free_units_per_total_aggregation": "1.5",
"per_transaction_min_amount": "1.5",
"per_transaction_max_amount": "1.5",
"graduated_ranges": [
{
"to_value": null,
"flat_amount": "1.5",
"per_unit_amount": "1.5",
"rate": "1.5"
}
],
"volume_ranges": [
{
"to_value": null,
"flat_amount": "1.5",
"per_unit_amount": "1.5",
"rate": "1.5"
}
],
"graduated_percentage_ranges": [
{
"to_value": null,
"flat_amount": "1.5",
"per_unit_amount": "1.5",
"rate": "1.5"
}
]
},
"min_amount_cents": 100,
"billing_interval_count": 1,
"billing_interval_unit": "day",
"applied_pricing_unit_conversion_rate": "1.5",
"effective_from": "2022-04-29T08:59:51.123456Z",
"created_at": "2022-04-29T08:59:51.123456Z",
"updated_at": "2022-04-29T08:59:51.123456Z",
"deleted_at": null
},
"rates": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"code": "example",
"rate_card_code": "compute_usd",
"status": "pending",
"rate_model": "standard",
"rate_properties": {
"amount": "1.5",
"free_units": 0,
"package_size": 100,
"rate": "1.5",
"fixed_amount": "1.5",
"free_units_per_events": 0,
"free_units_per_total_aggregation": "1.5",
"per_transaction_min_amount": "1.5",
"per_transaction_max_amount": "1.5",
"graduated_ranges": [
{
"to_value": null,
"flat_amount": "1.5",
"per_unit_amount": "1.5",
"rate": "1.5"
}
],
"volume_ranges": [
{
"to_value": null,
"flat_amount": "1.5",
"per_unit_amount": "1.5",
"rate": "1.5"
}
],
"graduated_percentage_ranges": [
{
"to_value": null,
"flat_amount": "1.5",
"per_unit_amount": "1.5",
"rate": "1.5"
}
]
},
"min_amount_cents": 100,
"billing_interval_count": 1,
"billing_interval_unit": "day",
"applied_pricing_unit_conversion_rate": "1.5",
"effective_from": "2022-04-29T08:59:51.123456Z",
"created_at": "2022-04-29T08:59:51.123456Z",
"updated_at": "2022-04-29T08:59:51.123456Z",
"deleted_at": null
}
],
"taxes": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "VAT",
"code": "standard_vat",
"rate": 20,
"description": "Standard VAT",
"created_at": "2022-04-29T08:59:51.123456Z",
"updated_at": "2022-04-29T09:30:00.123456Z",
"deleted_at": null
}
],
"product": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "example",
"code": "example",
"description": "Example",
"invoice_display_name": "example",
"created_at": "2022-04-29T08:59:51.123456Z",
"updated_at": "2022-04-29T08:59:51.123456Z",
"deleted_at": null,
"product_category_code": "compute",
"billable_metric_code": "api_requests",
"product_type": "metered",
"product_category": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "example",
"code": "example",
"description": "example",
"invoice_display_name": "example",
"created_at": "2022-04-29T08:59:51.123456Z",
"updated_at": "2022-04-29T08:59:51.123456Z",
"deleted_at": null
},
"billable_metric": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "example",
"code": "example",
"description": "example",
"aggregation_type": "count_agg",
"weighted_interval": "seconds",
"recurring": false,
"rounding_function": "round",
"rounding_precision": 1,
"field_name": "example",
"expression": "example",
"created_at": "2022-04-29T08:59:51.123456Z",
"updated_at": "2022-04-29T08:59:51.123456Z",
"deleted_at": null
}
},
"product_filter": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "example",
"code": "example",
"description": "example",
"invoice_display_name": "example",
"created_at": "2022-04-29T08:59:51.123456Z",
"updated_at": "2022-04-29T08:59:51.123456Z",
"deleted_at": null,
"product_code": "api_requests",
"product_category_code": "compute",
"values": [
{
"key": "region",
"value": "eu"
}
]
}
}
}{
"code": "invalid_expand",
"details": [
{
"code": "malformed",
"field": "expands",
"meta": {
"allowed_values": []
}
}
]
}{
"code": "unauthorized",
"details": []
}{
"code": "feature_unavailable",
"details": []
}{
"code": "resource_not_found",
"details": [
{
"code": "resource_not_found",
"field": "base",
"meta": {
"resource": "resource_name"
}
}
]
}{
"code": "validation_errors",
"details": [
{
"code": "value_is_mandatory",
"field": "name",
"meta": {}
}
]
}Rate cards
Delete rate card
Deletes an unused rate card and its rates.
DELETE
/
rate_cards
/
{code}
Delete rate card
curl --request DELETE \
--url https://api.getlago.com/api/v2/rate_cards/{code} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.getlago.com/api/v2/rate_cards/{code}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.getlago.com/api/v2/rate_cards/{code}', 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.getlago.com/api/v2/rate_cards/{code}",
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.getlago.com/api/v2/rate_cards/{code}"
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.getlago.com/api/v2/rate_cards/{code}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getlago.com/api/v2/rate_cards/{code}")
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{
"rate_card": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "example",
"code": "example",
"description": "example",
"created_at": "2022-04-29T08:59:51.123456Z",
"updated_at": "2022-04-29T08:59:51.123456Z",
"deleted_at": null,
"product_code": "api_requests",
"product_filter_code": "eu",
"currency": "USD",
"billing_timing": "arrears",
"proration": false,
"display_on_invoice": false,
"regroup_paid_fees": "invoice",
"applied_pricing_unit_code": "example",
"active_rate": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"code": "example",
"rate_card_code": "compute_usd",
"status": "pending",
"rate_model": "standard",
"rate_properties": {
"amount": "1.5",
"free_units": 0,
"package_size": 100,
"rate": "1.5",
"fixed_amount": "1.5",
"free_units_per_events": 0,
"free_units_per_total_aggregation": "1.5",
"per_transaction_min_amount": "1.5",
"per_transaction_max_amount": "1.5",
"graduated_ranges": [
{
"to_value": null,
"flat_amount": "1.5",
"per_unit_amount": "1.5",
"rate": "1.5"
}
],
"volume_ranges": [
{
"to_value": null,
"flat_amount": "1.5",
"per_unit_amount": "1.5",
"rate": "1.5"
}
],
"graduated_percentage_ranges": [
{
"to_value": null,
"flat_amount": "1.5",
"per_unit_amount": "1.5",
"rate": "1.5"
}
]
},
"min_amount_cents": 100,
"billing_interval_count": 1,
"billing_interval_unit": "day",
"applied_pricing_unit_conversion_rate": "1.5",
"effective_from": "2022-04-29T08:59:51.123456Z",
"created_at": "2022-04-29T08:59:51.123456Z",
"updated_at": "2022-04-29T08:59:51.123456Z",
"deleted_at": null
},
"rates": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"code": "example",
"rate_card_code": "compute_usd",
"status": "pending",
"rate_model": "standard",
"rate_properties": {
"amount": "1.5",
"free_units": 0,
"package_size": 100,
"rate": "1.5",
"fixed_amount": "1.5",
"free_units_per_events": 0,
"free_units_per_total_aggregation": "1.5",
"per_transaction_min_amount": "1.5",
"per_transaction_max_amount": "1.5",
"graduated_ranges": [
{
"to_value": null,
"flat_amount": "1.5",
"per_unit_amount": "1.5",
"rate": "1.5"
}
],
"volume_ranges": [
{
"to_value": null,
"flat_amount": "1.5",
"per_unit_amount": "1.5",
"rate": "1.5"
}
],
"graduated_percentage_ranges": [
{
"to_value": null,
"flat_amount": "1.5",
"per_unit_amount": "1.5",
"rate": "1.5"
}
]
},
"min_amount_cents": 100,
"billing_interval_count": 1,
"billing_interval_unit": "day",
"applied_pricing_unit_conversion_rate": "1.5",
"effective_from": "2022-04-29T08:59:51.123456Z",
"created_at": "2022-04-29T08:59:51.123456Z",
"updated_at": "2022-04-29T08:59:51.123456Z",
"deleted_at": null
}
],
"taxes": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "VAT",
"code": "standard_vat",
"rate": 20,
"description": "Standard VAT",
"created_at": "2022-04-29T08:59:51.123456Z",
"updated_at": "2022-04-29T09:30:00.123456Z",
"deleted_at": null
}
],
"product": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "example",
"code": "example",
"description": "Example",
"invoice_display_name": "example",
"created_at": "2022-04-29T08:59:51.123456Z",
"updated_at": "2022-04-29T08:59:51.123456Z",
"deleted_at": null,
"product_category_code": "compute",
"billable_metric_code": "api_requests",
"product_type": "metered",
"product_category": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "example",
"code": "example",
"description": "example",
"invoice_display_name": "example",
"created_at": "2022-04-29T08:59:51.123456Z",
"updated_at": "2022-04-29T08:59:51.123456Z",
"deleted_at": null
},
"billable_metric": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "example",
"code": "example",
"description": "example",
"aggregation_type": "count_agg",
"weighted_interval": "seconds",
"recurring": false,
"rounding_function": "round",
"rounding_precision": 1,
"field_name": "example",
"expression": "example",
"created_at": "2022-04-29T08:59:51.123456Z",
"updated_at": "2022-04-29T08:59:51.123456Z",
"deleted_at": null
}
},
"product_filter": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "example",
"code": "example",
"description": "example",
"invoice_display_name": "example",
"created_at": "2022-04-29T08:59:51.123456Z",
"updated_at": "2022-04-29T08:59:51.123456Z",
"deleted_at": null,
"product_code": "api_requests",
"product_category_code": "compute",
"values": [
{
"key": "region",
"value": "eu"
}
]
}
}
}{
"code": "invalid_expand",
"details": [
{
"code": "malformed",
"field": "expands",
"meta": {
"allowed_values": []
}
}
]
}{
"code": "unauthorized",
"details": []
}{
"code": "feature_unavailable",
"details": []
}{
"code": "resource_not_found",
"details": [
{
"code": "resource_not_found",
"field": "base",
"meta": {
"resource": "resource_name"
}
}
]
}{
"code": "validation_errors",
"details": [
{
"code": "value_is_mandatory",
"field": "name",
"meta": {}
}
]
}API v2 is in beta. Endpoints return the
X-Lago-Endpoint-Status: beta header.