#hpanseriya

1 messages · Page 1 of 1 (latest)

cunning hatchBOT
paper wren
#

hello! what do you mean by price breakdown for prorated charges? can you illustrate this with an example?

sage pebble
#

I have subscribed silver plan $200 on 2nd Feb

Now, I am going to upgrade subscription on 8th feb as per the following

  • silver plan $200 with 2 Qty
  • gold plan $300

Now, we want to show how we calculated the amount of silver and gold plan
Like:
Silver Plan => $20
Gold Plan => $270

FYI: We also want to charge immediately.

#

Understood?

paper wren
#

yep

sage pebble
#

Can you please let me know how we can achieve this via API?

paper wren
#

do you have an invoice id that I can refer to? that'll help me be able to explain this better

sage pebble
#

ok

paper wren
#

give me a while to type out the explanation

#

is this the specific invoice in_1OglQ8HpCCuanh4qPacpootn you want an explanation for?

sage pebble
#

yes

paper wren
#

with reference to in_1OglQ8HpCCuanh4qPacpootn

you're adding a new subscription item (https://dashboard.stripe.com/test/logs/req_Ef2Lyw1P1g7rkF) and prorating. So it would be

Price or Plan amount / (subscription current_period_end - subscription current_period_start) * (line item's period end - period start)

#

the time is the unix timestamp

sage pebble
#

Can you please give me elaborate with example?

paper wren
#

in_1OglQ8HpCCuanh4qPacpootn

Price or Plan amount ($995) / (subscription current_period_end : 1709719066 - subscription current_period_start : 1707213466) * (line item's period end : 1709719066 - period start : 1707213507)

sage pebble
#

To show the pro-rated amount of specific plan. Right?

paper wren
#

you can try it out

sage pebble
#

where is the quantity