#sameer.kumar
1 messages · Page 1 of 1 (latest)
you could pass a one-time Price for the amount of the flat fee, in addition to the metered Price, in the line_items for the CheckoutSession.
can I get an example?
Ok, but the subscription would be metered, right? The flat fee won't deducted at the start of each month, but at the end.
@brittle moon
const session = await stripe.checkout.sessions.create({
success_url: 'https://example.com/success',
line_items: [
{price: 'price_1O1pjLJoUivz182DEmOScLIG'}, // metered
{price: 'price_1NYVyRJoUivz182DITZjn6S1', quantity:1}, // non-recurring price
],
mode: 'subscription',
});
The flat fee won't deducted at the start of each month, but at the end.
yes
If I want to achieve the aforementioned, is there a way to have it done with one pricing model? Or do I must create two different?
1 subscription where a set fee is charged every month at the start and a usage-based fee is charged when the usage is past a certain limit (I can handle whent to add the usage data, no worries there)
the best way I know how to do this is what I described, use a one-off Price for the flat amount upfront
The problem, is that the one-off price is only deducted once. I want both the things present.
Which is achieved with tiered billing scheme, but the flat-rate is deducted at the end with the metered usage.
yes
so you use the one-off price for the first payment(when the subscription is created), and then every month after that the flat fee will happen instead, and it just works.
requirement is this: Flat fee - start of the month, Metered Fee - End of the month (or whenever, we don't care)
you use the one-off price to effectively charge the flat fee at the start, since a metered Price on its own will only charge that the end of a billing period.
well that's not possible really since our metered Prices are designed to charge in arrears.
I'd suggest trying the option I suggested and doing some testing and experimentation
Understood
Thanks