#gkiokan - update subscriptions
1 messages ยท Page 1 of 1 (latest)
Hello! Just starting a thread for you -- I'll review and respond as soon as I can ๐
What do you mean by "lose your old invoices" here?
Can you share an example?
Sure, I am about to put that online so you guys can test it on a production / test environment but the issue is really strange for me now
I am using the invoices endpoint to get all invoices, so I can list the old invoices and upcomming ones
But when you do what I described with update, swap tier, cancel, somehow I lost the "old" invoices that where set already
gimme around 10 minutes, I will deploy the updates on the public server and you can check it together with me
okie dokie
I was just testing the following:
Subscribe to packet A
Then cancel
Subscribe to packet B
only the upcomming invoice for packet B is shown
Shown where?
On my dashboard
OK, and what is the problem?
I try to figure it out when it happens. But the "old" invoices are gone when a certain action is done
Well, you're speaking about an upcoming invoice, not a real past paid invoice
See that. I have swapped from Business to another tier (bottom to top)
Past paid invoices should be viewable on both the customer and subscription
If i cancel the subscription it shows me thoose 2 invoices - as expected until now.
The topest invoice is the upcomming invoice so this is clear so far
But look now. When I subscribe to a new tier, everything else is gone
You're showing me your own UI -- I have no idea how that works. Is something not working for you with the Strike API/SDK?
Forget the display -- what's not working like you expect with the data/code that drives this?
My UI just renderes the /invoices api results, nothing special. So you can see the bottom pat with the header "Bisherige Rechnung" are the invoices that are gathered from the api
If I subscribe to a new tier after a cancled subscription, the old existing invoices are gone
Gone from where? How are you retrieving them?
You can see here the invoice have description value of unused **** (the middle card one)
This one doesn't exist anymore if I cancel it and make a new subscriptions.
Though the Stripe PHP SDK with laravel cashier which calls the /invoices endpoint
Are you listing invoices by subscription ID or customer?
customerID
If you cancel a subscription and create a new one, you would need to retrieve the subscriptions using the previous subscription ID:
https://stripe.com/docs/api/invoices/list#list_invoices-subscription
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
lemme double chck if they exists on the dashbaord actualy
You mean my primary subscription id gets overriden and the old invoices belongs to another subscription id?
That could make sense and explain why my invoice list for the subscrption is empty
Lemme investigate the docs you send me
primary subscription id
This is not a thing
after a cancled subscription
you said you cancel a subscription before subscribing to a new server. This would be a new subscription with a new ID.
Yea that makes sense. Didn't thought about that
Is there a way to call the invoices api by customerID? * Ok I think I found it. Lemme try it out.
I just double checked my code, it gets all invoices for a subscription. With your explanation it makes total sense why they are gone.
OK great, so now you have the info you need to get those invoices for the cancelled subscription separately then?
I think when I just the list all method, I could get all of them at once. https://stripe.com/docs/api/invoices/list?lang=php
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
If you like, sure. You can use the customer and sort by subscription in your own code
A canceled subscription is also a "finished" one which gets calculated until the canceled date.
By Default Laravel allows you to do this $org->subscription('default')->invoices(); but this doesn't allow to see the other invoices which breaks my flow
Ah, you're using laravel
I don't know what logic is adds for the customer/subscription relationship. You might need to reach out to the laravel devs/community to see what's possible there.
๐
You saved my day. God damn I was struggling all the afternoon to figure out why invoices are gone. Shame on me
Sometimes a good documentation is also overhelming
jynoh looked before that but maybe you know that issue. He said thi sis not supported yet
On a invoice item there is an description. That is computed by stripe itself. But it doesn't get localized. Do you know anything about that?