#mehdi_code
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/1288618743936716904
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there
hmmm actually this code doesn't work how i expect either
No, there isn't a built in time function that's specific to the Stripe library
like ideally a 1 month trial starting on jan 31st would end the trial on feb 28th
Got it, you'll need to calculate this yourself and pass it as a timestamp value for trial_end or use trial_period_days
hmmmmm
i guess then if they start a trial on jan 31st
and i want to give them 1 free month
there is no way for their billing anchor to be the 31st of the month?
Have you looked at using billing_cycle_anchor ?https://docs.stripe.com/billing/subscriptions/billing-cycle
hmmm not sure that would solve it but it's okay, we switched to using 30 days for a free trial
I have a different question about the subscription creation endpoint
if I specify a discount, then the customer's discount will not be applied. Is there a way to prevent the customer's discount from being applied even if I don't specify a discount?
hi there! ๐ taking over for my colleague
If you're creating a Subscription for a Customer that has a coupon on the Customer and you don't want that coupon to be used, then you would need to remove the coupon from the Customer via an update: https://docs.stripe.com/api/customers/update#update_customer-coupon