subscription.line_item_spend.threshold_reached
curl --request POST \
--url https://us.api.flexprice.io/v1/webhook-events/subscription.line_item_spend.threshold_reachedimport requests
url = "https://us.api.flexprice.io/v1/webhook-events/subscription.line_item_spend.threshold_reached"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://us.api.flexprice.io/v1/webhook-events/subscription.line_item_spend.threshold_reached', 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://us.api.flexprice.io/v1/webhook-events/subscription.line_item_spend.threshold_reached",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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://us.api.flexprice.io/v1/webhook-events/subscription.line_item_spend.threshold_reached"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://us.api.flexprice.io/v1/webhook-events/subscription.line_item_spend.threshold_reached")
.asString();require 'uri'
require 'net/http'
url = URI("https://us.api.flexprice.io/v1/webhook-events/subscription.line_item_spend.threshold_reached")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"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",
"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>",
"lookup_key": "<string>",
"metadata": {},
"parent_subscription_id": "<string>",
"pause_status": "none",
"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.line_item_spend.threshold_reached
Fired when a subscription line item’s metered spend crosses an alert threshold (critical, warning, or info) for the current billing period. Doc-only for parsing.
POST
/
webhook-events
/
subscription.line_item_spend.threshold_reached
subscription.line_item_spend.threshold_reached
curl --request POST \
--url https://us.api.flexprice.io/v1/webhook-events/subscription.line_item_spend.threshold_reachedimport requests
url = "https://us.api.flexprice.io/v1/webhook-events/subscription.line_item_spend.threshold_reached"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://us.api.flexprice.io/v1/webhook-events/subscription.line_item_spend.threshold_reached', 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://us.api.flexprice.io/v1/webhook-events/subscription.line_item_spend.threshold_reached",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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://us.api.flexprice.io/v1/webhook-events/subscription.line_item_spend.threshold_reached"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://us.api.flexprice.io/v1/webhook-events/subscription.line_item_spend.threshold_reached")
.asString();require 'uri'
require 'net/http'
url = URI("https://us.api.flexprice.io/v1/webhook-events/subscription.line_item_spend.threshold_reached")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"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",
"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>",
"lookup_key": "<string>",
"metadata": {},
"parent_subscription_id": "<string>",
"pause_status": "none",
"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

