StripeManaged.Product (StripeManaged v0.1.0)

Copy Markdown View Source

Manage Stripe products for digital goods and SaaS.

Products must use eligible tax codes for Managed Payments. See StripeManaged.TaxCode for the full list.

Example

{:ok, product} = StripeManaged.Product.create(%{
  name: "Pro Plan",
  description: "Full access to all features",
  tax_code: "txcd_10103001",
  default_price_data: %{
    unit_amount: 2900,
    currency: "usd",
    recurring: %{interval: "month"}
  }
})

Summary

Functions

Creates a new product.

Deletes a product (only if it has no prices).

Lists products. Accepts optional filter params.

Returns a lazy Stream of all products, auto-paginating.

Retrieves a product by ID.

Updates a product.

Functions

create(params, opts \\ [])

@spec create(
  map(),
  keyword()
) :: StripeManaged.Client.response()

Creates a new product.

delete(id, opts \\ [])

@spec delete(
  String.t(),
  keyword()
) :: StripeManaged.Client.response()

Deletes a product (only if it has no prices).

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

@spec list(
  map(),
  keyword()
) :: StripeManaged.Client.response()

Lists products. Accepts optional filter params.

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

@spec list_all(
  map(),
  keyword()
) :: Enumerable.t()

Returns a lazy Stream of all products, auto-paginating.

retrieve(id, opts \\ [])

@spec retrieve(
  String.t(),
  keyword()
) :: StripeManaged.Client.response()

Retrieves a product by ID.

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

@spec update(String.t(), map(), keyword()) :: StripeManaged.Client.response()

Updates a product.