#Ali Raza-invoice
1 messages · Page 1 of 1 (latest)
@feral garnet this is from stripe but it's return me 25 end date
it should be 26 in response
Can you share the subscription ID with me?
When I look at that subscription I see a current_period_end of 1635238951, which is the 26th
@feral garnet
id: "in_1JoP69Hswjr8bdMVvRcvxkaK"
period_end: 1635152551
period_start: 1635066151
@feral garnet when i fetch the all invoices it's retrun me this
and this is 25
Ah, you should be checking current_period_end on the Subscription, not the Invoice
so how invoice is working i mean about dates
Can you clarify? You asked how to get the date for when the next Invoice would be created, which you would find at current_period_end on the Subscription. Were you asking something different?
my use case is show the next invoice date to my clients and i write the code for that fetch all the invoices and store in database against subscription and showing the period_end date as next invoice date @feral garnet
So why doesn't checking current_period_end work for your use case? That will get you the date of the next Invoice just like you asked. You can't fetch that Invoice yet because it hasn't been created at all - the most you could do is to show them a preview of what it may look like by retrieving the upcomign invoice
can we get upcoming invoice?
You can do that with the API - https://stripe.com/docs/api/invoices/upcoming
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.