#julian_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/1296131329037176894
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi ๐ Subscription Invoices are for the next billing period, unless you're using a metered price in which case they bill in arrears:
https://docs.stripe.com/billing/subscriptions/usage-based
Hi @limpid seal thank you.
I evaluated Usage-based billing but ran into a blocker given the quantities needing to be an integer in the Meter and MeterEvents and the product needing to show in the Inovice as a "Monthly" product.
Since the product quantity should reflect a monthly product, I would not be able to imitate proration if a subscription started mid month as the value would have to be an integer.
Is there an alternative that would allow me to do this without changing the unit to be something like "daily"?
I don't believe so.
I think instead you would need to avoid using Subscriptions and create your own Invoice Items and Invoices instead.
When creating an Invoice Item you can manually specify the period that it is for:
https://docs.stripe.com/api/invoiceitems/create#create_invoiceitem-period
Yes, I was fearing imitating the Subscription in-house would be the solution.
In the https://docs.stripe.com/api/invoiceitems/create#create_invoiceitem-period DOCS the following is stated
period | object
The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have Stripe Revenue Recognition enabled, the period will be used to recognize and defer revenue. See the Revenue Recognition documentation for details.
I found this https://docs.stripe.com/revenue-recognition/methodology/subscriptions-and-invoicing
If I understood this correctly could I do the following?
- Create a Product with a Monthly Billing Period and Price $100/month
- Wait for the 1st of November to run a cron
- Create an Invoice Item with the Period between the 15th of October and 31st of October
- The invoice would automatically handle the "partial" cost of the monthly price between the 15th and the 31st of October (Similar to Proration on Subscriptions)
On the next billing cycle I would do the same but hypothetically the value would be full because the full monthly period was provided
Hello! I'm taking over and catching up...
That seems like it's worth a try in test mode to see if it will suit your needs, yeah.
Great, will do. Should I update this thread with the outcome?
Thank you for the very prompt and helpful support. I've been running around in circles for a while ๐ฅด .
Cheers!
You can if you wish, it's up to you and if you have more questions or not.
Also note that we close idle threads, but you're always welcome to create a new thread if you have more questions later and this thread is closed. ๐
I just tried the approach above in the Test Dashboard and the following happened:
- When creating the invoice, the Price could not be a Price with an Interval and had to be a "One-time" price which was created at that point
- I could attach a "Supply date" from Oct 1 to Oct 2
- The Invoice was generated with the item and the time period in the same visual format as a proration in a subscription
- Price still showed up as $90 USD
Is this a reasonable test or did I miss something?
Ah, I think I misunderstood what you were describing. Recurring prices must be used with Subscriptions. One-off Invoices only support one-time payments.
Essentially what was suggested above is that you build the custom subscription logic you need on your end, then use Stripe for the payments piece. It might make sense to create one-off Invoices for each of your own custom subscription periods, or it might make sense to also implement your own custom invoices and only use Stripe for the low-level payment piece by using Payment Intents.
Got it got it. If I go the route of One-off invoices, is there a way to not have the Prices get appended to the Product catalog with any price that is new?
A Price is required, but you can use price_data to generate one when you create the Invoice Item, and the Price created from the data you provide won't show up in the Dashboard: https://docs.stripe.com/api/invoiceitems/create#create_invoiceitem-price_data
Woah great to know about the price_data not adding it to the Dashboard!
As a follow up question, out of curiosity, is price_data what proration in the Subscription uses?
I don't believe so, no. Proration is kind of it's own special thing.
Sweet, I'll run with this
Cheers Rubeus!