#Dharunkumar Natarajan

1 messages · Page 1 of 1 (latest)

hollow cloudBOT
silk jasper
#

also, the total discount amount field shows as 0 in the invoice object:
"total_discount_amounts": [ { "amount": 0, "discount": "di_1N6fNtG3LDN6ekHVB6uqMQku" } ],

#

this is the invoice_id in_1N6fNtG3LDN6ekHVNmmSWEPf

forest lark
#

Looking into this -- I see the one item price is $50 with 100% discount so not sure either

silk jasper
#

yeah, but since the subscription is prorated for the first month when they join, I was needing the prorated amount that stripe gives me to do some logic in my backend

#

so if the customer joins 15th of may, and the charge is $25 for the $50 subscription because of proration, I only give half the thing that I usually give

hollow cloudBOT
river pike
#

👋 I'm also take a look - catching up here

river pike
#

So giving some context - part of the issue here has to do with the way handles prorations where billing_cycle_anchor is set during Subscription creation. This generates a prorated line item, which are calculated by first applying the discount and THEN calculating the proration (so the proration line item itself hasn't actually been discounted)

#

I know this is a bit confusing

silk jasper
#

So is there any way to find the amount before discount?

#

If not, can I get an idea of how the prorated amount is calculated in stripe? So that I can use the same logic on my end to provide the same amount of quantity that stripe charges for

river pike
silk jasper
#

thanks, as the description of the field suggests, it will always show the total amount paid irrespective of if coupon applied or not right?

river pike
#

Yes, it should

silk jasper
#

thanks! will try this out!