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 = {})
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 = {})
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 = {})
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 = {})
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 = {})
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