Skip to main content
DELETE
/
v1
/
billing-groups
/
{billingGroupId}
Delete a billing group
curl --request DELETE \
  --url https://api-eu.flexportal.io/v1/billing-groups/{billingGroupId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Tenant-ID: <tenant-id>'
{
  "success": true,
  "message": "<string>"
}

Overview

Delete a billing group. Subscriptions in the group will revert to individual billing—they are not cancelled when the group is deleted.

What Happens

When you delete a billing group:
  1. Group is removed
  2. Subscriptions continue with individual billing
  3. Future payments scheduled separately per subscription
  4. Historical data preserved for reporting

Common Use Cases

  • Customer Reorganization: Business customer restructuring
  • Individual Billing Preferred: Customer wants separate invoices
  • Account Closure: Customer ending relationship (after subscriptions end)

Prerequisites

Before deleting, consider:
  • Are there pending group payments that need to be processed?
  • Should subscriptions move to a different group instead?

Example: Delete with Transition

async function transitionToIndividualBilling(billingGroupId) {
  const group = await getBillingGroup(billingGroupId);

  // Log for records
  console.log(`Deleting group: ${group.groupName}`);
  console.log(`Subscriptions reverting to individual billing: ${group.rentalIds.length}`);

  // Delete the group
  await deleteBillingGroup(billingGroupId);

  return {
    deleted: true,
    affectedSubscriptions: group.rentalIds
  };
}

Alternative: Deactivate Instead

If you want to preserve the group structure:
// Deactivate instead of delete
await updateBillingGroup(billingGroupId, {
  status: 'inactive'
});

Error Handling

Error CodeCauseSolution
NOT_FOUNDGroup doesn’t existVerify billing group ID

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 deleted

success
enum<boolean>
required
Available options:
true,
false
message
string
required