View Source Stripe.Product (stripity_stripe v3.2.0)
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
Types
Data used to generate a new Price object. This Price will be set as the default price for this product.
The dimensions of this product for shipping purposes.
The recurring components of a price such as interval and interval_count.
The product type.
Functions
Creates a new product object.
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.
Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first.
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 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.
Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Types
@type default_price_data() :: %{ optional(:currency) => binary(), optional(:currency_options) => map(), optional(:recurring) => recurring(), optional(:tax_behavior) => :exclusive | :inclusive | :unspecified, optional(:unit_amount) => integer(), optional(:unit_amount_decimal) => binary() }
Data used to generate a new Price object. This Price will be set as the default price for this product.
@type features() :: %{optional(:name) => binary()}
@type package_dimensions() :: %{ optional(:height) => number(), optional(:length) => number(), optional(:weight) => number(), optional(:width) => number() }
The dimensions of this product for shipping purposes.
@type recurring() :: %{ optional(:interval) => :day | :month | :week | :year, optional(:interval_count) => integer() }
The recurring components of a price such as interval and interval_count.
@type t() :: %Stripe.Product{ active: boolean(), created: integer(), default_price: (binary() | Stripe.Price.t()) | nil, description: binary() | nil, features: term(), id: binary(), images: term(), livemode: boolean(), metadata: term(), name: binary(), object: binary(), package_dimensions: term() | nil, shippable: boolean() | nil, statement_descriptor: binary() | nil, tax_code: (binary() | Stripe.TaxCode.t()) | nil, type: binary(), unit_label: binary() | nil, updated: integer(), url: binary() | nil }
The product type.
activeWhether the product is currently available for purchase.createdTime at which the object was created. Measured in seconds since the Unix epoch.default_priceThe ID of the Price object that is the default price for this product.descriptionThe product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.featuresA list of up to 15 features for this product. These are displayed in pricing tables.idUnique identifier for the object.imagesA list of up to 8 URLs of images for this product, meant to be displayable to the customer.livemodeHas the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.metadataSet 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.nameThe product's name, meant to be displayable to the customer.objectString representing the object's type. Objects of the same type share the same value.package_dimensionsThe dimensions of this product for shipping purposes.shippableWhether this product is shipped (i.e., physical goods).statement_descriptorExtra information about a product which will appear on your customer's credit card statement. In the case that multiple products are billed at once, the first statement descriptor will be used.tax_codeA tax code ID.typeThe type of the product. The product is either of typegood, which is eligible for use with Orders and SKUs, orservice, which is eligible for use with Subscriptions and Plans.unit_labelA label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal.updatedTime at which the object was last updated. Measured in seconds since the Unix epoch.urlA URL of a publicly-accessible webpage for this product.
Functions
@spec create( params :: %{ optional(:active) => boolean(), optional(:default_price_data) => default_price_data(), optional(:description) => binary(), optional(:expand) => [binary()], optional(:features) => [features()], optional(:id) => binary(), optional(:images) => [binary()], optional(:metadata) => %{optional(binary()) => binary()}, optional(:name) => binary(), optional(:package_dimensions) => package_dimensions(), optional(:shippable) => boolean(), optional(:statement_descriptor) => binary(), optional(:tax_code) => binary(), optional(:type) => :good | :service, optional(:unit_label) => binary(), optional(:url) => binary() }, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Creates a new product object.
Details
- Method: 
post - Path: 
/v1/products 
@spec delete(id :: binary(), opts :: Keyword.t()) :: {:ok, Stripe.DeletedProduct.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
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.
Details
- Method: 
delete - Path: 
/v1/products/{id} 
@spec list( params :: %{ optional(:active) => boolean(), optional(:created) => created() | integer(), optional(:ending_before) => binary(), optional(:expand) => [binary()], optional(:ids) => [binary()], optional(:limit) => integer(), optional(:shippable) => boolean(), optional(:starting_after) => binary(), optional(:type) => :good | :service, optional(:url) => binary() }, opts :: Keyword.t() ) :: {:ok, Stripe.List.t(t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first.
Details
- Method: 
get - Path: 
/v1/products 
@spec retrieve( id :: binary(), params :: %{optional(:expand) => [binary()]}, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
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.
Details
- Method: 
get - Path: 
/v1/products/{id} 
@spec search( params :: %{ optional(:expand) => [binary()], optional(:limit) => integer(), optional(:page) => binary(), optional(:query) => binary() }, opts :: Keyword.t() ) :: {:ok, Stripe.SearchResult.t(t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
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.
#### Details * Method: `get` * Path: `/v1/products/search`@spec update( id :: binary(), params :: %{ optional(:active) => boolean(), optional(:default_price) => binary(), optional(:description) => binary() | binary(), optional(:expand) => [binary()], optional(:features) => [features()] | binary(), optional(:images) => [binary()] | binary(), optional(:metadata) => %{optional(binary()) => binary()} | binary(), optional(:name) => binary(), optional(:package_dimensions) => package_dimensions() | binary(), optional(:shippable) => boolean(), optional(:statement_descriptor) => binary(), optional(:tax_code) => binary() | binary(), optional(:unit_label) => binary() | binary(), optional(:url) => binary() | binary() }, opts :: Keyword.t() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Details
- Method: 
post - Path: 
/v1/products/{id}