View Source Stripe.ProductFeature (stripity_stripe v3.3.1)

A product_feature represents an attachment between a feature and a product. When a product is purchased that has a feature attached, Stripe will create an entitlement to the feature for the purchasing customer.

Summary

Types

t()

The product_feature type.

Functions

Creates a product_feature, which represents a feature attachment to a product

Deletes the feature attachment to a product

Retrieve a list of features for a product

Retrieves a product_feature, which represents a feature attachment to a product

Types

@type t() :: %Stripe.ProductFeature{
  entitlement_feature: Stripe.Entitlements.Feature.t(),
  id: binary(),
  livemode: boolean(),
  object: binary()
}

The product_feature type.

  • entitlement_feature
  • 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.
  • object String representing the object's type. Objects of the same type share the same value.

Functions

Link to this function

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

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

Creates a product_feature, which represents a feature attachment to a product

Details

  • Method: post
  • Path: /v1/products/{product}/features
Link to this function

delete(id, product, opts \\ [])

View Source
@spec delete(id :: binary(), product :: binary(), opts :: Keyword.t()) ::
  {:ok, Stripe.DeletedProductFeature.t()}
  | {:error, Stripe.ApiErrors.t()}
  | {:error, term()}

Deletes the feature attachment to a product

Details

  • Method: delete
  • Path: /v1/products/{product}/features/{id}
Link to this function

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

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

Retrieve a list of features for a product

Details

  • Method: get
  • Path: /v1/products/{product}/features
Link to this function

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

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

Retrieves a product_feature, which represents a feature attachment to a product

Details

  • Method: get
  • Path: /v1/products/{product}/features/{id}