#just_invoice-draft
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/1286002879785730220
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello
On my website, subscriptions are for 30 days but Stripe offers options for recurring payments every 1, 7, or 31 days. So it is available just after 1 day of the subscription on my site. What do you suggest? What can we do in your API?
Hello! You can create a recurring Price with interval set to day and interval_count set to 30 and use that to create a 30 day Subscription: https://docs.stripe.com/api/prices/create#create_price-recurring
There is a section called "Subscriptions" on the Stripe dashboard. I am referring to that. Automatic card payments can be made through the API, but I have a timing issue. The timezone on my website does not match the one on your API, causing the Subscription to end on my site. Customers are complaining.
Isn't there anything to trigger Manuel?
We can't help much with the Dashboard here, this server is for developer help with code/the API/webhooks/etc.
For the timing issue, though, what specifically is the issue that's causing your customers to complain?
Yes, I also need help with the API.
I am currently using this API to see the time but it is not working.
const subscription = await stripe.subscriptions.retrieve(sub_id);
When you say it's not working what do you mean? Are you getting an error?
There is a timer in the database on my server.
If you have a 30-day subscription, it expires in 30 days and the subscription is deleted.
but if the customer activates automatic payment through a 30-day Stripe card
We expect an API from Stripe. Unfortunately, the timer in my database expires early because Stripe's Webhook timer is not the same. I need to find out when Stripe will send the webhook.
Which specific Stripe Event type are you keying off of?
We received a webhook from Stripe after 30 days, but the subscription on our website had already expired. Even if we take the customer's money, the subscription was not successfully renewed. I need help with this issue.
1 sec
Right. What Event type are you using for this?
const session = await stripe.checkout.sessions.create({```
No, which of the Event types listed here are you using for this? https://docs.stripe.com/billing/subscriptions/overview#subscription-events
That's not an Event type, that's an API endpoint to create a Checkout Session.
You have a Webhook Endpoint set up to listen for some kind of Subscription Event(s). You're asking about how to predict when you receive those Event(s). I can't answer your question unless I know what Event types your Webhook Endpoint is listening for.
For example, are you using invoice.paid for this? Are you using customer.subscription.updated? Something else? A combination?
yes
Okay, so you're expecting the invoice.payment_succeeded Event to arrive before the timer on your end runs out, correct?
Yes, I need to know at what time and in which timezone this webhook call will come.
Is this possible?
Not exactly, no. Webhook don't have predictable delivery times due to the nature of how the internet works. There might be network issues that cause delays and retries before they actually arrive.
I recommend you don't use the timer approach at all.
Instead, you should rely on listening for webhooks to update the status of Subscriptions on your end.
Right now you're only listening for payment success, but you can also listen for payment failures and other events and act accordingly instead of using a timer.
hmmm
also this?
const subscription = await stripe.subscriptions.retrieve(sub_id);
subscription.current_period_end
current_period_end
Isn't this time frame the date when the next payment will be taken?
That's when the current Subscription period ends. Payment happens a bit after that depending on various factors.
Typicaly we give you an hour to modify the Invoice for that payment before we move forward, for example.
It seems a bit complicated, I will think of some solutions for this.
just_invoice-draft
Hello
check please.
check please what? My colleague was already working with you and explained what you needed