#Ali Raza-invoice

1 messages · Page 1 of 1 (latest)

feral garnet
#

The next invoice would be created at current_period_end on the Subscription

dense minnow
#

@feral garnet this is from stripe but it's return me 25 end date

#

it should be 26 in response

feral garnet
#

Can you share the subscription ID with me?

dense minnow
#

yes

#

sub_1JmxEYHswjr8bdMVshX18rbj

#

@feral garnet

feral garnet
#

When I look at that subscription I see a current_period_end of 1635238951, which is the 26th

dense minnow
#

@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

feral garnet
#

Ah, you should be checking current_period_end on the Subscription, not the Invoice

dense minnow
#

so how invoice is working i mean about dates

feral garnet
#

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?

dense minnow
#

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

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

dense minnow
#

can we get upcoming invoice?

feral garnet