#Jonas Reif
1 messages · Page 1 of 1 (latest)
Hi there
The discount should appear on the next invoice
Where are you not seeing it exactly?
Here in the customer portal the price is still 348€ but the user has added the off once coupon already. So there is no indicator that the price will be 278€ on the next invoice
thanks 🙂
also when I retrieve the subscription via api there is no discount on the subscription
So subscription.discount is null
Hmm that's strange... I do see a discount associated with that Sub
hm ok. Let me check again
ah correction,
I see the discount, but not the amount_off
"discount": {"id":"di_1MoQLPAHqm7DWpwQJMHJliie","object":"discount","checkout_session":null,"coupon":{"id":"h8L63FK5","object":"coupon","amount_off":null,"created":1679423320,"currency":null,"duration":"once","duration_in_months":null,"livemode":false,"max_redemptions":null,"metadata":{},"name":"test","percent_off":20.0,"redeem_by":null,"times_redeemed":4,"valid":true},"customer":"cus_NZUimg0V3TQY0K","end":null,"invoice":null,"invoice_item":null,"promotion_code":null,"start":1679486443,"subscription":"sub_1MoLipAHqm7DWpwQTjQN0SUF"}
but in billing portal I dont see any info that the next invoice will be 20% off
found also a related tweet here:
https://twitter.com/TweetsOfSumit/status/1590327371668000769
ok.
What should I do instead? We are using both yearly and monthly subscriptions
Do I have to create 2 coupons
one repeating for 1 month for monthly subscriptions
and one repeating for 12 month for yearly subscription?
Well do you want the discount to be repeating? Or you just want it to apply to the next invoice?
Yes
just to the next invoice.
For yearly for one year, for monthly one month
ok. Seems to be working for yearly at least.
Have to double check if its also working for monthly
Yep having it be repeating and combining with duration_in_months is probably the way to go here
ok thanks for your help.
To get the amount of the next invoice I have to make another call to the api right? or could I extend the retreive subscription to also get the next upcoming invoice amount?
If you want to preview the amount of the next invoice you want to use our "Retrieve upcoming invoice" endpoint: https://stripe.com/docs/api/invoices/upcoming
alright, thought that there is an easier way instead of making another api call
No the upcoming invoice information won't be returned on the update request
ok.
But could I expand a subscription retrieve call to get upcoming invoice?
Otherwise I need after update 2 other api calls.
- upcoming invoice api call
- retrieve subscription api call (since we have to store some more other values, which are not returned in the updated request)
No you can't expand to see upcoming invoice. You will need a separate API call for that. What values are you not seeing in the update request that you want?
You can expand responses in your update request as well
So you shouldn't need to retrieve the Sub again
ah ok great.
will then try that.
Then one additional api request is fine to get that upcoming amount
Thanks for your help! 🙂