#pavan-subscriptions

1 messages · Page 1 of 1 (latest)

feral cairn
late bison
#

Will it show the delta ?

#

Without changing quantities if i call this API it is still showing some amount as due instead of 0

feral cairn
#

it shows the upcoming invoice, which means it shows the next billing cycle

#

if you are on a $100x1 item/mo subscription and call that endpoint today to preview changing to $100x2 items/mo, it shows you $200 , plus the "delta" (the proration items). Not just the proration.

late bison
#

It is not applying discounts also even after adding setCoupon to the params

feral cairn
#

can you give a complete description of the problem?

  • the exact code you wrote to call that endpoint
  • a request ID for the GET request involved https://support.stripe.com/questions/finding-the-id-for-an-api-request
  • the exact response you received and any code you wrote to parse that response, indicating specifically what you see as the problem(a field you think should correspond to a discount that is not set or has a different value than you expected)

thanks.

late bison
#

Ok let me explain my use case. I have 2 products each with 10% discount on price for annual subscription. User will buy subscription, from the next time when user might increase/decrease the quantities of the subscription, we would like to exact amount that needs to pay now

feral cairn
#

makes total sense! You can preview that using th upcoming invoice endpoint, setting subscription_items set to the state you are upgrading the subscription to(so the increased quantities).

#

the proration line items returned are what would be charged if you made the update now(you can look for the items that have proration:true like I mentioned and add them up, that's the "delta" or "amount he need to pay extra").

late bison
#

Yes, upgrade is working fine. Suppose if pass the same with decreasing quantities with proration as immediate invoice the amount due should come as 0 right ? But it is not happening.

#

Got it, this is retrieving next billing cycle invoice is it ?

feral cairn
#

the amount due should come as 0 right ?
maybe, maybe not, it really depends on the exact prices of the items involved.

late bison
#

Now comes the trickiest scenario, suppose one quantity is upgraded and other quantity is downgraded. How do i know the amount due it is returning is for immediate or for next billing cycle ?

late bison
feral cairn
#

if you are on a $100x1 item/mo subscription and call that endpoint today to preview changing to $100x2 items/mo, it shows you $200 , plus the "delta" (the proration items). Not just the proration.

#

i.e. you'd have an invoice with an item for 2x Product : $200 (which is the price for the upcoming billing period, an item for Unused time on 1x Product : -$x and remaining time on 2x Product : $y (those last two are the proration/delta/whatever you want to call it), I believe.

late bison
#

Thanks @feral cairn . Got the info one weird thing is happening. Current subscription api endpoints count is 200 and i also 200 to invoiceParams but the output is showing 150

#

Since there is scheduled subscription it is showing that values ?

feral cairn
#

can you share - the exact code you wrote to call that endpoint as I asked for earlier?

#

but yes I think you're right