#julian_best-practices

1 messages ยท Page 1 of 1 (latest)

zenith parcelBOT
#

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

proud ploverBOT
limpid seal
dapper bane
#

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"?

limpid seal
#

I don't believe so.

#

I think instead you would need to avoid using Subscriptions and create your own Invoice Items and Invoices instead.

zenith parcelBOT
dapper bane
#

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

hexed crescent
#

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.

dapper bane
#

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!

hexed crescent
#

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. ๐Ÿ™‚

dapper bane
#

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?

hexed crescent
#

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.

dapper bane
#

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?

hexed crescent
dapper bane
#

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?

hexed crescent
#

I don't believe so, no. Proration is kind of it's own special thing.

dapper bane
#

Sweet, I'll run with this

Cheers Rubeus!