#sameer.kumar

1 messages · Page 1 of 1 (latest)

trim pondBOT
brittle moon
#

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.

glad jay
#

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

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

glad jay
#

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)

brittle moon
glad jay
#

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.

brittle moon
#

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.

glad jay
#

requirement is this: Flat fee - start of the month, Metered Fee - End of the month (or whenever, we don't care)

brittle moon
#

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.

brittle moon
#

I'd suggest trying the option I suggested and doing some testing and experimentation

glad jay
#

Understood

brittle moon
glad jay
#

Thanks