#umro_zeid-subscription
1 messages · Page 1 of 1 (latest)
hi there, you can list the paid invoices for a subscription using : https://stripe.com/docs/api/invoices/list
Is there a way to get this info for multiple subscriptions with one API call?
I'll be running a migration for thousands of subscription and I'd like to do it in the least possible number of API calls.
can you elaborate more on your logic? Are you looking to migrate all currently active subscriptions?
I have subscriptions stored in the DB. We are going to create a new column to indicate wether the subscription had any previously paid charges or not.
I can use the invoice list method you suggested, but then I'll need to call it for each one of the subscriptions.
If there is a way to retrieve the paid invoices for like a 100 subscriptions at once then I can filter them, that would be great.
I was thinking about search method
i'm a bit confused over why you need to indicate if the subscription had any previously paid charges though. Is it because you have trials for these subscriptions?
It has something to do with resetting credits for users with multiple subscriptions on our side.
Anyways, can the search API be used for such a use case?
i personally don't think the search API is useful for your use case. It doesn't have any search parameters which are any different from retrieving a Subscription.
Depending on what you set as the payment_behavior [0] and collection_method [1], you could potentially just refer to the status of the subscription : https://stripe.com/docs/api/subscriptions/object#subscription_object-status.
All of your subscriptions would theoretically have had previously paid charges as long as it's not in incomplete or incomplete_expired state or currently in a trial
[0] https://stripe.com/docs/api/subscriptions/create#create_subscription-payment_behavior
[1] https://stripe.com/docs/api/subscriptions/create#create_subscription-collection_method
That's very helpful. Thank you Alex