Get a billing group
curl --request GET \
--url https://api-eu.flexportal.io/v1/billing-groups/{billingGroupId} \
--header 'Authorization: Bearer <token>' \
--header 'Tenant-ID: <tenant-id>'import requests
url = "https://api-eu.flexportal.io/v1/billing-groups/{billingGroupId}"
headers = {
"Tenant-ID": "<tenant-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Tenant-ID': '<tenant-id>', Authorization: 'Bearer <token>'}
};
fetch('https://api-eu.flexportal.io/v1/billing-groups/{billingGroupId}', 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-eu.flexportal.io/v1/billing-groups/{billingGroupId}",
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>",
"Tenant-ID: <tenant-id>"
],
]);
$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-eu.flexportal.io/v1/billing-groups/{billingGroupId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Tenant-ID", "<tenant-id>")
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-eu.flexportal.io/v1/billing-groups/{billingGroupId}")
.header("Tenant-ID", "<tenant-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.flexportal.io/v1/billing-groups/{billingGroupId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Tenant-ID"] = '<tenant-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"billingGroup": {
"billingGroupId": "<string>",
"tenantId": "<string>",
"customerId": "<string>",
"groupName": "<string>",
"billingDay": 14,
"totalMonthlyAmount": 1,
"currency": "<string>",
"status": "active",
"createdBy": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"rentalIds": [],
"activeRentalCount": 0,
"notes": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Billing Groups
Get Billing Group
Retrieves a specific billing group by ID.
GET
/
v1
/
billing-groups
/
{billingGroupId}
Get a billing group
curl --request GET \
--url https://api-eu.flexportal.io/v1/billing-groups/{billingGroupId} \
--header 'Authorization: Bearer <token>' \
--header 'Tenant-ID: <tenant-id>'import requests
url = "https://api-eu.flexportal.io/v1/billing-groups/{billingGroupId}"
headers = {
"Tenant-ID": "<tenant-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Tenant-ID': '<tenant-id>', Authorization: 'Bearer <token>'}
};
fetch('https://api-eu.flexportal.io/v1/billing-groups/{billingGroupId}', 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-eu.flexportal.io/v1/billing-groups/{billingGroupId}",
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>",
"Tenant-ID: <tenant-id>"
],
]);
$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-eu.flexportal.io/v1/billing-groups/{billingGroupId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Tenant-ID", "<tenant-id>")
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-eu.flexportal.io/v1/billing-groups/{billingGroupId}")
.header("Tenant-ID", "<tenant-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eu.flexportal.io/v1/billing-groups/{billingGroupId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Tenant-ID"] = '<tenant-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"billingGroup": {
"billingGroupId": "<string>",
"tenantId": "<string>",
"customerId": "<string>",
"groupName": "<string>",
"billingDay": 14,
"totalMonthlyAmount": 1,
"currency": "<string>",
"status": "active",
"createdBy": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"rentalIds": [],
"activeRentalCount": 0,
"notes": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Overview
Retrieve details for a single billing group, including all associated subscriptions and the consolidated billing amount.Response Fields
| Field | Description |
|---|---|
billingGroupId | Unique identifier |
groupName | Display name |
customerId | Business customer ID |
rentalIds | Array of subscription IDs |
billingDay | Day of month for billing (1-28) |
totalMonthlyAmount | Sum of all subscription amounts |
currency | Currency code |
status | active or inactive |
createdAt | When group was created |
updatedAt | Last modification |
Common Use Cases
- Invoice Preview: Show what the consolidated invoice will include
- Group Management: View and verify subscriptions in a group
- Billing Inquiries: Answer customer questions about grouped billing
Example: Invoice Breakdown
async function getInvoiceBreakdown(billingGroupId) {
const group = await getBillingGroup(billingGroupId);
// Get details for each subscription in the group
const subscriptions = await Promise.all(
group.rentalIds.map(id => getSubscription(id))
);
return {
groupName: group.groupName,
billingDay: group.billingDay,
items: subscriptions.map(sub => ({
product: sub.productName,
serialNumber: sub.serialNumber,
monthlyAmount: sub.monthlyAmount
})),
total: group.totalMonthlyAmount,
currency: group.currency
};
}
Related Endpoints
- List Billing Groups - Browse all groups
- Update Billing Group - Modify group
- Get Subscription - View subscription details
Authorizations
API key obtained from FlexPortal dashboard
Headers
Your tenant identifier
Path Parameters
The billing group ID
Was this page helpful?