#fallen-subscription-discount
1 messages ยท Page 1 of 1 (latest)
Hi ๐
always_invoice does not create prorations but instead cuts an invoice at the time of the change, so the charges cover everything up to the change to the Subscription.
Prorations + discounts is a very tricky subject and the way Stripe handles it is counter-intuitive
oh boy, im sure im going to hate this explanation ๐
Well that's about all I've got so far
okay, so here's a senario...
Please just send me the API request ID
๐ one sec
for the change with create_prorations that doesn't do what you expect
req_iBnEQGFXwOEvbj
where as req_uWT0DRM9SqLAZb gives me the prorated amounts i expect but not the discount amount for the coupon
Wait...so which one is the problem you are describing? Let's focus on one scenario at a time here
the root issue is when i preview an update with always-invoice for the proration behavior the total_discount_amounts.amount field is 0
but if i set it to create_prorations the discounts are returned but the amounts are not prorated as i'd expect.
Those settings perform entirely different actions, as I explained.
We explain this in this doc: https://stripe.com/docs/billing/subscriptions/prorations
so i guess the question is.... is there a way i can do "always-invoice" and get back the correct discount amount fields for my coupons?
Are these coupons that were applied before the change you are attempting to make?
yes
And that is the first request ID?
both already have the coupon applied to the customer
but yeah the first request id has the correct total_discount_amounts value
if i need to i can calculate the discount amount on my end but my goal is to have stripe as the source of truth
Ah wait you are talking about the previewing upcoming invoices. Unfortunately I cannot see the output there
correct
one sec i can send you the output
this is with always_invoice set
this is with create_prorations set
I don't need to see most of this, right?
You are saying the issue is with the discount property?
what im seeking is the top response but with the total_discount_amounts property to have values
or really anywhere, i just need to know how much that coupon took off
Okay so these outputs are too big for me to even see what you are referring to
first request...
"total_discount_amounts": [
{
"amount": 0,
"discount": {
"checkout_session": "",
"coupon": null,
"customer": null,
"deleted": false,
"end": 0,
"id": "di_1MUyi8KjI0M1O6BOixz64pIT",
"invoice": "",
"invoice_item": "",
"object": "",
"promotion_code": null,
"start": 0,
"subscription": ""
}
}
],```
second request...
"total_discount_amounts": [
{
"amount": 14400,
"discount": {
"checkout_session": "",
"coupon": null,
"customer": null,
"deleted": false,
"end": 0,
"id": "di_1MUyi8KjI0M1O6BOixz64pIT",
"invoice": "",
"invoice_item": "",
"object": "",
"promotion_code": null,
"start": 0,
"subscription": ""
}
}
],```
Okay and in this case the second request shows the 20% off coupon being applied
so is it just that the coupon has no affect on the proration being requested?
What is the change you are making here?
altering the units on the subscription to a higher amount
Okay so you've got a 20% off coupon that is being applied to all prices for a given customer.
And you are increasing the quantity in two subscription items
correct
So the prorations should be the difference between the old quantities +discountfor the full billing period and the new quantities + discount for the full billing period
Does the amount appear incorrect?
the new discount amount is always zero though
I understand that, I'm just trying to double check how everything is being applied first.
correct, then the first response the amounts are what i expect
Okay, so that part is working. Good
And the first one is always_invoice or is that second one?
the first one
Th3FalleN sub discounts
oh lawd, it's the big guns. i done dun it now
fallen-subscription-discount
sooo any ideas?
Sorry I totally misunderstood you were waiting on us when I took over
no worries
sorry Discord is super busy. All you're asking is why total_discount_amount is not set? Or something else?
yeah, in a nut shell i need to know the amount of discount applied to the proration
Yeah that's not possible today unfortunately, we don't surface it in that case
yeah it's something we want to fix
that hurts my brain, but alrighty i'll get on it. thanks for your input as always
oof yeah so the prorated amount does indeed include that coupon in it's total calculation. which makes things even worse 
yeah we basically apply the coupon during the proration but we don't surface back the calculation I think
