#Ömer Bayram
1 messages · Page 1 of 1 (latest)
You'd use this endpoint: https://stripe.com/docs/api/invoices/upcoming
And pass the subscription parameter
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Thanks. But this is only showing the next natural billing date not all dates.
Is there a possibility to list all next invoices/dates?
There is not. But assuming a regular billing interval it shouldn't be too difficult to compute that yourself from the billing_cycle_anchor on the Subscription object
I have used moment to add 1 month if its monthly or 1 quarter if it is quarterly but than I had the problem, that I had to add or substract an hour because of DST
nextPeriodStartDate.add(1, "month");
const nextDST = nextPeriodStartDate.isDST();
if (firstDST && !nextDST) {
nextPeriodStartDate.subtract(1, "hour");
}
if (nextDST && !firstDST) {
nextPeriodStartDate.add(1, "hour");
}```
I used this to calculate the next natural billing date when using backdate_start_date and billing_cycle_anchor together
Otherwise the amount was differing from the regular period price
Is there a better solution for this? Thanks again.
Hmm, nothing that we can offer automatically I'm afraid
Ok. Thanks again.