#scott-subscription-unpaid
1 messages · Page 1 of 1 (latest)
Hi!
scott-subscription-unpaid
First of all, THANK YOU FOR THE AWESOME FEATURE OF TEST CLOCKS
@naive saffron It depends a bit what you are after. You can list all unpaid Invoices associated with a Subscription by using https://stripe.com/docs/api/invoices/list and passing subscription: 'sub_123' and then walk back the list.
If your goal is to make a Subscription active again, what you need to do is pay the most recent Invoice so it'd be the one in latest_invoice: 'in_123' on the Subscription object
not really no
the latest Invoice is always for the current month, we charge in advance
So you take that Invoice, finalize it and pay it
yes it's a draft because the Subscription is unpaid, in which case new invoices stay as draft
Is there a way to access the unpaid invoice quickly? Or I have to parse every invoice?
I already explained what to do
there's no point getting a previous Invoice, this is the Invoice you want to pay: the most recent one
I understand
But my usecase is different
That's because I need to calculate 30 days since the unpaid invoice was finalized
then use https://stripe.com/docs/api/invoices/list and pass subscription: 'sub_123' + status: 'open' though note there might be more than one
sure, let me know if that doesn't work on your example