Delete rate phase
curl --request DELETE \
--url https://api.getlago.com/api/v2/contracts/{contract_external_id}/applied_rate_cards/{applied_rate_card_code}/rate_phases/{code} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.getlago.com/api/v2/contracts/{contract_external_id}/applied_rate_cards/{applied_rate_card_code}/rate_phases/{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/contracts/{contract_external_id}/applied_rate_cards/{applied_rate_card_code}/rate_phases/{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/contracts/{contract_external_id}/applied_rate_cards/{applied_rate_card_code}/rate_phases/{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/contracts/{contract_external_id}/applied_rate_cards/{applied_rate_card_code}/rate_phases/{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/contracts/{contract_external_id}/applied_rate_cards/{applied_rate_card_code}/rate_phases/{code}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getlago.com/api/v2/contracts/{contract_external_id}/applied_rate_cards/{applied_rate_card_code}/rate_phases/{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_phase": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"code": "example",
"position": 1,
"name": "example",
"billing_interval_cycle_count": 1,
"rate_override": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"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",
"pricing_unit_conversion_rate": "1.5",
"deleted_at": null
},
"deleted_at": null
}
}{
"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 phases
Delete rate phase
Removes the phase and renumbers later positions.
DELETE
/
contracts
/
{contract_external_id}
/
applied_rate_cards
/
{applied_rate_card_code}
/
rate_phases
/
{code}
Delete rate phase
curl --request DELETE \
--url https://api.getlago.com/api/v2/contracts/{contract_external_id}/applied_rate_cards/{applied_rate_card_code}/rate_phases/{code} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.getlago.com/api/v2/contracts/{contract_external_id}/applied_rate_cards/{applied_rate_card_code}/rate_phases/{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/contracts/{contract_external_id}/applied_rate_cards/{applied_rate_card_code}/rate_phases/{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/contracts/{contract_external_id}/applied_rate_cards/{applied_rate_card_code}/rate_phases/{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/contracts/{contract_external_id}/applied_rate_cards/{applied_rate_card_code}/rate_phases/{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/contracts/{contract_external_id}/applied_rate_cards/{applied_rate_card_code}/rate_phases/{code}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getlago.com/api/v2/contracts/{contract_external_id}/applied_rate_cards/{applied_rate_card_code}/rate_phases/{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_phase": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"code": "example",
"position": 1,
"name": "example",
"billing_interval_cycle_count": 1,
"rate_override": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"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",
"pricing_unit_conversion_rate": "1.5",
"deleted_at": null
},
"deleted_at": null
}
}{
"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.Authorizations
Path Parameters
Query Parameters
Code of the contract to select. Required when multiple contracts share the external ID, including canceled and terminated contracts. Otherwise, it can be omitted. Omitting it when the external ID is ambiguous returns 422 value_is_mandatory on contract_code; a blank value returns 422 value_is_invalid. Exact contract code.
Minimum string length:
1Example:
"initial"