#Ali Raza

1 messages · Page 1 of 1 (latest)

surreal caveBOT
mellow laurel
#

Hi there!

chilly stratus
#

Hi

chilly stratus
#

my question is i want to save all invoices of specific subscription with start and end date of invoices

#

@mellow laurel both dates looks same

mellow laurel
#

Is this the first invoice of a subscription? If so, it's expected that both will be equal (and correspond to the date the subscription was created)

chilly stratus
#

sub_1LnWDTLyP1jWY3OLaiqzWvHj
the invoices of this subscription should return these dates
29 Sep - 29 OCT
29 OCT - 29 NOV

#

how i can get this

#

@mellow laurel

#

i have 2 invoices against this subscription

mellow laurel
#

Yes, have you checked period_start and period_end? Execept for the first invoice of the subscription, it should match the dates you are looking for.

chilly stratus
#

in_1LnWDTLyP1jWY3OLYHMVqbQ4

#

why it's showing same for this subcription

#

@mellow laurel

mellow laurel
#

I explained that earlier:

Is this the first invoice of a subscription? If so, it's expected that both will be equal (and correspond to the date the subscription was created)

chilly stratus
#

29 Sep - 29 OCT
29 OCT - 29 NOV

#

how i can get this

#

for saving in database

#

@mellow laurel in_1LyOWULyP1jWY3OLqQvWkUTW this invoice number is showing november in stripe dashbaord

mellow laurel
chilly stratus
#

expand with invoice id?

mellow laurel
chilly stratus
#

$invoie=$stripe->invoices->retrieve(
$value->id,
['expand' => 'lines']
);

#

like that?

#

in php

#

@mellow laurel

mellow laurel
#

That looks correct to me. Have you tried this code?

chilly stratus
#

invalid array returned

mellow laurel
#

Oh wait, expand is itself a array. So it should be something like this I think:

$invoice = $stripe->invoices->retrieve(
  $value->id,
  [
     'expand' => [ 'lines' ]
  ]
);
chilly stratus
#

thanks

#

awsom

#

working

mellow laurel
#

Happy to help 🙂