class Stripe::Coupon

[checkout sessions](stripe.com/docs/api/checkout/sessions), [quotes](stripe.com/docs/api#quotes), and more. Coupons do not work with conventional one-off [charges](stripe.com/docs/api#create_charge) or [payment intents](stripe.com/docs/api/payment_intents).
might want to apply to a customer. Coupons may be applied to [subscriptions](stripe.com/docs/api#subscriptions), [invoices](stripe.com/docs/api#invoices),
A coupon contains information about a percent-off or amount-off discount you

def self.create(params = {}, opts = {})

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 100 will have a final total of 0 if a coupon with an amount_off of 200 is applied to it and an invoice with a subtotal of 300 will have a final total of 100 if a coupon with an amount_off of 200 is applied to it.

You can create coupons easily via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. Coupon creation is also accessible via the API if you need to create coupons on the fly.
def self.create(params = {}, opts = {})
  request_stripe_object(method: :post, path: "/v1/coupons", params: params, opts: opts)
end

def self.delete(id, params = {}, opts = {})

You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) 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.
def self.delete(id, params = {}, opts = {})
  request_stripe_object(
    method: :delete,
    path: format("/v1/coupons/%<id>s", { id: CGI.escape(id) }),
    params: params,
    opts: opts
  )
end

def self.list(filters = {}, opts = {})

Returns a list of your coupons.
def self.list(filters = {}, opts = {})
  request_stripe_object(method: :get, path: "/v1/coupons", params: filters, opts: opts)
end

def self.object_name

def self.object_name
  "coupon"
end

def self.update(id, params = {}, opts = {})

Updates the metadata of a coupon. Other coupon details (currency, duration, amount_off) are, by design, not editable.
def self.update(id, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/coupons/%<id>s", { id: CGI.escape(id) }),
    params: params,
    opts: opts
  )
end

def delete(params = {}, opts = {})

You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) 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.
def delete(params = {}, opts = {})
  request_stripe_object(
    method: :delete,
    path: format("/v1/coupons/%<coupon>s", { coupon: CGI.escape(self["id"]) }),
    params: params,
    opts: opts
  )
end