#angelctc_best-practices
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/1245180947301666859
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hello! Sorry, I'm not sure I understand, what do you mean by After the consolidated invoice is paid, we need to handle the individual subscription invoices to prevent double-charging the customer. Can you elaborate on that?
Yes, so our company is SaaS, and for each account, it might have multple client with different subscription. For us, we want to only bill that account once a month for all the subscription that share the same billing cycle.
So our goal is to greate a single invoice for all subscription.
Our customer paid that single invoice that contain all the subscription item
Once that invoice is paid, it mean all the corrleated subscrption also been paid.
Therefor, we need to manage the independent invoice per subscirption into some sort of status so we don't double charge our customer
What you mean by multiple subscriptions are likely just multiple Prices. Yes, that's possible to have multiple Prices on the same Subscription. I still don't quite understand what you mean by handling the individual subscription / invoice to prevent double-charging the customer though. For context, Stripe handles collection of the recurring payment on your behalf with Subscriptions so I'm not too sure where or why you would have double charges.
If you want to save the invoice details to your database, you can do so using the invoice.paid webhooks.
Some links that you may find useful :
- https://docs.stripe.com/billing/subscriptions/webhooks
- https://docs.stripe.com/billing/subscriptions/build-subscriptions or https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=subscription
- In case you haven't seen this yet, you can use test clocks to mimic the passing of time : https://stripe.com/docs/billing/testing/test-clocks
Build an integration where you can render the Payment Element prior to creating a PaymentIntent or SetupIntent.
Some other context:
The reason why we dont' want to group those subscription into 1 subscription is because we want to allow our account owner to have control over each client subscription, so that can upgrade and cancel subscription per client base.
ah I see, now I understand what you want by when you say one invoice for multiple subscriptions. No, this isn't possible. Each subscription will generate it's own invoice.
Okay, so I got some other question, can I create a invoice without subscription attached to that invoice?
I got 2 subscription that share the same biling cycle, however, when I get the upcoming invoice, it only return 1 of the invoice for 1 subscription, why's that
what event should I listen for in-order to get all the draft invoice?
can you share the request id [0] for the request you made to get the upcoming invoice? it'd look like req_xxx
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
stripe invoices upcoming --customer=cus_QBhnYw77jl6ByW
the request id looks like req_xxx
req_DAJlLZgkTeJQzC
So if you check the customer, it have 2 subscription with same billing date, so I would thought using invoices upcoming will return me 2 invoice
ah, no it doesn't work that way. Upcoming invoice is for a single invoice. If you want to view all of the upcoming invoices for each subscription, you will need to implement a loop to loop through each of the customer's subscription : https://docs.stripe.com/api/invoices/upcoming#upcoming_invoice-subscription
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Oh I see, thanks for clarify that
Is it possible to charege the client once for multiple invoice ? So let's say a customer with 3 invoice, each invoice is $50, isntead of charge that customer $50 three time, can we charge them $150 and settle that 3 invoice?
To be clear, what you want is not possible with Stripe Billing (i.e. the Subscriptions API). If you want to build your own billing (subscriptions) logic, and only use Stripe to invoice the customer (i.e. the Invoice API), what you want is possible
If I build m own billing logic, does it mean I can't use the stripe checkout and customer portal to manage subscription?
if you build your own billing logic, you can't use the customer portal. You could use maybe Stripe Checkout for the first payment. But subsequent recurring payments would require you to charge the customers either by creating a PaymentIntent, or using the Invoices API
Is the payment system correlated to the invoice system?
ie. can I have a payment record without a invoice?
sure, you can have a payment record without an invoice also
i assumed that your customers would want an invoice, but if your app / customers doesn't need it, then you don't have to have an invoice
How do I create a charge without an invoice?
you can take a look at this guide : https://docs.stripe.com/payments/accept-a-payment
Does it work with recurring payments?
If you are not using Stripe's Subscriptions API, it's up to you to implement the logic for when (i.e. exact date and time) to charge the customer
you can charge the customer off-session with a saved payment method if that's what you're asking : https://docs.stripe.com/payments/save-and-reuse?platform=web&ui=elements#charge-saved-payment-method
Yes, that's what i'm thinking of. Thanks !
actually, slight correction, you'll want to refer to https://docs.stripe.com/payments/save-during-payment instead since you need to save the payment method during payment so that you can charge it in the future
Okay here's my thought, what do you think if :
I keep Multiple subscriptions for a customer.
When those subscription generated a draft invoice.
I will collect all those invoice and create a new invoice that contain those invoice line item inside
Charge customer one-time with that one off invoice
then once that invoice is paid, I mark all thos orginial invoice as paid.
you can try it out and see if that works for you
your original use case isn't supported, so it's pretty awkward to do it like what you've described, but you can try it out
Yea, it's a pretty complicated case, wish we can just charge them per subscription too ๐
Thank you for your help, is it possible I come back here if i get any issue related to my approach in the future?
yep, feel free to reach out again if you need more help
Can I creaet a customer portal session with only 1 subscription in it. Even though the custoemr have 2 sbuscription?
The gaol is that it will be easier to track the invoice per subscription inside the portal
No, that's not possible.
So customer portal must show all the sbuscription? It's really hard to find which invoices is for which subscription tho. Is there a better way to navigate that?
yep, customer portal will show all the subscriptions. I don't know what you mean by if there is a better way to "navigate" that. There's no workaround for this. The only option is to build your own subscription management UI
Yea I think that's what we need