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.
In the Dashboard on the Create a coupon page, click the Use customer-facing coupon codes button. Enter a code. This is the code that a customer enters at checkout to redeem the discount. If you don't set a code, Stripe generates one for you.
When using the Stripe Payments Plugin coupon codes can be created where the discount amount is 100%. This means that the customer will not need to pay for the product.
Promotion codes are customer-facing codes created on top of coupons. You can also specify additional restrictions that control when a customer can apply the promotion. You can share these codes with customers who can enter them into Checkout to apply a discount.
Checkout. Promotion Codes is a Stripe Billing and Checkout feature which enables you to generate customer facing codes which can be redeemed to apply a coupon to an order. Promotion Codes have advanced validation features which allow you to specify when and on what orders the codes can be redeemed.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With