#mehdim-subscription-period

1 messages · Page 1 of 1 (latest)

light aspenBOT
potent jungle
#

No, there isn't anything that would do that specifically - we have the upcoming invoices api, but that won't work for subscriptions that haven't actually been created yet (because it'll just show you the preview of the invoice that would be created when the sub is created, not the next one after that)

terse horizon
#

hmmm is there any api or helper package that does this logic?

potent jungle
#

Most languages should include some kind of time-related package that would help you calculate this - like if you have a yearly subscription you can use the time package to calculate the timestamp one year from today

terse horizon
#

ahh yeah, the logic just seems a bit complex for monthly when the day of the month doesn't exist necessarily

potent jungle
#

I assume most of those time packages are able to handle that

light aspenBOT
placid mango
#

Technically if you use the Retrieve Upcoming Invoice API https://stripe.com/docs/api/invoices/upcoming you can simulate the first Invoice of a Subscription. That Invoice would have an InvoiceLineItem for the Price of the Subscription which would have a period that you could look at for when the first period ends and use that to know when the next Invoice would be issued

#

mehdim-subscription-period