#OptimalSurprise-lifetime-revenue

1 messages · Page 1 of 1 (latest)

barren dawn
#

Hi there! Can you tell me more about exactly what you mean by that and exactly what you are looking to do?

nocturne valve
#

Yes sure

#

So we have usage based plans e.g. volume based pricing

#

We'd like to charge our customers based on their lifetime usage and not just the usage in the month / billing period

barren dawn
#

Okay so sounds like you would need to retrieve the lifetime volume of the Customer and then adjust the Subscription accordingly.

#

Is the question how to actually do that?

nocturne valve
#

Yes exactly

#

So i think we can get the usage record summary but I'm not sure how far we can go back

barren dawn
#

You can use those invoices to get the lifetime volume.

#

Then you would have different Prices based on different volume segments

#

And upgrade/downgrade the Customer's Subscription(s) based on their total lifetime volume

nocturne valve
#

Which field should I look at in invoices to get the lifetime volume?

#

Also do we do the downgrade/ upgrade after invoice.paid is fired by the webhook?

barren dawn
#

The invoice object has a total which includes discounts/taxes or an amount_paid depending on which you want to use.

#

And yeah you likely would want to check each billing cycle so after invoice.paid would work well.

nocturne valve
#

Is this the same approach used for graduated pricing?

barren dawn
#

Yeah pretty much. You would adjust your tiers based on lifetime volume.

nocturne valve
#

Right that makes sense

#

Thank you for this