Stripe.SubscriptionItem.Usage (stripity_stripe v2.17.2) View Source

Work with Stripe usage record objects.

Stripe API reference: https://stripe.com/docs/api/usage_records

Link to this section Summary

Functions

Creates a usage record for a specified subscription item id and date, and fills it with a quantity.

List all subscription item period summaries

Link to this section Types

Specs

t() :: %Stripe.SubscriptionItem.Usage{
  id: Stripe.id(),
  livemode: boolean(),
  object: String.t(),
  quantity: non_neg_integer(),
  subscription_item: Stripe.id() | Stripe.SubscriptionItem.t(),
  timestamp: Stripe.timestamp()
}

Link to this section Functions

Link to this function

create(id, params, opts \\ [])

View Source

Specs

create(Stripe.id(), params, Stripe.options()) ::
  {:ok, t()} | {:error, Stripe.Error.t()}
when params: %{
       :quantity => float() | pos_integer() | 0,
       :timestamp => Stripe.timestamp() | non_neg_integer(),
       optional(:action) => String.t()
     }

Creates a usage record for a specified subscription item id and date, and fills it with a quantity.

Link to this function

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

View Source

Specs

list(Stripe.id(), params, Stripe.options()) ::
  {:ok, Stripe.List.t(Stripe.SubscriptionItem.UsageRecordSummary.t())}
  | {:error, Stripe.Error.t()}
when params: %{
       optional(:ending_before) => t() | Stripe.id(),
       optional(:limit) => 1..100,
       optional(:starting_after) => t() | Stripe.id()
     }

List all subscription item period summaries