#jasonkuhrt
1 messages ยท Page 1 of 1 (latest)
That is the expected behavior and is unfortunately not changable for those price types. I will see if there is something you can so so the fixed prices also get billed at the end of the month and will get back to you
@cobalt kestrel a solution would be impactable for us, thank you!
So, with metered prices you can set a fixed amount on them that will be charged at the end of the month
So a potential workaround could be that you make a metered Price with a fixed component and then never report usage on that specific Price
Interesting
Or you could roll your two prices together, have one metered Price with a base fixed amount
What happens with proration?
Was actually about to mention that I need to test that
Say user X subscribes on September 10, I would like the end of month invoice to discount the fixed amount by 10 days' worth.
Can you link me to the docs about how to have a metered price also have a fixed amount? I don't see that here for example https://stripe.com/docs/api/prices/create
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
You would define it as flat_amount_decimal in the tiers for the price https://stripe.com/docs/api/prices/object#price_object-tiers-flat_amount_decimal
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Apologies had trouble finding that. Am testing the proration angle of this and will get back to you.
Ah thanks, I wasn't looking within the tiers part, makese sense.
Yeah, apologies, I forgot that out standard pricing model does not offer a way to do flat fee + metered usage. So it looks like the way to do this may be to have a one-tiered metered usage price
I'm using test clocks to understand how proration will work here.
Ok, it appears that proration did not kick in for the fixed amount of the metered tiered price ๐ฆ
Also, I still see an invoice for $0 being created at the time of subscription. would that invoice be sent to the user, then?
๐ stepping in here as Pompey needs to step away
Can you share the Subscription ID you just tested with?
Sure, it is sub_1Nv0BtBWPPbeYrcc6xm1QGTG
Yes, that gets us to the original message of this thread.
Oh, maybe you mean tiered, but not metered. Will try...
Yeah sorry I should have clarified
What you likely want to do here is wait until after the Subscription starts to attach the licensed Price
So basically you just don't have it affect the initial Invoice
Then it is on every following Invoice for the previous period
A licensed price does not solve the issue since as you can see Stripe still will charge at the moment the subscription begins:
Oh, I'll try that
Yeah sorry, I jumped in and missed part of your initial question
But I think doing the above is the best
Just when you add the new Price you should turn off proration
@rustic copper it seems that the test clock does not simulate if an email will have been sent or not to a customer.
When the subscription begins, it still creates an invoice for $0, would that lead to an email invoice being sent to the customer for $0? I assume it would. We would prefer it not to. But later, upon each cycle, an email for the invoice should always be sent, even if it is $0.
If the Subscription is a send_invoice collection_method then yes it will
If charge_automatically then no
If you do want to send Invoices in the future then just change the collection_method on your update when you add the licensed Price
I'm confused about what I'm seeing here when adjusting the subscription as you mentioned to do.
- Why if I select proration does the bill for dec 1 increase from $1 to $1.94? I would have expected $0.94 or something (something below 1).
Because that is the amount that will be tacked onto the next Invoice
It is the amount for the remainder of the period plus the amount for the next period
Then that leads to invoices which are charging the user across multiple periods. This is something we're trying to avoid.
Regarding emails, I understand the differences surrounding collection_method. What I'm referring to is the Stripe account level email settings that allow sending email receipts. It seems that Stripe test clocks do not factor in this aspect. Is that correect?
So far the approach that has worked best is metered prices that have fixed amounts.
The downside to this is that proratioin has no effect on fixed amount.
However, maybe there is a way to calculate proration ourselves, and then, on a specific invoice, decrease its cost manually?
We don't send receipts in test mode
But no, we would not send a $0 receipt
Since there is no receipt technically
Becuase no PaymentIntent/Charge is generated here
Yeah if you want to handle calculating this yourself then you can use Invoice Items to decrease cost manually: https://stripe.com/docs/api/invoiceitems/create#create_invoiceitem-amount
The problem I see with invoice item is that we'll need to work with Stripe webhooks to capture generated invoices, then adjust the amounts, which will require keepings state about how to prorate.
Could another approach be to use coupons attached to the initially created subscription for an amount equal to the proration we want to manually calculate?
Hmm let's discuss the first part first.
How are the updates going to occur?
Like I assume the customer comes on your website and clicks something indicating they want to update, yes?
I'm not sure what you mean by update.
The customer would come to our website and purchase a plan subscription.
So there will be a new subscription.
The whole concern here is about proration on Subscription updates, right?
With a metered tiered price with a fixed amount added to a subscription at create time we noticed that the Stripe concept of proration does not apply (I don't know why, my intuition is that it should ๐คท๐ปโโ๏ธ).
Make sense?
I am not seeing the need for a subscription update right now.
Oh becuase you are setting a future billing_cycle_anchor
Sorry, missed that piece
So still,
The problem I see with invoice item is that we'll need to work with Stripe webhooks to capture generated invoices, then adjust the amounts, which will require keepings state about how to prorate.
I'm a bit confused here. Don't you just calculate the proration amount and then add an invoice immediately after the creation and then it is picked up by the following Invoice that is generated when the BCA is reached?
Why do you have to deal with keeping state?
I don't understand this part:
add an invoice immediately after the creation and then it is picked up by the following Invoice
Are you familiar with how Invoice Items work?
Your Invoices are made up of Invoice Items. The Subscription will create them for you based on its Price(s). But you could also create your own custom ones via the Invoice Item API: https://stripe.com/docs/api/invoiceitems/create
If you create an Invoice Item and associate it to a Subscription using the subscription parameter (https://stripe.com/docs/api/invoiceitems/create#create_invoiceitem-subscription) then the next Invoice for the Subscription will include that Invoice Item
I am not yet familiar with the invoice items part of the api
So basically you could calculate the proration that you want here immediately upon creating the Subscription and add it to then be picked up with the next Invoice
That sounds to me like what you are looking for, no?
That sounds good. Am I to understand then that it is possible for an invoice item to have a negative value?
Nice, this is great for the create subscription case. I currently don't see an issue then.
To confirm: I would use this endpoint https://stripe.com/docs/api/invoiceitems/create and attached the just-created-subscription to it via the subscription payload property. Right?
Hello! I'm taking over and catching up...
Yep
I've got to step away but I'd recommend running a quick test to see if it is what you want