#miguelpinto-upcoming-invoice-coupon

1 messages Β· Page 1 of 1 (latest)

restive tiger
#

Hello πŸ‘‹
do you have a request ID I can take a look at?

toxic crest
#

sure thats an attribute in the response ?

#

thats the payload of the response

toxic crest
#

this one

restive tiger
#

gotcha. taking a look

toxic crest
#

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

restive tiger
#

hmm still looking
sorry for the delay
Juggling between a few threads

toxic crest
#

No problem

restive tiger
#

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

toxic crest
#

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 =

#

?

restive tiger
#

I am not able to reproduce it for some reason πŸ€”
Let me try one more time

toxic crest
#

"total_discount_amounts": [
{"amount":0,"discount":"di_1KUZMiJfYi7qv89iKS44u5a6"}
],

restive tiger
#

thanks πŸ‘€ looking

toxic crest
#

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

restive tiger
#

sure can you send me the response without the coupon applied?

toxic crest
restive tiger
#

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

toxic crest
#

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",

restive tiger
#

can you give a try without subscription_proration_behavior: "always_invoice" and coupon included?

toxic crest
#

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"}
],

tardy flame
#

Hello. Hanzo had to step out, so I'm taking over here. Give me a bit to catch up here

toxic crest
#

sure

abstract elk
#

Can you dump the exact raw JSON output of the upcoming invoice call instead?

toxic crest
#

sure

#

with subscription_proration_behavior: "always_invoice"

#

?

abstract elk
#

yes

toxic crest
#

k

abstract elk
#

it's all broken and not valid json

toxic crest
#

1 min

abstract elk
#

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?

toxic crest
#

yes

#

"total_discount_amounts": [
{"amount":0,"discount":"di_1KUZuNJfYi7qv89ij4oSkUvM"}
], but this should have the 100 ?

abstract elk
#

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

toxic crest
#

its feels strange its like you will pay 700 apply discount and pay 600 and the discount amount is empry

#

empty

abstract elk
#

Agreed, that's something particular about proration where the discount is pre-included

toxic crest
#

ok thank you

small steppe
#

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 πŸ˜…)

abstract elk
#

@small steppe not really, you kinda have to do the whole math 😦

#

it's something we want to fix

small steppe
#

😬 ok. thanks