View Source Stripe.Billing.Alert (stripity_stripe v3.3.1)
A billing alert is a resource that notifies you when a certain usage threshold on a meter is crossed. For example, you might create a billing alert to notify you when a certain user made 100 API requests.
Summary
Functions
Reactivates this alert, allowing it to trigger again.
Archives this alert, removing it from the list view and APIs. This is non-reversible.
Creates a billing alert
Deactivates this alert, preventing it from triggering.
Lists billing active and inactive alerts
Retrieves a billing alert given an ID
Types
@type filters() :: %{optional(:customer) => binary(), optional(:type) => :customer}
@type t() :: %Stripe.Billing.Alert{ alert_type: binary(), id: binary(), livemode: boolean(), object: binary(), status: binary() | nil, title: binary(), usage_threshold: term() | nil }
The billing.alert type.
alert_typeDefines the type of the alert.idUnique identifier for the object.livemodeHas the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.objectString representing the object's type. Objects of the same type share the same value.statusStatus of the alert. This can be active, inactive or archived.titleTitle of the alert.usage_thresholdEncapsulates configuration of the alert to monitor usage on a specific Billing Meter.
@type usage_threshold() :: %{ optional(:filters) => [filters()], optional(:gte) => integer(), optional(:meter) => binary(), optional(:recurrence) => :one_time }
The configuration of the usage threshold.
Functions
@spec activate( id :: binary(), params :: %{optional(:expand) => [binary()]}, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Reactivates this alert, allowing it to trigger again.
Details
- Method:
post - Path:
/v1/billing/alerts/{id}/activate
@spec archive( id :: binary(), params :: %{optional(:expand) => [binary()]}, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Archives this alert, removing it from the list view and APIs. This is non-reversible.
Details
- Method:
post - Path:
/v1/billing/alerts/{id}/archive
@spec create( params :: %{ optional(:alert_type) => :usage_threshold, optional(:expand) => [binary()], optional(:title) => binary(), optional(:usage_threshold) => usage_threshold() }, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Creates a billing alert
Details
- Method:
post - Path:
/v1/billing/alerts
@spec deactivate( id :: binary(), params :: %{optional(:expand) => [binary()]}, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Deactivates this alert, preventing it from triggering.
Details
- Method:
post - Path:
/v1/billing/alerts/{id}/deactivate
@spec list( params :: %{ optional(:alert_type) => :usage_threshold, optional(:ending_before) => binary(), optional(:expand) => [binary()], optional(:limit) => integer(), optional(:meter) => binary(), optional(:starting_after) => binary() }, opts :: Keyword.t() ) :: {:ok, Stripe.List.t(t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Lists billing active and inactive alerts
Details
- Method:
get - Path:
/v1/billing/alerts
@spec retrieve( id :: binary(), params :: %{optional(:expand) => [binary()]}, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Retrieves a billing alert given an ID
Details
- Method:
get - Path:
/v1/billing/alerts/{id}