9
votes

In the Stripe API Documentation, they show that you can apply a coupon on a Customer.

cust = Stripe::Customer.retrieve("cus_asdasdad")
cust.coupon = "COUPONCODE"
cust.save

However, you can also apply a coupon on a Subscription:

cust = Stripe::Customer.retrieve("cus_asdasdad")
sub = cust.subscriptions.retrieve("sub_blablabla")
sub.coupon = "COUPONCODE"
sub.save

What is the difference between the two? Essentially, I'd like to give a customer $15 off their next subscription charge, and only the next one.

3
for such questions you should ask the concerned team. e.g. stripe in this caseMani

3 Answers

11
votes

To make a coupon that can only be used once set the max_redemptions property to 1.

With regard to your question, the difference is that applying the coupon to the Customer will apply the discount to the sub-total of the Invoice created for that Customer. Meaning that if the Invoice includes a Subscription and multiple InvoiceItems, then the discount will be applied to the sum of all of them.

Conversely, applying the coupon to a Subscription only means the discount will be applied to the cost of the Subscription only. Other InvoiceItems within the Invoice will not be discounted.

Won't make a difference if the Coupon is a "20 dollars off" type, but it will if it's a "20% off" kind.

3
votes

A coupon applied to a customer will apply to all future invoices and/or subscriptions, even if the coupon has expired, dependent upon how you set the duration attributes for the coupon.

A coupon applied to a subscription will only apply to that specific subscription.

The duration attribute will determine how long this discount will apply, either once, repeated, or forever.

The max_redemptions attribute limits the the total number of coupons that you are willing to honor, e.g. the first 100 customers.

1
votes

as it was already answered by others a coupon applied to the customer will affect every InvoiceItem not only the Subscription (in opposite to the case when you are applying coupon to the Subscription)

you should use max_redemptions property to limit the coupon applications number

if you need more customization you should probably use Stripe PromotionCodes altogether with the Coupons this will give you the ability to apply the discount to many customers, but only once per customer (check here)

another thing to mention regarding the difference between applying coupon to the customer and to the subscription is the next one:

  • you can have cases in your flow (we have such a cases in our app) when you need to cancel current subscription for the customer and create a new one for the same customer
  • in this case coupon (actually discount) applied to the customer, not to the subscription, will take effect even after this subscription renewal
  • but in the case when the coupon was applied to the subscription the customer will loose his discount on such subscription cancellation/recreation

you can find more info regarding the question in the Stripe docs