Skip to main content
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>'
{
  "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>"
  }
}

Overview

Retrieve details for a single billing group, including all associated subscriptions and the consolidated billing amount.

Response Fields

FieldDescription
billingGroupIdUnique identifier
groupNameDisplay name
customerIdBusiness customer ID
rentalIdsArray of subscription IDs
billingDayDay of month for billing (1-28)
totalMonthlyAmountSum of all subscription amounts
currencyCurrency code
statusactive or inactive
createdAtWhen group was created
updatedAtLast 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
  };
}

Authorizations

Authorization
string
header
required

API key obtained from FlexPortal dashboard

Headers

Tenant-ID
string
required

Your tenant identifier

Path Parameters

billingGroupId
string
required

The billing group ID

Response

Billing group details

success
enum<boolean>
required
Available options:
true,
false
billingGroup
object
required