Search documentation of stripe_elixir

# StripeElixir.Services.Billing.MeterService (stripe_elixir v0.1.0)

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 \\ [])

Create a billing meter

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

Deactivate a billing meter

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

List billing meters

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

Reactivate a billing meter

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

Retrieve a billing meter

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

Update a billing meter

## Functions

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

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

Create a billing meter

Creates a billing meter.

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

    @spec deactivate(StripeElixir.Client.t(), String.t(), map(), keyword()) ::
      {:ok, term()} | {:error, StripeElixir.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(StripeElixir.Client.t(), map(), keyword()) ::
      {:ok, term()} | {:error, StripeElixir.Error.t()}

List billing meters

Retrieve a list of billing meters.

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

    @spec reactivate(StripeElixir.Client.t(), String.t(), map(), keyword()) ::
      {:ok, term()} | {:error, StripeElixir.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(StripeElixir.Client.t(), String.t(), map(), keyword()) ::
      {:ok, term()} | {:error, StripeElixir.Error.t()}

Retrieve a billing meter

Retrieves a billing meter given an ID.

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

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

Update a billing meter

Updates a billing meter.