#clive-clio
1 messages · Page 1 of 1 (latest)
Hi there. Can you tell us a little more about what's happening?
Even just a short summary of what you were seeing would be great
Sure! So the example is that I have a subscription with a single subscription item and an associated coupon (like for 10%). If I preview the addition of another subscription item mid billing cycle AS WELL AS the removal of that 10% coupon, I get a prorated invoice where the total is correct. However, in the invoices .discount field, the original 10% coupon is present instead of the absence of a coupon that I would expect.
In the case where I instead change the discount from the original 10% coupon to lets say, a 5% coupon along with the change to subscription items, that discount field correctly represents the change to the 5% coupon for the invoices .discount field.
(this is all through the preview upcoming endpoint)
The request id for the /v1/invoices/upcoming endpoint is req_UYlTZ0FLZuIs5W . In this request I was adding the new 3 licenses of one subscription item to the 5 licenses of the existing subscription item and removing the coupon.
Ok I think that makes sense. Just to clarify, if you add a new subscription item and remove the coupon from the old item (but keep that old item on the subscription), then the old coupon is still showing up in the response object. However, if you add a new subscription item and change the old item's coupon, the new coupon will reflect in the response object as expected? Is that an accurate summary?
Yes, that is accurate. One thing to note is that I believe that the coupon is associated with the subscription itself, not the subscription item.
But yeah, you got it!
Thank you so much!
Is this intermittent for you, or can you reliably reproduce the issue?
Reliably reproduce
Got it thanks. Will try to reproduce this
Can you send over the raw json response from that upcoming invoice call too?
The view I have doesn't show request responses for GET requests to our API, so the raw json response will help me investigate this
Sure, give me a second
I redacted just a few fields that are just business related but this is the response.
@olive arrow Just to be super clear as I am trying to reproduce, you are saying that one the same Subscription when you use the Retrieve Upcoming Invoice API you will
1/ don't get discounts set if you _only change the current SubscriptionItem's quantity
2/ get discounts if you don't touch the current SubscriptionItem at all but add a new one
Is that correct?
Sure, this is the scenario im seeing this for.
1)Have an existing subscription with a single subscription item and a discount associated with the subscription.
2) Preview the addition of a new susbcription item to be added along side the existing subscription item to the existing subscription. This preview call to the upcoming endpoint also includes the removal of the discount associated with the existing subscription.
3) The response from the preview upcoming endpoint has the original discount in the response's discount field.
Sorry, can you answer my exact specific question? You did say the behaviour was different based on what you updated right?
your account has specific secret features just for you that change the logic around Coupon and Subscription updates so it's always really complex to reproduce exactly what you see. I want to make sure I fully understand what you are describing as the bug
Okay! So I just attempted to preview a change ONLY for the subscription item that exists already, and im still getting the discount field populated by the old discount.
Gotcha so I see the same thing on my account no matter what I change too so it's not specific to your account in that case
Ah! Good to know
Are you saying this recently changed? If so do you know when it started again?
We previously were not making coupon changes with prorated changes as a rule, so I dont know how long this has been this way. As we were looking into being able to provide complex previews like this we noticed this behaviour.
That being said, i previously brough tthis up maybe a week ago in this discord but when I tried to replicate it, I was unable to.
Ah gotcha so it's not a "change" per se, you are just surprised that it's happening?
but now I can again
Yeah, from my understanding of the preview logic, I would assume the discount field would be populated with the discount being applied to the invoice.
and it seemingly does that in every other case.
Gotcha, yeah feels like a weird quirk in that case of an Invoice for a Subscription with a Coupon. I'll flag to the product team to investigate if we should change this behaviour
Sounds good, is there any way I can follow if a decision is made on that?
No, you'd need to write in to support as usual in that case: https://support.stripe.com/contact
Ah, okay! Thanks for all your help with this.
sure thing!