Stripe - apply a coupon to a customer or subscription?

In the documentation for the Stripe protocol, they show that you can apply a coupon to a customer.

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

However, you can also apply a subscription coupon:

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

What is the difference between the two? In fact, I would like to give the client $ 15 with their next subscription and only the next.

+4
source share
2 answers

To make a coupon that can only be used after setting the property max_redemptionsto.

, , Invoice, . , - InvoiceItems, .

, , . InvoiceItems - .

, "20 ", , "20% ".

+3

, , / , , , .

, , .

, , .

max_redemptions , , . 100 .

0

All Articles