List billing groups
curl --request GET \
--url https://api-eu.flexportal.io/v1/billing-groups \
--header 'Authorization: Bearer <token>' \
--header 'Tenant-ID: <tenant-id>'import requests
url = "https://api-eu.flexportal.io/v1/billing-groups"
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', 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",
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"
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")
.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")
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,
"billingGroups": [
{
"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>"
}
],
"count": 123,
"hasMore": true,
"nextCursor": "<string>"
}Billing Groups
List Billing Groups
Returns a list of billing groups for consolidated B2B billing.
GET
/
v1
/
billing-groups
List billing groups
curl --request GET \
--url https://api-eu.flexportal.io/v1/billing-groups \
--header 'Authorization: Bearer <token>' \
--header 'Tenant-ID: <tenant-id>'import requests
url = "https://api-eu.flexportal.io/v1/billing-groups"
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', 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",
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"
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")
.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")
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,
"billingGroups": [
{
"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>"
}
],
"count": 123,
"hasMore": true,
"nextCursor": "<string>"
}Overview
Retrieve a list of billing groups. Billing groups are a B2B feature that consolidates multiple subscriptions for a single customer into one monthly invoice, simplifying billing for business customers with many devices.What Are Billing Groups?
Instead of billing each subscription separately:Without Billing Group:
Subscription 1 → Invoice 1 (€129)
Subscription 2 → Invoice 2 (€89)
Subscription 3 → Invoice 3 (€159)
= 3 separate invoices/payments
With Billing Group:
Subscription 1 ─┐
Subscription 2 ─┼→ Single Invoice (€377)
Subscription 3 ─┘
= 1 consolidated invoice/payment
Common Use Cases
B2B Account Management
Manage billing groups for business customers
Invoice Consolidation
View which subscriptions are grouped for billing
Billing Operations
Monitor monthly billing totals per customer
Customer Portal
Show business customers their billing groups
Filtering Billing Groups
# Get billing groups for a customer
GET /v1/billing-groups?customerId=cust_abc123
# Get active billing groups
GET /v1/billing-groups?status=active
Response Fields
| Field | Description |
|---|---|
billingGroupId | Unique identifier |
groupName | Display name for the group |
customerId | Associated business customer |
rentalIds | Array of subscription IDs in this group |
billingDay | Day of month for billing (1-28) |
totalMonthlyAmount | Combined monthly total |
currency | Currency code |
status | active or inactive |
createdAt | ISO 8601 timestamp |
Example: Customer Billing Summary
async function getCustomerBillingSummary(customerId) {
const { billingGroups } = await listBillingGroups({ customerId });
return billingGroups.map(group => ({
groupName: group.groupName,
deviceCount: group.rentalIds.length,
monthlyTotal: `${group.currency} ${group.totalMonthlyAmount}`,
billingDay: group.billingDay
}));
}
Related Endpoints
- Get Billing Group - View group details
- Create Billing Group - Create new group
- Update Billing Group - Modify group
- List Subscriptions - View grouped subscriptions
Authorizations
API key obtained from FlexPortal dashboard
Headers
Your tenant identifier
Query Parameters
Items per page (default: 50, max: 100)
Cursor for pagination
Filter by customer ID
Filter by status (active, inactive)
Was this page helpful?