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>'import requests
url = "https://api-eu.flexportal.io/v1/billing-groups/{billingGroupId}"
headers = {
"Tenant-ID": "<tenant-id>",
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
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 => "DELETE",
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("DELETE", 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.delete("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::Delete.new(url)
request["Tenant-ID"] = '<tenant-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Billing Groups
Delete Billing Group
Deletes a billing group. Rentals are moved back to individual billing.
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>'import requests
url = "https://api-eu.flexportal.io/v1/billing-groups/{billingGroupId}"
headers = {
"Tenant-ID": "<tenant-id>",
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
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 => "DELETE",
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("DELETE", 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.delete("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::Delete.new(url)
request["Tenant-ID"] = '<tenant-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>"
}{
"error": {
"code": "<string>",
"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:- Group is removed
- Subscriptions continue with individual billing
- Future payments scheduled separately per subscription
- 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 Code | Cause | Solution |
|---|---|---|
NOT_FOUND | Group doesn’t exist | Verify billing group ID |
Related Endpoints
- Get Billing Group - Check group before deletion
- Update Billing Group - Alternative: deactivate
- List Subscriptions - View affected subscriptions
Authorizations
API key obtained from FlexPortal dashboard
Headers
Your tenant identifier
Path Parameters
The billing group ID
Was this page helpful?