View Source ExOAPI.Stripe.SDK.Coupons (exoapi_stripe v0.1.4)
Link to this section Summary
Functions
description: <p>You can delete coupons via the <a href="https://dashboard.stripe.com/coupons">coupon management</a> page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can’t redeem the coupon. You can also delete coupons via the API.</p>
description: <p>Returns a list of your coupons.</p>
description: <p>Retrieves the coupon with the given ID.</p>
description: <p>You can create coupons easily via the <a href="https://dashboard.stripe.com/coupons">coupon management</a> page of the Stripe dashboard. Coupon creation is also accessible via the API if you need to create coupons on the fly.</p>
description: <p>Updates the metadata of a coupon. Other coupon details (currency, duration, amount_off) are, by design, not editable.</p>
Link to this section Types
@type get_coupons_coupon_opts() :: {:expand, String.t()}
Link to this section Functions
@spec delete_coupons_coupon( client :: ExOAPI.Client.t(), body :: %{} | map(), coupon :: String.t() ) :: {:ok, ExOAPI.Stripe.Schemas.Error.t() | ExOAPI.Stripe.Schemas.DeletedCoupon.t() | map()} | {:error, any()}
description: <p>You can delete coupons via the <a href="https://dashboard.stripe.com/coupons">coupon management</a> page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can’t redeem the coupon. You can also delete coupons via the API.</p>
@spec get_coupons(client :: ExOAPI.Client.t(), [get_coupons_opts()]) :: {:ok, ExOAPI.Stripe.Schemas.Error.t() | %{ url: String.t(), object: String.t() | :list, has_more: boolean(), data: [ExOAPI.Stripe.Schemas.Coupon.t()] } | map()} | {:error, any()}
description: <p>Returns a list of your coupons.</p>
@spec get_coupons_coupon( client :: ExOAPI.Client.t(), coupon :: String.t(), [get_coupons_coupon_opts()] ) :: {:ok, ExOAPI.Stripe.Schemas.Error.t() | ExOAPI.Stripe.Schemas.Coupon.t() | map()} | {:error, any()}
description: <p>Retrieves the coupon with the given ID.</p>
@spec post_coupons( client :: ExOAPI.Client.t(), body :: %{ redeem_by: integer(), percent_off: number(), name: String.t(), metadata: String.t() | map(), max_redemptions: integer(), id: String.t(), expand: [String.t()], duration_in_months: integer(), duration: String.t() | :forever | :once | :repeating, currency: String.t(), applies_to: %{products: [String.t()]}, amount_off: integer() } | map() ) :: {:ok, ExOAPI.Stripe.Schemas.Error.t() | ExOAPI.Stripe.Schemas.Coupon.t() | map()} | {:error, any()}
description: <p>You can create coupons easily via the <a href="https://dashboard.stripe.com/coupons">coupon management</a> page of the Stripe dashboard. Coupon creation is also accessible via the API if you need to create coupons on the fly.</p>
A coupon has either a percent_off
or an amount_off
and currency
. If you set an amount_off
, that amount will be subtracted from any invoice’s subtotal. For example, an invoice with a subtotal of amount_off
of amount_off
of
@spec post_coupons_coupon( client :: ExOAPI.Client.t(), body :: %{name: String.t(), metadata: String.t() | map(), expand: [String.t()]} | map(), coupon :: String.t() ) :: {:ok, ExOAPI.Stripe.Schemas.Error.t() | ExOAPI.Stripe.Schemas.Coupon.t() | map()} | {:error, any()}
description: <p>Updates the metadata of a coupon. Other coupon details (currency, duration, amount_off) are, by design, not editable.</p>