javed iqbal
javed iqbal

Reputation: 35

How to Implement Custom Monthly Subscription Billing Cycle Ending on Last Day of Current Month in Stripe?

I am working on implementing a custom monthly subscription billing cycle in Stripe in Node js, and I have a specific requirement that the user's first subscription period should always end on the last day of the current month, regardless of when the user actually subscribes. Here's the scenario I need help with:

Let's say a user subscribes on the 20th of April. In this case, I want their first subscription period to end on the 30th of April, aligning with the end of the current month. Then, the second subscription period should start from the 1st of May.

I am looking for guidance on how to achieve this using Stripe's API or any other custom logic within my application. I prefer not to rely on trial periods for this implementation.

Could someone provide insights on how to set up such a billing cycle within Stripe or suggest any alternative methods to achieve this functionality ?

I have stripe payment links that the users can copy paste so when the user pay the subscription is also created so before the subscription creation i want to apply some logic that the subscription period should end on last date of current month.

Upvotes: 0

Views: 187

Answers (1)

Lucky2501
Lucky2501

Reputation: 1704

This is not possible with Payment Links - it's out of scope for how basic that feature is.

More complex from Payment Links is Stripe Checkout, which requires server-side implementation.
You can achieve what you want with Stripe Checkout by determining the last day of the month in Unix time and setting it as subscription_data.billing_cycle_anchor (ref).

More complex from Stripe Checkout is direct Subscriptions, which requires server-side implementation + for you to collect the payment method (in a variety of ways).
Stripe actually just released a really cool billing_cycle_config object (ref), which allows you to set a day of the month you want the Subscription to bill next instead of having to calculate a Unix timecode.

Upvotes: 1

Related Questions