#bkrnetic-subscription-by-product-id

1 messages ยท Page 1 of 1 (latest)

crisp plank
#

Hello ๐Ÿ‘‹
Give me a moment to catch up here, thanks ๐Ÿ™‚

slate cave
#

Thanks!

hallow pier
slate cave
#

Yes I'm aware of that functionality. Was hoping there was some way. Never mind, thanks a lot for your help!

hallow pier
#

That'd be a feature request, I'm going to track it but I recommend flagging to our support team too

slate cave
#

Cool, thanks.

I have additional question - how come I get the upcoming invoice but there are no upcoming invoices in Stripe dashboard?

hallow pier
#

I'm not sure what you mean by that

slate cave
#

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

hallow pier
#

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

slate cave
#

Hmm, ok, I will do some more checks to make sure we are on the same page

hallow pier
#

If you can just share an example customer id cus_123 where it happened I can double check

slate cave
#

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

hallow pier
#

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

slate cave
#

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

hallow pier
#

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

slate cave
#

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?

hallow pier
#

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)

slate cave
#

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.

hallow pier
#

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.

slate cave
#

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...

hallow pier
#

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

slate cave
#

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?

hallow pier
#

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"

slate cave
#

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 ๐Ÿ˜„

hallow pier
#

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!

paper pelican
#

๐Ÿ‘‹

slate cave
#

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 .