Retrieve a fixed charge for a subscription
curl --request GET \
--url https://api.getlago.com/api/v1/subscriptions/{external_id}/fixed_charges/{fixed_charge_code} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.getlago.com/api/v1/subscriptions/{external_id}/fixed_charges/{fixed_charge_code}"
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/v1/subscriptions/{external_id}/fixed_charges/{fixed_charge_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/v1/subscriptions/{external_id}/fixed_charges/{fixed_charge_code}",
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/v1/subscriptions/{external_id}/fixed_charges/{fixed_charge_code}"
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/v1/subscriptions/{external_id}/fixed_charges/{fixed_charge_code}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getlago.com/api/v1/subscriptions/{external_id}/fixed_charges/{fixed_charge_code}")
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{
"fixed_charge": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"lago_add_on_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"invoice_display_name": "Setup fee",
"add_on_code": "setup_fee",
"created_at": "2023-06-27T19:43:42Z",
"code": "setup_fee",
"charge_model": "standard",
"pay_in_advance": false,
"prorated": false,
"properties": {
"amount": "30",
"graduated_ranges": [
{
"from_value": 0,
"to_value": 10,
"flat_amount": "10",
"per_unit_amount": "0.5"
}
],
"volume_ranges": [
{
"from_value": 0,
"to_value": 10,
"flat_amount": "10",
"per_unit_amount": "0.5"
}
]
},
"units": 1,
"lago_parent_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"taxes": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "TVA",
"code": "french_standard_vat",
"rate": 20,
"applied_to_organization": true,
"created_at": "2023-07-06T14:35:58Z",
"description": "French standard VAT"
}
]
}
}{
"status": 401,
"error": "Unauthorized"
}{
"status": 404,
"error": "Not Found",
"code": "object_not_found"
}Fixed Charges
Retrieve a fixed charge
This endpoint retrieves a specific effective fixed charge for a subscription.
The units reflect any per-subscription unit override applied to the subscription; when no override exists, the plan-level units are returned.
GET
/
subscriptions
/
{external_id}
/
fixed_charges
/
{fixed_charge_code}
Retrieve a fixed charge for a subscription
curl --request GET \
--url https://api.getlago.com/api/v1/subscriptions/{external_id}/fixed_charges/{fixed_charge_code} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.getlago.com/api/v1/subscriptions/{external_id}/fixed_charges/{fixed_charge_code}"
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/v1/subscriptions/{external_id}/fixed_charges/{fixed_charge_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/v1/subscriptions/{external_id}/fixed_charges/{fixed_charge_code}",
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/v1/subscriptions/{external_id}/fixed_charges/{fixed_charge_code}"
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/v1/subscriptions/{external_id}/fixed_charges/{fixed_charge_code}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getlago.com/api/v1/subscriptions/{external_id}/fixed_charges/{fixed_charge_code}")
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{
"fixed_charge": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"lago_add_on_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"invoice_display_name": "Setup fee",
"add_on_code": "setup_fee",
"created_at": "2023-06-27T19:43:42Z",
"code": "setup_fee",
"charge_model": "standard",
"pay_in_advance": false,
"prorated": false,
"properties": {
"amount": "30",
"graduated_ranges": [
{
"from_value": 0,
"to_value": 10,
"flat_amount": "10",
"per_unit_amount": "0.5"
}
],
"volume_ranges": [
{
"from_value": 0,
"to_value": 10,
"flat_amount": "10",
"per_unit_amount": "0.5"
}
]
},
"units": 1,
"lago_parent_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"taxes": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "TVA",
"code": "french_standard_vat",
"rate": 20,
"applied_to_organization": true,
"created_at": "2023-07-06T14:35:58Z",
"description": "French standard VAT"
}
]
}
}{
"status": 401,
"error": "Unauthorized"
}{
"status": 404,
"error": "Not Found",
"code": "object_not_found"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
External ID of the existing subscription.
Example:
"sub_1234567890"
Code of the existing fixed charge.
Example:
"setup_fee_charge"
Query Parameters
Filter by subscription status. When provided, the subscription is looked up with this status instead of the default active status. Possible values are pending, active, terminated, or canceled.
Available options:
pending, active, terminated, canceled Example:
"active"
Response
Fixed Charge
Show child attributes
Show child attributes
⌘I