#Serotonin9443 - Checkout Coupon, Metered
1 messages ยท Page 1 of 1 (latest)
Hello! Can you describe in detail what you do want? How exactly do you want the discount to behave?
Hi! I'd like a Coupon set for a duration of 1 month, and have it apply to all metered usage reported during that 1 month.
I'm currently seeing that the metered usage will be billed at the start of the next month's invoice.
But you only want the discount to apply once?
Good question, I understood the "duration" field of the Coupon to mean that all charges during that duration would be discounted.
Maybe I need to apply a discount on the Customer object? That would have other undesired behavior though, because I only want the Coupon to apply for 1 month's usage
Yep, that's correct. If you have a one-month Coupon then it will apply to Invoices generated during that month. If you only want a one-time discount you should set duration to once when creating the Coupon so it applies once to the first non-zero Invoice: https://stripe.com/docs/api/coupons/create#create_coupon-duration
Sorry, I wasn't very clear. For this particular Coupon, I have set the duration="repeating" and duration_in_months=1
And it doesn't appear to be applying to the metered usage.
It seems to behave the same as duration="once"
Right, because the metered usage shows up on the Invoice for the second month.
Exactly the problem ๐
Sorry, maybe I'm misunderstanding something. Is the first Invoice generated for the Subscription $0?
After the discount is applied, yes it is $0. There are 2 prices attached to the subscription, one of a base price, and another of a metered usage price. The offer to my customers is "$15 off of 1 months usage"
And the way things are set up now, they will be billed next month for the metered usage, which is not what I want.
Ah, okay, I thought the first Invoice was $0 before the discount.
But it's not, so it's consuming the one-time Coupon.
So you would need to apply the Coupon after the first Invoice is generated.
You can update the Subscription after the first Invoice is finalized with the coupon you want to apply to the next Invoice: https://stripe.com/docs/api/subscriptions/update#update_subscription-coupon
You can make it a one-time coupon, which I think is what you want, instead of a repeating one.
Since you only want it to apply to a single Invoice, correct?
Yes that's right... ok I think this will do what I want! Thank you! ๐
Happy to help! Make sure you test it in test mode to ensure it does exactly what you want. ๐
Definitely. One caveat is that I think I will need to wait until the last day of the first month before applying it, and deduct the next month's base price from the coupon. That way it only applies to the metered usage and not the next month's base price.
That's not really how it works. When you create the Coupon you can make it apply to only a specific Product (or Products), which would allow you to restrict it to only the metered use: https://stripe.com/docs/api/coupons/create#create_coupon-applies_to
If you don't restrict it the Coupon applies to the entire Invoice, including everything on it regardless of when the stuff was created.
Oh perfect
Hmm, I was hoping applies_to would allow by Price. All of my prices (base and metered usage) are on a single Product, so that field isn't going to work out for me.
Maybe I am using Products and Prices wrong ๐
I think you'll need to break it out into a separate Product for your use case.
Yeah agreed. Is it a convention to normally put metered usage Prices on separate Products? Or just something I need to do for my specific offering.
It depends a lot on the use case, but generally speaking a Product represents the thing someone gets for paying, and thus if you want to apply a discount the thinking is that the discount would apply to that thing, not some subset of the thing.
Makes sense. FWIW it was a little confusing that Prices get added to Subscriptions, not Products to Subscriptions ๐
Products represent the thing people are paying for, and Prices are meant to represent how much they pay. An example would be a Product representing something like a specific chair, and that Product might have two Prices, one for the normal cost of the chair and another for a sale price.
Ahhh that makes it more clear.