#michamitus_api
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1298573006783905883
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- micha_schedule-invoice, 16 hours ago, 7 messages
- michamitus_api, 21 hours ago, 12 messages
- michamitus_api, 4 days ago, 22 messages
👋 happy to help
is that https://docs.stripe.com/invoicing/customize#invoice-numbering-schemes enough for you?
Unfortunately, no. There is a separate invoice system from which you get an invoice number and it must be set up based on that number
in that case you can simply update the invoice number https://docs.stripe.com/api/invoices/update#update_invoice-number by listening to the invoice.created webhookl event https://docs.stripe.com/billing/subscriptions/webhooks#understand
The process works well for second and subsequent payments, but I’m encountering an issue with the first invoice. When creating a subscription using a pre-existing explicit PaymentIntent, the system automatically generates and finalizes the Invoice object, leaving no option to edit it.
I also tried using ScheduleSubscription. While payments and subscriptions were handled correctly, the invoice remained open and wasn’t linked to the completed payment.
I’m wondering if there’s a better way to implement this.
When creating a subscription using a pre-existing explicit PaymentIntent
why are you integrating this way?
To prevent the creation of unpaid first invoices and because of the need to edit the invoice
how are you creating the subscription?
actually how are you collecting the payment for the first invoice?
For the first payment I used: PaymentIntent
Then I created a subscription
how are you integrating?
Using python stripe library
I meant on the front-end
are you using the PaymentElement?
Are you using the deferred flow?
I am still testing using the front end from the repo in the example: https://docs.stripe.com/payments/quickstart
I think you should consider the deferred flow for your case
and just create the subscription after collecting the PaymentMethod https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=subscription
Does this integration support the p24 (Przelewy24) option that has BLIK?
"""This integration path doesn’t support BLIK or pre-authorized debits that use the Automated Clearing Settlement System (ACSS)."""
what is " the p24 (Przelewy24) option that has BLIK" ? not familiar with that.
if it's like some "BLIK is actually inside/used in the P24 redirect" thing then I imagine it works fine, since it's abstracted as a type:"p24" PaymentMethod
Thanks
That what I meant
Correct me if I'm wrong, but in the example given there is no way to edit the invoice number. Is it not created and finalized right away with the subscription?
https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=subscription#create-intent
it is yes, the first invoice of a subscription always gets finalized immediaetly
it's a quirk and pain point that the first invoice works differently, as you've discovered
Is there a proper way to impement following scenario: Receive payment -> Create invoice marked as paid with custom number + start subscription
technically using a Schedule does work because for some reason Schedules create a draft invoice instead , but then it's a more complex integration. Should just work
like my colleague last night tried to help you with, it makes no sense to create your own PI, you should be using the Schedule->Subscription->latest_invoice->payment_intent->client_secret
I mean usually you create the Subscription and Invoice first, and then accept payment for the invoice, that's how it's designed
like if you want, a possible flow is
- create Schedule with start_date:now
- edit the schedule->subscription->latest_invoice to change the
number(since when using Schedules it will be a draft) - finalize the Invoice. Grab the invoice->payment_intent
- on the frontend, confirm the PaymentIntent with Elements
that would be a more normal/supported flow here
Alright, thanks a lot for the clarification. I will have to talk to the team if this is appropriate.
If this is not a sufficient solution, is it possible to merge the created PaymentIntent with the invoice?
no, you can't attach a pre-existing PI to an Invoice
Okay, thank you very much for your help!
One more question: Is it possible to modify subscription items after the invoice has been finalized, such as by creating newer invoice with updated items?
no
if you new items to the subscription those are reflected in future invoices basically.
Depending on what you're looking for here you probably want to build the flow such that you handle all this "editing a cart/picking items etc" in your own logic and only create the Subscription on Stripe at the very end of the flow
Alrigth, thanks a lot again:)