#aabhaskarma_api
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/1282653297446096948
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Could you please share the event Id invoice.upcoming that's being triggered immediatly ?
Between the invoice in_1Px4tYF8tiMhHfPbjM4zNgov is for the trial period.
I cannot find such an event in https://dashboard.stripe.com/test/customers/cus_QoiKK4OUPHHFTW
But here is the captured payload.
I invite to retry the test again, track the eventId and please share it with us.
Trying
There was an error in our code. I just fixed it. But the question is if I set days_until_due=7 and trial_period_days=7, how many days did the user account active? 7 or 14 days?
const subscription = await stripe.subscriptions.create({
customer: req.body.customerId,
collection_method: "send_invoice",
payment_behavior: "allow_incomplete",
** days_until_due: "7",**
** trial_period_days: 7,**
items: [{ price: price }],
automatic_tax: { enabled: true },
});
How can I achieve trial=7 and due=7, total=14 days? And avoid sending email upcoming invoices to that user after 7 days.
FYI: We are sending the upcoming invoice 7 days before.
And avoid sending email upcoming invoices to that user after 7 days.
Isn't it what you're trying to achieve?
days_until_due=7 means days after the Invoice was created. The first non-zero Invoice will be created after the trial is over.
So the total active days=14, right?
Yes.
In the first half the Subscription status will be "trialing": https://docs.stripe.com/api/subscriptions/object#subscription_object-status
So after the 7-day trial period, the new non-zero invoice will be created, and there will be no invoice.upcoming event trigger, right?
If your settings are set to fire the invoice.upcoming webhook event to 7 days before, it will trigger at the start of the trial, i.e. immediately
Yes, my setting is configured to trigger the invoice.upcoming webhook event 7 days before the due date. However, when I set days_until_due: 7 and trial_period_days: 7 and created a subscription as I mentioned above, the invoice.upcoming event was not triggered.