Search documentation of tiger_stripe

# Stripe.Services.ProductService (tiger_stripe v0.1.1)

Copy Markdown View Source

Product

Products describe the specific goods or services you offer to your customers. For example, you might offer a Standard and Premium version of your goods or service; each version would be a separate Product. They can be used in conjunction with Prices to configure pricing in Payment Links, Checkout, and Subscriptions.

Related guides: Set up a subscription, share a Payment Link, accept payments with Checkout, and more about Products and Prices

## Summary

### Functions

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

Create a product

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

Delete a product

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

List all products

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

Retrieve a product

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

Search products

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

Update a product

## Functions

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

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

Create a product

Creates a new product object.

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

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

Delete a product

Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with `type=good` is only possible if it has no SKUs associated with it.

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

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

List all products

Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first.

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

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

Retrieve a product

Retrieves the details of an existing product. Supply the unique product ID from either a product creation request or the product list, and Stripe will return the corresponding product information.

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

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

Search products

Search for products you’ve previously created using Stripe’s Search Query Language. Don’t use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India.

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

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

Update a product

Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged.