#bkrnetic-subscription-by-product-id
1 messages ยท Page 1 of 1 (latest)
Thanks!
@slate cave it's not possible. What you can do is list by Price id: https://stripe.com/docs/api/subscriptions/list#list_subscriptions-price but if you have N Prices for one Product you have to make N calls
Yes I'm aware of that functionality. Was hoping there was some way. Never mind, thanks a lot for your help!
That'd be a feature request, I'm going to track it but I recommend flagging to our support team too
Cool, thanks.
I have additional question - how come I get the upcoming invoice but there are no upcoming invoices in Stripe dashboard?
I'm not sure what you mean by that
if I go to customer via dashboard, I cannot seem to find any upcoming invoices + all subscriptions are incomplete.
I was expecting to get null or exception when trying to fetch the upcoming invoice
Sure sorry I understand that, but that's still really vague
What do you get instead? What do you send in the API as parameters? What's your exact code?
because yes if you have a customer with no subscription or schedule at all, and you call the upcoming invoice API on that specific customer with no specific parameter beyond the customer id then you'd get an error
Hmm, ok, I will do some more checks to make sure we are on the same page
If you can just share an example customer id cus_123 where it happened I can double check
Ofc, here you go:
cus_LrsG0OJNARMePg
and I'm getting an upcoming invoice for this subscription: sub_1LADeWC9ngr8VoB5NpFr0MJP
You can see that subscription is Incomplete
yes it's just the Dashboard not showing the upcoming invoice in that case, that's all
while the API assumes that you want to see their upcoming invoice
Well, we want to show our users when they are going to be charged next. If API considers an upcoming invoice an invoice for subscription that was never paid for, that is not my solution then.
We need an invoice for subscriptions that are active actually
I'm not sure I grasp what you mean again I'm sorry
If you are in a Billing cycle for June, and the current invoice is not paid yet, the upcoming invoice is still for July, even if you might be canceled for failed payment for June by then
it's the same with incomplete. The next invoice is on the next billing cycle
The upcoming invoice should be an invoice for the subscription that is active, or at least it was active at some point.
Currently I'm getting the first invoice of a subscription that was created with payment_behaviour=default_incomplete .
Is it clearer now?
It is not ๐
Are you saying that you
1/ Have a Subscription that started on June 13, it's incomplete, when you call the upcoming invoice API you get the invoice from June 13 (the existing one)
2/ 1/ Have a Subscription that started on June 13, it's incomplete, when you call the upcoming invoice API you get the invoice from July 13 (next month)
In our flow, subscription becomes active only if the first payment was successful. Incomplete subscriptions are those that were created, the payment was initiated but it was not completed. We don't want to take incomplete subscriptions into account, that is what I'm saying.
I understand but I'm trying to explain how our upcoming invoice API works. So if you want to ignore incomplete subscriptions you need to track those separately and not call the Upcoming Invoice in that case.
Ye ok, I just wanted to clarify that... I will need to fetch active subscriptions and get the first upcoming invoice then, filtering it by subscription id.
I reckon that it should not work that way however. Because if subscription was never active, then no new invoices should be generated...
but it's no different than the example I gave you earlier
where you don't know if failed payments will cause the subscription to be canceled before the next invoice and you can still preview it
I get it ye. As long as subscription is not canceled, Stripe plans to create new invoices which makes it visible as upcoming one, right?
yep
I see how we could have gone the other way with incomplete though but we treated those as more "you either action them today or they get canceled"
Ye, I think that you should consider changing "upcoming" logic, because if the first invoice is not actioned, the next one will never be finalized/created, as status incomplete is there only before subscription has started. Later on it cannot become incomplete
Please let me know if I see it wrong tho ๐
We don't plan to change it. That was a conscious decision. We see incomplete similar to past_due. The upcoming invoice will get generated if the subscription is not canceled/expired
I have to run but @paper pelican can follow up if you have more questions!
๐
Thanks for you help @hallow pier and run safely! ๐
Well, seems the only way to handle it properly it to do some work around. You can close this topic @paper pelican .