#TonyS-sub-schedule-immediate-payment
1 messages ยท Page 1 of 1 (latest)
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
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ok because otherwise the customer has to "wait" 1 hour until he can use his subscription which is painful
Right, you can call the API endpoint above and finalize manually
Ok thank you so much we'll try just that
NP! ๐ happy to help
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
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
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?
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
We tested this solution, sadly it does not seem to work. We tried this in req_Hw6GXkRQtYCpf1
The invoice stays "open"
huh it should attempt to charge the payment method once finalized. Can you try calling the Pay an invoice endpoint?
https://stripe.com/docs/api/invoices/pay
Ok so we should use pay endpoint in your opinion?
Yeah that should force the payment on the invoice