#angelctc_best-practices

1 messages ยท Page 1 of 1 (latest)

shut acornBOT
#

๐Ÿ‘‹ 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.

warm wind
#

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?

vast ingot
#

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

warm wind
#

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 :

Learn to use webhooks to receive notifications of subscription activity.

Create and manage subscriptions to accept recurring payments.

Build an integration where you can render the Payment Element prior to creating a PaymentIntent or SetupIntent.

Learn how to move Billing objects through time in test mode.

vast ingot
#

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.

warm wind
#

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.

vast ingot
#

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?

warm wind
vast ingot
#

stripe invoices upcoming --customer=cus_QBhnYw77jl6ByW

warm wind
#

the request id looks like req_xxx

vast ingot
#

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

warm wind
#

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

vast ingot
#

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?

warm wind
#

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

vast ingot
#

If I build m own billing logic, does it mean I can't use the stripe checkout and customer portal to manage subscription?

warm wind
#

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

vast ingot
#

Is the payment system correlated to the invoice system?
ie. can I have a payment record without a invoice?

warm wind
#

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

vast ingot
#

How do I create a charge without an invoice?

warm wind
vast ingot
#

Does it work with recurring payments?

warm wind
#

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

vast ingot
#

Yes, that's what i'm thinking of. Thanks !

warm wind
vast ingot
#

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.

warm wind
#

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

vast ingot
#

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?

warm wind
#

yep, feel free to reach out again if you need more help

vast ingot
#

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

warm wind
#

No, that's not possible.

vast ingot
#

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?

warm wind
#

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

vast ingot
#

Yea I think that's what we need