#naeem-ullah-khan_docs
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1331939966736928858
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there!
Hi
so you want the first 14 days to be a trial, and then the next invoice to always be created on the 1st of the month?
Basically I want to provide a 14 days trial on subscription creation and set billing anchor to 1st date of each month. In my current case if I'm creating a subscription today (23 January) then I should have a trial period till 6th February then I should be charged for remaining days of February. After this every invoice should be created on 1st date of next coming months at normal rate
yep. and have you tried using billing_cycle_anchor_config for this? https://docs.stripe.com/billing/subscriptions/billing-cycle#use-billing_cycle_anchor_config
Let me try this and get back to you
This seems to work. Thank you
happy to help ๐
One more question
sure
Is there any additional key available in subscription creation to check if the user is retrying for subscription then I don't provide him a trial period
no, that's something you'll need to check on your end
In that case the user will be charge at the moment instead of providing a trial. I want to reuse the same API for both cases
you need to check that on your end, and then make one API call with a free trial, or an API call without a free trial.
What would be the best practice at our end in this case, shall we keep a specific status or the trial date in our database?
To check whether the user is trying the subscription for the first time or retrying for the payment after his free trial
you can list all subscriptions for a specific customer with https://docs.stripe.com/api/subscriptions/list.
How can this help find out whether I should give the user free trial or not?
I thought that you wanted to check if the customer already started a subscription, and if so not provide a free trial.
but maybe I missunderstood your question?
๐ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
Hi, actually I have to handle two scenarios in my app. First, user creates a new subscription in which I provide user a 14 days trial period. Second, if due to some reason user's next payment for the subscription isn't successful then the user will retry for the subscription then I don't want to provide a trial and get the payment from the user at the moment. I want to handle both situations in a single API so can you please suggest a best practice to handle this situation in single API
you can apply all the logic that you want within your own API and handle providing trial period days or not based on your own logic