#TonyS-sub-schedule-immediate-payment

1 messages ยท Page 1 of 1 (latest)

faint acornBOT
sour lily
#

Hello ๐Ÿ‘‹
The 1hr delay is expected with subscription invoices. The reason behind that is that the invoice stays in draft mode for an hour before finalizing.

If you want it to charge immediately, you can call the API and finalize the invoice manually
https://stripe.com/docs/api/invoices/finalize

frigid trench
#

Ok because otherwise the customer has to "wait" 1 hour until he can use his subscription which is painful

sour lily
#

Right, you can call the API endpoint above and finalize manually

frigid trench
#

Ok thank you so much we'll try just that

sour lily
#

NP! ๐Ÿ™‚ happy to help

frigid trench
#

Mmm it doesn't seem to work for us

#

What we want is the event "invoice.payment.succeed" to be fired at the same time as we create a subscription schedule

sour lily
#

even with manually finalizing, I don't think there's a way to trigger invoice.payment_succeeded at the same time subscription schedule is created.
https://stripe.com/docs/billing/invoices/subscription#:~:text=Create the subscription through,transitions to past_due

Can you provide a bit more context on why this event is important for your flow? An alternative I can think of is that you create a normal subscription first and once you receive invoice.payment_succeeded for the invoice then you attach it to the schedule instead.

https://stripe.com/docs/billing/subscriptions/subscription-schedules/use-cases#existing-subscription

frigid trench
#

Ok sur I'll try to explain in details. It's a little bit complex

#

So our customers can subscribe to PRO and BASIC plan for different kind of period : yearly and monthly.

#

A specific use case is a customer that would subscribe to a BASIC YEARLY subscription

#

so he paid for the whole year

#

and after few month of using the service, wants to have 1 month of PRO subscription

#

In order to do that, our way of modeling things with stripe (after several long dicussions with your colleagues) was to 1. Cut the Yearly Basic Subscription 2. Create a subscription schedule containing a PRO subscription for 1 Month followed by a Yearly subscription (the one he paid before, but we push back the end of this subscription by one month)

#

It's like we "paused" his yearly BASIC subscription

#

and when he finishes his PRO monthly subscription he's back to his BASIC subscription that he already paid with the same amount of days left

#

However, when the use click on the button 'buy a PRO monthly subscription' he needs to pay and have access to the feature immediatly

#

Hend the problem I describe with the 1h waiting time being annoying for our use case

#

Do you have any input?

sour lily
#

Gotcha. thinking..

#

Yeah the best way to go about this would be to call finalize invoice API as soon as you receive invoice.created for the subscription schedule.

#

TonyS-sub-schedule-immediate-payment

frigid trench
#

We tested this solution, sadly it does not seem to work. We tried this in req_Hw6GXkRQtYCpf1

#

The invoice stays "open"

sour lily
frigid trench
#

Ok so we should use pay endpoint in your opinion?

sour lily
#

Yeah that should force the payment on the invoice

frigid trench
#

Ok we'll have a look

#

thank you so much for your time!

#

Have a great day