curl --request GET \
--url https://api.getlago.com/api/v2/contracts/{contract_external_id}/applied_rate_cards \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.getlago.com/api/v2/contracts/{contract_external_id}/applied_rate_cards"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.getlago.com/api/v2/contracts/{contract_external_id}/applied_rate_cards', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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"
req, _ := http.NewRequest("GET", 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.get("https://api.getlago.com/api/v2/contracts/{contract_external_id}/applied_rate_cards")
.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")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"applied_rate_cards": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"external_contract_id": "contract_123",
"rate_card_code": "compute_usd",
"product_code": "api_requests",
"product_filter_code": "eu",
"units": "1.5",
"effective_date": "2022-04-29",
"billing_anchor_date": "2022-04-29",
"next_billing_at": null,
"created_at": "2022-04-29T08:59:51.123456Z",
"updated_at": "2022-04-29T08:59:51.123456Z",
"deleted_at": null,
"billing_scope": "cycle"
}
],
"meta": {
"next_cursor": null,
"prev_cursor": null,
"total_count": 42,
"total_count_estimated": true
}
}{
"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": {}
}
]
}List contract applied rate cards
Returns a cursor-paginated list ordered by creation time, newest first.
curl --request GET \
--url https://api.getlago.com/api/v2/contracts/{contract_external_id}/applied_rate_cards \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.getlago.com/api/v2/contracts/{contract_external_id}/applied_rate_cards"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.getlago.com/api/v2/contracts/{contract_external_id}/applied_rate_cards', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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"
req, _ := http.NewRequest("GET", 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.get("https://api.getlago.com/api/v2/contracts/{contract_external_id}/applied_rate_cards")
.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")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"applied_rate_cards": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"external_contract_id": "contract_123",
"rate_card_code": "compute_usd",
"product_code": "api_requests",
"product_filter_code": "eu",
"units": "1.5",
"effective_date": "2022-04-29",
"billing_anchor_date": "2022-04-29",
"next_billing_at": null,
"created_at": "2022-04-29T08:59:51.123456Z",
"updated_at": "2022-04-29T08:59:51.123456Z",
"deleted_at": null,
"billing_scope": "cycle"
}
],
"meta": {
"next_cursor": null,
"prev_cursor": null,
"total_count": 42,
"total_count_estimated": true
}
}{
"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": {}
}
]
}X-Lago-Endpoint-Status: beta header.Authorizations
Query Parameters
Opaque next_cursor from a previous response. Returns the next page. Cannot be combined with before or include_total_count=true. Keep the same filters when paging.
"eyJ2IjoxLCJvIjp7InQiOiJ0YXhlcyIsInMiOiJjcmVhdGVkX2F0OmRlc2MsaWQ6ZGVzYyJ9LCJrIjpbIjIwMjItMDQtMjlUMDg6NTk6NTEuMDAwMDAwWiIsIjFhOTAxYTkwLTFhOTAtMWE5MC0xYTkwLTFhOTAxYTkwMWE5MCJdfQ"
Opaque prev_cursor from a previous response. Returns the previous page in the same list order. Cannot be combined with after or include_total_count=true. Keep the same filters when paging.
"eyJ2IjoxLCJvIjp7InQiOiJ0YXhlcyIsInMiOiJjcmVhdGVkX2F0OmRlc2MsaWQ6ZGVzYyJ9LCJrIjpbIjIwMjItMDQtMjlUMDg6NTk6NTEuMDAwMDAwWiIsIjFhOTAxYTkwLTFhOTAtMWE5MC0xYTkwLTFhOTAxYTkwMWE5MCJdfQ"
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.
1"initial"