#naeem-ullah-khan_docs

1 messages ยท Page 1 of 1 (latest)

karmic roverBOT
#

๐Ÿ‘‹ 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.

feral badger
#

hi there!

mystic wharf
#

Hi

feral badger
#

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?

mystic wharf
#

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

feral badger
mystic wharf
#

Let me try this and get back to you

mystic wharf
#

This seems to work. Thank you

feral badger
#

happy to help ๐Ÿ™‚

mystic wharf
#

One more question

feral badger
#

sure

mystic wharf
#

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

feral badger
#

no, that's something you'll need to check on your end

mystic wharf
#

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

feral badger
#

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.

mystic wharf
#

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

feral badger
mystic wharf
#

How can this help find out whether I should give the user free trial or not?

karmic roverBOT
feral badger
#

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?

brittle kestrel
#

๐Ÿ‘‹ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

mystic wharf
#

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

brittle kestrel
#

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