artooras
artooras

Reputation: 6805

Stripe subscription set billing date as first of each month

I'm using Stripe Checkout flow to collect the users' payment details and automatically collect the subscription. I have also implemented webhooks to listen to checkout.session.completed so that I can edit the subscription. What I want is as follows:

  1. Say, the user registers on January 15th. I'm using metered billing, so the user pays $0.00 on the first invoice.
  2. In webhooks, I apply a trial period of 7 days to the subscription like so stripe.subscriptions.update([id], {trial_end: [seven_days_into_future]}). So the billing anchor date on the subscription becomes the 22nd of each month.
  3. However, I would like to set the billing anchor date as the first day of each month. So I would like the user to receive the first invoice for January 22-31 (prorated), and then get invoices for full calendar months onwards.

How do I achieve that?

I cannot set the billing_cycle_anchor to the desired date because it accepts only now and unchanged values...

Upvotes: 1

Views: 1365

Answers (1)

toby
toby

Reputation: 622

If you're working with already created subscriptions, then you'll need to add trial periods to shift the billing_cycle_anchor: https://stripe.com/docs/billing/subscriptions/billing-cycle#using-a-trial-to-change-the-billing-cycle

If you know exactly how you want to structure your trial and billing_cycle_anchor at the time the subscription is being created, then you can future-date the billing_cycle_anchor during creation: https://stripe.com/docs/billing/subscriptions/billing-cycle#new-subscriptions

Upvotes: 0

Related Questions