#Techy Geek

1 messages · Page 1 of 1 (latest)

brazen kestrelBOT
hearty juniper
#
  1. the same I would say, as it would technically still work, but maybe you 'd want to specifically detect the current date in your code and if it's the first of a month, just create a subscription 'normally' without specifying a billing_cycle_anchor since it's not needed
wanton sonnet
#

Okay, @hearty juniper . Thanks for the information.

#

And what will be the value for billing_cycle_anchor ? Actual date or timestamp duration from current DateTime??

hearty juniper
#

you would calculate some unix timestamp for the 1st of next month and pass that

#

for example maybe 1672563600 for 9am GMT 1st Jan 2023

wanton sonnet
#

Okay

#

And alongside that is it possible to add an additional amount based on GB used in the last month?

Like last month's user usage of 1 Gb, I will charge an additional $5. It's $5 per GB usage.

0 < usage < 1GB: $5
1 < usage < 2GB: $10
2 < usage < 3GB: $15

hearty juniper
#

we do support usage based billing with tiers too(https://stripe.com/docs/products-prices/pricing-models#usage-based-pricing) , but it's billed in arrears, so you can't really charge for some existing accumulated usage that happened before you created the subscription, it's not really how that works(hence why I mentioned you can pass some flat integer invoice item manually too). But that is what you'd use in general for this going forward on the subscription