Skip to main content
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>'
{
  "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 a billing group:
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

FieldDescription
billingGroupIdUnique identifier
groupNameDisplay name for the group
customerIdAssociated business customer
rentalIdsArray of subscription IDs in this group
billingDayDay of month for billing (1-28)
totalMonthlyAmountCombined monthly total
currencyCurrency code
statusactive or inactive
createdAtISO 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
  }));
}

Authorizations

Authorization
string
header
required

API key obtained from FlexPortal dashboard

Headers

Tenant-ID
string
required

Your tenant identifier

Query Parameters

limit
string

Items per page (default: 50, max: 100)

startAfter
string

Cursor for pagination

customerId
string

Filter by customer ID

status
string

Filter by status (active, inactive)

Response

200 - application/json

List of billing groups

success
enum<boolean>
required
Available options:
true,
false
billingGroups
object[]
required
count
number
required
hasMore
boolean
required
nextCursor
string | null
required