#miguelpinto-upcoming-invoice-coupon
1 messages Β· Page 1 of 1 (latest)
It should look something like req_xxxx
gotcha. taking a look
the coupon is applied as you can see on the item name "Remaining time on Growth (with $100.00 off) after 18 Feb 2022",
"total_discount_amounts": [
{"amount":0,"discount":"di_1KUYW5JfYi7qv89iZoaUa9s2"}
],
but in the response this field show amount as 0
hmm still looking
sorry for the delay
Juggling between a few threads
No problem
definitely a tricky one
Just so that I'm on the same page, you have a subscription that costs $99 and then you have a coupon which is $100 off.
When you apply the coupon to upcoming_invoice, it should show the total discount amount but its showing $0
The subscription that I have now is 99 monthly the upcoming invoice is calculating if you upgrade to higher tier that costs 800 and you have a coupon that is 100 dΓ³lares off
And itβs returns the item with 100 off but the total discount amount is 0
It applies the discount but donβt show it in the total discount amount
want me to share the payload ?
with and withou a coupon =
?
I am not able to reproduce it for some reason π€
Let me try one more time
"total_discount_amounts": [
{"amount":0,"discount":"di_1KUZMiJfYi7qv89iKS44u5a6"}
],
thanks π looking
thats the items
"Remaining time on Growth (with $100.00 off) after 18 Feb 2022",
i can send the payload without the coupon if you want
sure can you send me the response without the coupon applied?
So it seems like the discount isn't being applied from the coupon. You're just being credited for the unused time on the old price since you have subscription_proration_behavior: "always_invoice"
You can look at lines , each item is marked as proration: true
but without the coupon
Remaining time on Growth after 18 Feb 2022",
and with th coupon
"Remaining time on Growth (with $100.00 off) after 18 Feb 2022",
can you give a try without subscription_proration_behavior: "always_invoice" and coupon included?
this way is wrong
its gives the discount 2 times
"description": "1 Γ Growth (at $799.00 / month)",
"discount_amounts": [
{"amount":10000,"discount":"di_1KUZlsJfYi7qv89iiRhiWxKy"}
],
and "description": "Remaining time on Growth (with $100.00 off) after 18 Feb 2022",
"discount_amounts": [
{"amount":0,"discount":"di_1KUZlsJfYi7qv89iiRhiWxKy"}
],
Hello. Hanzo had to step out, so I'm taking over here. Give me a bit to catch up here
sure
Can you dump the exact raw JSON output of the upcoming invoice call instead?
yes
it's all broken and not valid json
Okay so I think you're misreading this. Let me explain that specific invoice first. You're on a $99/month price. You're moving to a $799/month price with a $100 off coupon forever. When you do that change we need to reimburse the customer for the time paid on $99 that won't be used, and charge them for the time not yet paid on the $799 price for the remaining time.
The invoice above is what it'd look like if you made that change right now and cut an invoice. It has 2 line items that are proration items that are basically
- -95.54 USD for the first part, they paid $99 and you change their plan right after so you owe them that credit
- $674.59 is what they owe you for the new $799 price with $100 off ($699) minus the time already elapsed.
If you made the change now then, they would ow you $579.05 and be done with it.
Then next month, on March 17, the Subscription will renew for $799 a month, it still has the $100 off coupon since it's a forever coupon, and so they'll owe you $699 and all future months are like that
Does that first make sense?
yes
"total_discount_amounts": [
{"amount":0,"discount":"di_1KUZuNJfYi7qv89ij4oSkUvM"}
], but this should have the 100 ?
No, proration line items are a bit weird, the discount is applied when we calculate the proration amount so the discount is _already applied, so the global discount is ignored. It's confusing but the math is already correct
its feels strange its like you will pay 700 apply discount and pay 600 and the discount amount is empry
empty
Agreed, that's something particular about proration where the discount is pre-included
ok thank you
so from an API consumer perspective is there a way to know what was the amount of the coupon when you're upgrading and prorated?
(sorry to jump in this conversation π )
@small steppe not really, you kinda have to do the whole math π¦
it's something we want to fix
π¬ ok. thanks