#sarvesh3742
1 messages · Page 1 of 1 (latest)
Hi, need to some help in php based subscriptions management
we want to create subscription to be setup 1st of each month.
So suppose user is subscribing to 10th or 15th of a month, on 1st of next month we want to charge him for 20 or 15 days only and his monthly billing cycle will start from 1st of each month
how to manage this senario
we are using php subscription apis
yes that's possible using this paramter: https://stripe.com/docs/api/subscriptions/create#create_subscription-billing_cycle_anchor
Note that we recommend setting billing_cycle_anchor based on the UTC time, and not exactly at 00:00, but something like 3 or 4 am, to make sure the Subscription will always renew at the beginning of the month.
and to test this, you can use Test Clocks: https://stripe.com/docs/billing/testing/test-clocks
ok, I will check these details
but few more question,
- suppose user is subscribing on 7th Dec (today) and plan price is say $100 so we need to calculate the per day price from plan price and send to Stripe for the all days which is going to use the appilcation until 1st of Jan?
- this is done automativally by Stripe when using
billing_cycle_anchor
- On the day of subscription (7th Dec) Stripe will charge the payment from user for remaining days of month or it will charge on 1st of Jan for last month? how the cycle will run?
- Stripe will charge the payment from user for remaining days of month
ok, so it will happen on 1st day of the month only and not on the subscription day right?
so 23 days is kind of free to use period for the user and payment will be charge on 1st of next month
so 23 days is kind of free to use period for the user and payment will be charge on 1st of next month
no, sorry if I wasn't clear. the use will pay exactly for 23 days.
but again, I recommend testing all of this in test mode with Test Clock to better understand how this works
ok, fine , thank you, will go through implmentation and ask queries if any
Happy to help 🙂
last point, as user is subscribing on 7th dec but actually his payment will heppen on 1st of next month, even though the webhook will send us status paid how to grant access to user to use application with all features from subscription plan he choose?
but actually his payment will heppen on 1st of next month
that's not how it works by default. so it means you added a free trial to the user?
if he subscribes on the 7th, they will pay on the 7th for the ~23days reamining in the month
ok so payment will charge on 7th itself for next 23 days of the month, got it
yes, that's how billing_cycle_anchor works by default
which webhook and field to use to identify that payment is paid and grant access to user and send notification email
?
I recommend reading this: https://stripe.com/docs/billing/subscriptions/webhooks