#daniel_api

1 messages ¡ Page 1 of 1 (latest)

severe sphinxBOT
#

👋 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/1338926570777350156

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

short narwhal
#

Oh and I want to give the free access only for a month and it cancels if the user doesnt add the payment method later

deft hornet
short narwhal
#

I dont want to give a trial cuz we saled 10 licences to a school and we need to give 10 users access without asking them for a payment method

So it is not a trial it is a normal subscription

#

are you still with me?

#

@deft hornet ?

#

?

#

?

deft hornet
#

Sorry

#

One sec.

#

The use case you described - "I want to give the free access only for a month and it cancels if the user doesnt add the payment method later" - is exactly what a trial is for.

#

Wait, are you just saying "I will invoice you, but if you don't pay before your next invoice, I will cancel your service" ...?

short narwhal
#

no Like a school paid for 10 subscriptions so I need to give those subscriptions to those people without asking them for payment methods

But if they like Cogent they can add a payment method later and continue the subscription after a month

#

So a school already paid for those 10 subscrtiptions for a month

#

and if users want to continue after a month they need to start paying

deft hornet
#

You can have Stripe email the Invoice to the customer for payment.

#

That way there's an active Subscripton, and an outstanding Invoice.

short narwhal
#

yes yes but this is for future to collect the payment method for the next months

But I need to give a subscription to 10 users with api, but when I checked a user need to have a payment method to add a subscription to it

But the user doesnt have a subscription method and that is okay for me cuz the first month for the user is free cuz the school paid for it

deft hornet
#

It's in the docs - jsut give them a read.

short narwhal
#

You mean this?

#

But that doesnt make sense cuz stripe doesnty know what user has the invoice that has beed paid by the school

deft hornet
#

I don't understand what that means.

short narwhal
#

The thing I want to do is

I have a user named John

I want to give John a subscription for free for a month without asking him

Using api

#

there is no invoice sent to John

deft hornet
#

Then just don't create the Subscription in Stripe until after that month. Stripe Billing uses Invoices to model payments.

You're also going to have to figure out how to link up the data in Stripe with the data in your application to make the "who paid" connection.

severe sphinxBOT
short narwhal
#

I want to create a subscription on stripe becaus I want stripe to track when the month passed

#

So I just want to give a user a subscription for free (0$ so he shouldn't need any payment info to pay)

deft hornet
#

You have two options:

#

Wait, NEVER pay anything?

short narwhal
#

no just for the first month

#

and than 3.99$

deft hornet
#

That's what trials are for.

short narwhal
#

and if the user dosnt add a subscription it cancels (Like usual stripe subscription)

deft hornet
#

That's what trials are for.

short narwhal
deft hornet
#

That is one thing that trials can be used for; this is another.

#

You could also likely use a discount, wait one.

short narwhal
#

okay so If I give the user a trial and they update their payment method

Will they get this email later

deft hornet
short narwhal
#

How can I apply the coupon without redirecting the user to a checkout page.

I want the user to just log in and if it is on a list of users that should get the first month off, the user automaticaly recives it with no need to go to a checkout page and put a discount code

severe sphinxBOT
bleak plinth
#

fyi i'm stepping in for my colleague as he has to run, catching up on the thread now

short narwhal
#

no problem

#

take your time

bleak plinth
#

ok, so if you want to just give users access to the subscription before making them visit a checkout page you can just create a subscription for them via the API and include the 1 month trial in the creation call
https://docs.stripe.com/api/subscriptions/create

short narwhal
#

can I instead of a trrial apply a discount code? like 100% once?

bleak plinth
#

yep! that should work too

#

also fyi there are a lot of open threads so i might be a little slow getting back to you

short narwhal
#

if a subscription renewal fails cuz the user dosen't have a payment method, will there be an email sent to that user to add a payment method?

bleak plinth
#

if you set collection_method to send_invoice then we automatically email customers with the invoice every time. but if you're using charge_automatically you need to set up webhook event listeners and handle failed payments due to lack of payment method etc yourself

short narwhal
#

okay thanks

#

that is all

#

have a nice day