#fallen-subscription-upcoming
1 messages ยท Page 1 of 1 (latest)
fallen-subscription-upcoming
๐
Hello @pale kite ! I'm going to need more detailed and specific information as I can't do much with that request id. GET requests don't store the response bodies so I don't know what you get back versus what you expected.
That's my entire response, invoice is the upcoming PRORATED invoice preview, the other one is the same but non prorated.
yeah sorry I still need you to be drastically more specific
but notice the amounts are all negative on the top one when im previewing adding 5 units to the subscription
Please show exactly what the problem is. This is a huge payload, I don't know your setup or your prices or your coupon. What specifically is confusing in that response
so in short, current subscription is $352/mo
now i preview adding 5 seats to that and i get back a negative amount due?
but! if i dont have a coupon attached to the customer i get the expected amounts back.
Sorry, please try to be crisp and clear and detailed, all in one unique message all at once, instead of small sentences with bits of information.
You say "the subscription is $352/mo". But it's not since you clearly have 2 separate Prices in your upcoming invoice call for example.
- Customer currently has a subscription totaling $352/mo consisting of 2 prices each with 60 units totaling $8/mo per unit.
- Customer also has a lifetime coupon attached to them that provides a 20% discount.
- i then attempt to preview an upcoming invoice on the CURRENT subscription with the the same subscription item ids, but a differing quantity now 65 units per price.
- i get back negative amounts due
- if i remove the coupon i get positive amounts due
is that better?
Yep it's better. I still don't get it but now I can ask questions
Customer currently has a subscription totaling $352/mo consisting of 2 prices each with 60 units totaling $8/mo per unit.
how does that work? A price of $8/month with a quantity of 60 is 60*8 = $480 for each Price or $960 for both together. Even with a 20% discount it doesn't reach $352
So sadly the math still doesn't really add up to me and you must be leaving something out
๐
Hey man, math is hard 
Can you maybe simplify your ask drastically. Like one subscription, one price, one quantity, then increase by 1 and look at the math?
Becuase right now I'm struggling to understand what part is confusing in the response exactly
the part im missing is when i add 5 more units to each of those prices with a 20% coupon my amount due is negative somehow. but adding 5 more units to the two prices should result in a postive amount due
so in short if a customer is a non profit and gets a 20% discount from a coupon. then they go to add units(seats) to their plan they end up being able to add 20 units(seats) before being charged anything.
hum okay, give me a few minutes I'll be back with a cleaned up version of your JSON to explain
๐ you are a saint
"invoice": {
"amount_due": 0,
"amount_paid": 0,
"amount_remaining": 0,
"billing_reason": "upcoming",
"discount": {
"coupon": {
"duration": "forever",
"percent_off": 20,
},
},
"ending_balance": -6400,
"lines": {
"data": [
{
"amount": -12000,
"currency": "usd",
"description": "Unused time on 60 ร Attendance after 25 Jan 2023",
"price": {
"id": "price_1MM0J2KjI0M1O6BOTBRw79Em",
"nickname": "Monthly w/Advanced",
"unit_amount": 200,
},
"proration": true,
"quantity": 60,
},
{
"amount": -36000,
"currency": "usd",
"description": "Unused time on 60 ร Advanced Scheduling after 25 Jan 2023",
"price": {
"id": "price_1MM0GxKjI0M1O6BOXNBegx8V",
"nickname": "Monthly",
"unit_amount": 600,
},
"proration": true,
"quantity": 60,
},
{
"amount": 10400,
"currency": "usd",
"description": "Remaining time on 65 ร Attendance (with 20.0% off) after 25 Jan 2023",
"price": {
"id": "price_1MM0J2KjI0M1O6BOTBRw79Em",
"nickname": "Monthly w/Advanced",
"unit_amount": 200,
},
"proration": true,
"quantity": 65,
},
{
"amount": 31200,
"currency": "usd",
"description": "Remaining time on 65 ร Advanced Scheduling (with 20.0% off) after 25 Jan 2023",
"price": {
"id": "price_1MM0GxKjI0M1O6BOXNBegx8V",
"nickname": "Monthly",
"unit_amount": 600,
},
"proration": true,
"quantity": 65,
}
]
},```
okay this is me extracting what matters in this object. It shows you the total amount due ($0) the ending balance/credit ($64) but also it explicitly shows you the 4 line items and why they are like that.
The problem you have is that the customer paid for 60 seats full price. So we credit them back for 60 seats full price for the remainder of the period they won't use.
Then we charge them for 65 seats for each price for the remainder of the period but we add the coupon to that (which didn't exist at the time they paid 60 seats full price).
What a lot of people would expect here is that we only add 5 seats (the extra) with the coupons. But we don't do that unfortunately. There are many reasons why (when you go up and down it can mess things up). But there's unfortunately no way around this in your situation
OOOOOOOOOH they didnt have the coupon when the subscription was created.........
thats 100% the issue....
thank you so much!
of course
I wish we had a simple way to explain what I just did
it takes so much work to parse that JSON and extract the relevant info out of it
the big thing was that when it was created the coupon wasnt there...