cURL
curl --request POST \
--url https://us.api.flexprice.io/v1/webhook-events/subscription.group_spend.threshold_reachedfrom flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.webhook_events.post_webhook_events_subscription_group_spend_threshold_reached()
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.webhookEvents.postWebhookEventsSubscriptionGroupSpendThresholdReached();
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.WebhookEvents.PostWebhookEventsSubscriptionGroupSpendThresholdReached(ctx)
if err != nil {
log.Fatal(err)
}
if res.WebhookDtoSpendAlertEvent != nil {
// handle response
}
}{
"alert_status": "ok",
"alert_type": "low_ongoing_balance",
"current_spend": "<string>",
"group_id": "<string>",
"subscription": {
"billing_cadence": "RECURRING",
"billing_period": "MONTHLY",
"billing_period_count": 123,
"cancel_at": "2023-11-07T05:31:56Z",
"cancel_at_period_end": true,
"cancelled_at": "2023-11-07T05:31:56Z",
"coupon_associations": [
{
"coupon_id": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"id": "<string>",
"metadata": {},
"start_date": "2023-11-07T05:31:56Z",
"subscription_id": "<string>",
"subscription_line_item_id": "<string>"
}
],
"currency": "<string>",
"current_period_end": "2023-11-07T05:31:56Z",
"current_period_start": "2023-11-07T05:31:56Z",
"customer": {
"address_city": "<string>",
"address_country": "<string>",
"address_line1": "<string>",
"address_line2": "<string>",
"address_postal_code": "<string>",
"address_state": "<string>",
"email": "<string>",
"environment_id": "<string>",
"external_id": "<string>",
"id": "<string>",
"metadata": {},
"name": "<string>",
"timezone": "<string>"
},
"customer_id": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"id": "<string>",
"invoicing_customer_id": "<string>",
"line_items": [
{
"billing_period": "MONTHLY",
"billing_period_count": 123,
"currency": "<string>",
"display_name": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"entity_id": "<string>",
"entity_type": "plan",
"id": "<string>",
"invoice_cadence": "ARREAR",
"metadata": {},
"meter_display_name": "<string>",
"meter_id": "<string>",
"plan_display_name": "<string>",
"price": {
"amount": "<string>",
"billing_cadence": "RECURRING",
"billing_model": "FLAT_FEE",
"billing_period": "MONTHLY",
"billing_period_count": 123,
"currency": "<string>",
"description": "<string>",
"display_amount": "<string>",
"display_name": "<string>",
"display_price_unit_amount": "<string>",
"id": "<string>",
"invoice_cadence": "ARREAR",
"lookup_key": "<string>",
"metadata": {},
"meter": {
"aggregation": {
"bucket_size": "MINUTE",
"expression": "<string>",
"field": "<string>",
"group_by": "<string>",
"multiplier": "<string>",
"type": "COUNT"
},
"event_name": "<string>",
"id": "<string>",
"name": "<string>",
"reset_usage": "BILLING_PERIOD"
},
"meter_id": "<string>",
"price_unit": "<string>",
"price_unit_amount": "<string>",
"tier_mode": "VOLUME",
"tiers": [
{
"flat_amount": "<string>",
"unit_amount": "<string>",
"up_to": 123
}
],
"transform_quantity": {
"divide_by": 123,
"round": "up"
},
"type": "USAGE"
},
"price_id": "<string>",
"price_type": "USAGE",
"price_unit": "<string>",
"quantity": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"subscription_id": "<string>"
}
],
"lookup_key": "<string>",
"metadata": {},
"parent_subscription_id": "<string>",
"pause_status": "none",
"plan": {
"description": "<string>",
"id": "<string>",
"lookup_key": "<string>",
"metadata": {},
"name": "<string>",
"prices": [
{
"amount": "<string>",
"billing_cadence": "RECURRING",
"billing_model": "FLAT_FEE",
"billing_period": "MONTHLY",
"billing_period_count": 123,
"currency": "<string>",
"description": "<string>",
"display_amount": "<string>",
"display_name": "<string>",
"display_price_unit_amount": "<string>",
"id": "<string>",
"invoice_cadence": "ARREAR",
"lookup_key": "<string>",
"metadata": {},
"meter": {
"aggregation": {
"bucket_size": "MINUTE",
"expression": "<string>",
"field": "<string>",
"group_by": "<string>",
"multiplier": "<string>",
"type": "COUNT"
},
"event_name": "<string>",
"id": "<string>",
"name": "<string>",
"reset_usage": "BILLING_PERIOD"
},
"meter_id": "<string>",
"price_unit": "<string>",
"price_unit_amount": "<string>",
"tier_mode": "VOLUME",
"tiers": [
{
"flat_amount": "<string>",
"unit_amount": "<string>",
"up_to": 123
}
],
"transform_quantity": {
"divide_by": 123,
"round": "up"
},
"type": "USAGE"
}
]
},
"plan_id": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"subscription_status": "active",
"subscription_type": "standalone",
"trial_end": "2023-11-07T05:31:56Z",
"trial_start": "2023-11-07T05:31:56Z"
},
"subscription_line_item_id": "<string>",
"threshold": "<string>",
"triggered_at": "2023-11-07T05:31:56Z"
}Webhook Events
subscription.group_spend.threshold_reached
Fired when a feature group’s total metered spend on a subscription crosses an alert threshold (critical, warning, or info) for the current billing period. Doc-only for parsing.
POST
/
webhook-events
/
subscription.group_spend.threshold_reached
cURL
curl --request POST \
--url https://us.api.flexprice.io/v1/webhook-events/subscription.group_spend.threshold_reachedfrom flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.webhook_events.post_webhook_events_subscription_group_spend_threshold_reached()
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.webhookEvents.postWebhookEventsSubscriptionGroupSpendThresholdReached();
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.WebhookEvents.PostWebhookEventsSubscriptionGroupSpendThresholdReached(ctx)
if err != nil {
log.Fatal(err)
}
if res.WebhookDtoSpendAlertEvent != nil {
// handle response
}
}{
"alert_status": "ok",
"alert_type": "low_ongoing_balance",
"current_spend": "<string>",
"group_id": "<string>",
"subscription": {
"billing_cadence": "RECURRING",
"billing_period": "MONTHLY",
"billing_period_count": 123,
"cancel_at": "2023-11-07T05:31:56Z",
"cancel_at_period_end": true,
"cancelled_at": "2023-11-07T05:31:56Z",
"coupon_associations": [
{
"coupon_id": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"id": "<string>",
"metadata": {},
"start_date": "2023-11-07T05:31:56Z",
"subscription_id": "<string>",
"subscription_line_item_id": "<string>"
}
],
"currency": "<string>",
"current_period_end": "2023-11-07T05:31:56Z",
"current_period_start": "2023-11-07T05:31:56Z",
"customer": {
"address_city": "<string>",
"address_country": "<string>",
"address_line1": "<string>",
"address_line2": "<string>",
"address_postal_code": "<string>",
"address_state": "<string>",
"email": "<string>",
"environment_id": "<string>",
"external_id": "<string>",
"id": "<string>",
"metadata": {},
"name": "<string>",
"timezone": "<string>"
},
"customer_id": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"id": "<string>",
"invoicing_customer_id": "<string>",
"line_items": [
{
"billing_period": "MONTHLY",
"billing_period_count": 123,
"currency": "<string>",
"display_name": "<string>",
"end_date": "2023-11-07T05:31:56Z",
"entity_id": "<string>",
"entity_type": "plan",
"id": "<string>",
"invoice_cadence": "ARREAR",
"metadata": {},
"meter_display_name": "<string>",
"meter_id": "<string>",
"plan_display_name": "<string>",
"price": {
"amount": "<string>",
"billing_cadence": "RECURRING",
"billing_model": "FLAT_FEE",
"billing_period": "MONTHLY",
"billing_period_count": 123,
"currency": "<string>",
"description": "<string>",
"display_amount": "<string>",
"display_name": "<string>",
"display_price_unit_amount": "<string>",
"id": "<string>",
"invoice_cadence": "ARREAR",
"lookup_key": "<string>",
"metadata": {},
"meter": {
"aggregation": {
"bucket_size": "MINUTE",
"expression": "<string>",
"field": "<string>",
"group_by": "<string>",
"multiplier": "<string>",
"type": "COUNT"
},
"event_name": "<string>",
"id": "<string>",
"name": "<string>",
"reset_usage": "BILLING_PERIOD"
},
"meter_id": "<string>",
"price_unit": "<string>",
"price_unit_amount": "<string>",
"tier_mode": "VOLUME",
"tiers": [
{
"flat_amount": "<string>",
"unit_amount": "<string>",
"up_to": 123
}
],
"transform_quantity": {
"divide_by": 123,
"round": "up"
},
"type": "USAGE"
},
"price_id": "<string>",
"price_type": "USAGE",
"price_unit": "<string>",
"quantity": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"subscription_id": "<string>"
}
],
"lookup_key": "<string>",
"metadata": {},
"parent_subscription_id": "<string>",
"pause_status": "none",
"plan": {
"description": "<string>",
"id": "<string>",
"lookup_key": "<string>",
"metadata": {},
"name": "<string>",
"prices": [
{
"amount": "<string>",
"billing_cadence": "RECURRING",
"billing_model": "FLAT_FEE",
"billing_period": "MONTHLY",
"billing_period_count": 123,
"currency": "<string>",
"description": "<string>",
"display_amount": "<string>",
"display_name": "<string>",
"display_price_unit_amount": "<string>",
"id": "<string>",
"invoice_cadence": "ARREAR",
"lookup_key": "<string>",
"metadata": {},
"meter": {
"aggregation": {
"bucket_size": "MINUTE",
"expression": "<string>",
"field": "<string>",
"group_by": "<string>",
"multiplier": "<string>",
"type": "COUNT"
},
"event_name": "<string>",
"id": "<string>",
"name": "<string>",
"reset_usage": "BILLING_PERIOD"
},
"meter_id": "<string>",
"price_unit": "<string>",
"price_unit_amount": "<string>",
"tier_mode": "VOLUME",
"tiers": [
{
"flat_amount": "<string>",
"unit_amount": "<string>",
"up_to": 123
}
],
"transform_quantity": {
"divide_by": 123,
"round": "up"
},
"type": "USAGE"
}
]
},
"plan_id": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"subscription_status": "active",
"subscription_type": "standalone",
"trial_end": "2023-11-07T05:31:56Z",
"trial_start": "2023-11-07T05:31:56Z"
},
"subscription_line_item_id": "<string>",
"threshold": "<string>",
"triggered_at": "2023-11-07T05:31:56Z"
}Response
200 - application/json
Webhook payload
Available options:
ok, info, warning, in_alarm Available options:
low_ongoing_balance, low_credit_balance, feature_wallet_balance, subscription_spend, subscription_line_item_spend, subscription_group_spend, entitlement_grant_threshold, entitlement_grant_exhausted Show child attributes
Show child attributes

