Stripe.Services.Billing.MeterService (tiger_stripe v0.1.10)

Copy Markdown View Source

BillingMeter

Meters specify how to aggregate meter events over a billing period. Meter events represent the actions that customers take in your system. Meters attach to prices and form the basis of the bill.

Related guide: Usage based billing

Summary

Functions

create(client, params \\ %{}, opts \\ [])

@spec create(Stripe.Client.t(), map(), keyword()) ::
  {:ok, term()} | {:error, Stripe.Error.t()}

Create a billing meter

Creates a billing meter.

deactivate(client, id, params \\ %{}, opts \\ [])

@spec deactivate(Stripe.Client.t(), String.t(), map(), keyword()) ::
  {:ok, term()} | {:error, Stripe.Error.t()}

Deactivate a billing meter

When a meter is deactivated, no more meter events will be accepted for this meter. You can’t attach a deactivated meter to a price.

list(client, params \\ %{}, opts \\ [])

@spec list(Stripe.Client.t(), map(), keyword()) ::
  {:ok, term()} | {:error, Stripe.Error.t()}

List billing meters

Retrieve a list of billing meters.

reactivate(client, id, params \\ %{}, opts \\ [])

@spec reactivate(Stripe.Client.t(), String.t(), map(), keyword()) ::
  {:ok, term()} | {:error, Stripe.Error.t()}

Reactivate a billing meter

When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price.

retrieve(client, id, params \\ %{}, opts \\ [])

@spec retrieve(Stripe.Client.t(), String.t(), map(), keyword()) ::
  {:ok, term()} | {:error, Stripe.Error.t()}

Retrieve a billing meter

Retrieves a billing meter given an ID.

update(client, id, params \\ %{}, opts \\ [])

@spec update(Stripe.Client.t(), String.t(), map(), keyword()) ::
  {:ok, term()} | {:error, Stripe.Error.t()}

Update a billing meter

Updates a billing meter.