Reputation: 459
I want to do stripe monthly subscription with these conditions
for example, user registered August 10th
how can I configure this? I want to know the configuration for stripe.checkout.sessions
Upvotes: 0
Views: 852
Reputation: 7459
In general, you would achieve exactly what you seek by setting the billing cycle anchor on the 1st of the next month and allow a prorated invoice to be generated for the partial period until then: https://stripe.com/docs/billing/subscriptions/billing-cycle#new-subscriptions
However, this option for the Subscription create API is not available via Checkout: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-subscription_data
You could achieve a similar result by setting subcription_data[trial_end]
to be the 1st of the next month to effectively set the billing anchor then:
https://stripe.com/docs/billing/subscriptions/billing-cycle#using-a-trial-to-change-the-billing-cycle
You'll need to calculate your own prorated amount for the first month, and then add a one-time Price in the line_items
alongside the recurring Price to add the prorated amount to the first invoice only:
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items
Upvotes: 1