#do0ks

1 messages · Page 1 of 1 (latest)

pure wagonBOT
placid finch
#

Hi, let me help you with this.

#
  1. I am not sure what you mean in this question. Manage what exactly?
  2. Yes, that seems to be a good approach.
mint tapir
#

1 - I mean I can use a previously created product (subscription) in Stripe itself with this method:
await stripe.checkout.sessions.create({
mode: "subscription", .... })
Or I could create the subscription with await stripe.subscriptions.create({ ... })

#

2 - Thank you for that, the next question is, how can I know when to query the service that returns the usage fee before the subscription charges the user to include both (suscbirption and fee)?

placid finch
placid finch
#

Actually, a correction from earlier, it's better to update an individual monthly Invoice instead of the Subscription, given you make this decision every month.

mint tapir
placid finch
#

Nice. It only matters for the initial Payment Method collection. Afterwards, you will get the same Subscription object, regardless of whether you used Checkout or not.

mint tapir
placid finch
#

When the Subscription is active, you will receive the invoice.created event every month, before the the Subscription is renewed. You can take the ID of the newly created Invoice and create a one-time Invoice Item for your fee: https://stripe.com/docs/api/invoiceitems/create

#

Then, in about an hour, the new Invoice will be finalized and the customer will be charged for the normal monthly price, plus the added fee.
Next month the process repeats.

mint tapir
#

Nice. Thank you very much! I will try this approach! Thanks Vanya, very kind of you

placid finch
#

Happy to help.

pure wagonBOT