View Source Stripe.Entitlements.Feature (stripity_stripe v3.3.1)

A feature represents a monetizable ability or functionality in your system. Features can be assigned to products, and when those products are purchased, Stripe will create an entitlement to the feature for the purchasing customer.

Summary

Types

t()

The entitlements.feature type.

Functions

Retrieve a list of features

Update a feature’s metadata or permanently deactivate it.

Types

@type t() :: %Stripe.Entitlements.Feature{
  active: boolean(),
  id: binary(),
  livemode: boolean(),
  lookup_key: binary(),
  metadata: term(),
  name: binary(),
  object: binary()
}

The entitlements.feature type.

  • active Inactive features cannot be attached to new products and will not be returned from the features list endpoint.
  • id Unique identifier for the object.
  • livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode.
  • lookup_key A unique key you provide as your own system identifier. This may be up to 80 characters.
  • metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
  • name The feature's name, for your own purpose, not meant to be displayable to the customer.
  • object String representing the object's type. Objects of the same type share the same value.

Functions

Link to this function

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

View Source
@spec create(
  params :: %{
    optional(:expand) => [binary()],
    optional(:lookup_key) => binary(),
    optional(:metadata) => %{optional(binary()) => binary()},
    optional(:name) => binary()
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Creates a feature

Details

  • Method: post
  • Path: /v1/entitlements/features
Link to this function

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

View Source
@spec list(
  params :: %{
    optional(:archived) => boolean(),
    optional(:ending_before) => binary(),
    optional(:expand) => [binary()],
    optional(:limit) => integer(),
    optional(:lookup_key) => binary(),
    optional(:starting_after) => binary()
  },
  opts :: Keyword.t()
) ::
  {:ok, Stripe.List.t(t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Retrieve a list of features

Details

  • Method: get
  • Path: /v1/entitlements/features
Link to this function

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

View Source
@spec retrieve(
  id :: binary(),
  params :: %{optional(:expand) => [binary()]},
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Retrieves a feature

Details

  • Method: get
  • Path: /v1/entitlements/features/{id}
Link to this function

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

View Source
@spec update(
  id :: binary(),
  params :: %{
    optional(:active) => boolean(),
    optional(:expand) => [binary()],
    optional(:metadata) => %{optional(binary()) => binary()} | binary(),
    optional(:name) => binary()
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Update a feature’s metadata or permanently deactivate it.

Details

  • Method: post
  • Path: /v1/entitlements/features/{id}