#aabhaskarma_api

1 messages ยท Page 1 of 1 (latest)

olive pineBOT
#

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

clear sonnet
#

Could you please share the event Id invoice.upcoming that's being triggered immediatly ?

#

Between the invoice in_1Px4tYF8tiMhHfPbjM4zNgov is for the trial period.

olive pineBOT
fresh sparrow
clear sonnet
fresh sparrow
#

Trying

fresh sparrow
#

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.

timid hull
#

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.

fresh sparrow
#

So the total active days=14, right?

timid hull
#

Yes.

fresh sparrow
#

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?

timid hull
#

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

fresh sparrow
#

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.

olive pineBOT