#caitdc_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/1377901711305343110
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hello! taking a look! gimme a while!
can you share the ids of the two invoices that you're referring to?
in_1RUK2AGlGLTzj1RkncXBHqMr, in_1RUK2uGlGLTzj1RkLDjU0kri
hmmm, to confirm, you can reliably reproduce this issue?
Yes
The scenario is I created a subscription schedule at May31, 6am with start date set to May30, 11pm
okay, this is going to take us a while to look into, I'm going to DM you a link where you can create a support ticket, we'll keep you updated on that support ticket.
Hello @dim jacinth, we have sent you a direct message, please check it at https://discord.com/channels/@me/1377906871632924703
- ๐The message has instructions on how to open a direct support case with our Developer Support team, in order to help you more effectively.
Then it generated an invoice at Jun30, 6am and Jun30, 11pm
actually looking at your request to create the subscription schedule here : https://dashboard.stripe.com/test/logs/req_jlRKSIyWOEHSrd - can you explain in more detail what you're trying to achieve?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Based off that request,
- phase 1: plan_SP8CdFyeUL3ZPv is for one month ( one iteration ),
- phase 2: you still have the same plan, but set the billing cycle anchor to phase start - I don't quite understand why?
We have a business requirement where we need invoices generated only in the morning. To achieve this we use subcription schedule when creating subscription. So if a user subscribed at 1pm, we generate a random time in the morning to set as the start date of the subscription schedule so that invoice will be generated at that time. This seems to be working except for edge case where subscription schedule is created at the 31st and the start date is set at 30th then there's no 31st on the next month.
Note that the start date we set is always earlier than the current date time that the subscription schedule was created
I still don't quite understand why you need 2 phases for this though. For example, if a user subscribed at 1 pm, it should be sufficient to have phase 0 to start the subscription schedule the next day in the morning. Why do you need phase 1?
If it's 1pm, phase 0 would start same day 8am(or any time morning)
Looking at the data if it's a normal scenario, the phase 0 end is always earlier than the current period end. With th edge case the current period is earlier than the phase 0 end.
sorry, I still don't understand what you just said
If it's 1pm, phase 0 would start same day 8am(or any time morning)
If a user subscribes at May 30, 1pm. We create a subscription schedule and set the start date as May30, 8am so that invoices will be generated at 8am instead of 1pm.
Why do you set the start date as May 30 8 am? Based off your requirement, you mentioned that you want the invoice to be sent the next day. So shouldn't the start date be May 31, 8 am?
Not the next day, the morning of that same day the subcription is created
but the morning is already past?
Yes, that's why we use subscription schedule since it's not possible to create a subscription and set the billing anchor to past time
okay....are you saying that you want to backdate the subscription? i.e. you want the subscription to start at 8 am, not at 1 pm?
Stripe actually suggests that, for us to use the subscription schedule
Yes, which is only possible if we use subscription schedule
It does work the way we need except for that edge case in my question
gimme a few minutes
maybe lets take a couple of steps back first. Can you share why does a normal subscription not work for you? It also has a backdate_start_date, and it also has a billing_cycle_anchor_config where you can set the subscription to always renew in the morning
I'm trying to remember what exactly didn't work but that was the stripe devs suggested first but it didn't worked for us and our requirements. The next option they suggested then is subscription schedule.
if you reached out before, was it on Discord or was it on a ticket?
Give me a minute, I need to ask my teammate who brought it up to STripe before
hi! I'm taking over this thread.
It's on discord and this is the thread #1272434867979816981 message
Thanks, having a look
That's why we used subscription schedule
I'm still having issues really understanding your use case. Is this what you are trying to achieve?
- Your customer creates a subscription at 10am today (May 30), but you want the subscription to start at 6am the same day
- The first invoice of the subscription is created at 6am on May 30
- Three months later, a new invoice is created at 6am on August 30
- Customer creates a subscription May31, 6am and the start date is set to May30, 11pm bec. I want the invoice to be generated 11pm. (These are in utc but customer could be in different timezone so it's possible they signed up at night and I want the invoice to be generate at morning their time )
- Invoice is generated at Jun30, 6am and again Jun30, 11pm
- We're only expecting invoice to be generated at Jun30, 11pm.
This is edge case only and can happen when customer subscribed at the 31st
Invoice is generated at Jun30, 6am and again Jun30, 11pm
Are you talking about what is currently happening, or what your goal is?
This is what is happening
The goal is to only generate one invoice, the Jun30, 11pm invoice.
Can you share the Subscription ID (sub_xxx) where you see the two invoices?
sub_1RUJwcGlGLTzj1RkXUOti1xq
Normally when user subscribed let's say at May29, 6am and the subscription schedule start date is set May28, 11pm. With these only one invoice is created on the next billing cycle. Invoice is created only at Jun28, 11pm. Then the next invoice would be for the next cycle Jul28, 11pm. This is what we want to achieve, it's already working except for the edge case that I gave
Having a look...
What are the in_xxx IDs of the two invoices that are created unexpectedly on Jun 30
in_1RUK2AGlGLTzj1RkncXBHqMr, in_1RUK2uGlGLTzj1RkLDjU0kri
If it's created 31st then the start date of the subscription schedule is 30th on a later time
Then the next month does not have 31st
Yes, so I'm asking if the duplicate invoice problem occured in the Sept cycle (which also has 30 days)
No, just in the first cycle
Yeah, bizarre. This feels like a bug to me
Bec. the next cycles would have adjusted the current period end time to match the time of the subscription schedule start date time
Given my scenario in the first cycle the current period end is Jun30, 6am and the phase 0 end date is Jun30, 11pm. When it reached the phase 0 end date, the current period end would be now updated to July30, 11pm. It's now the sma etime as the start date of the subscription schedule
I think we're going to ask you to write in to our team and we can investigate this further โ looks like ym colleague already DM'd you a link
As I said this feels unexpected/bug shaped to me, so we need to validate that and check in with the product team
Hello @dim jacinth, we have sent you a direct message, please check it at https://discord.com/channels/@me/1377906871632924703
- ๐The message has instructions on how to open a direct support case with our Developer Support team, in order to help you more effectively.
Okay, thank you. I already created a support ticket.
Did you use that link?
It'll come directly to our team if you do. Otherwise it'll go through regular support channels before ending up with us
Yup, I used the link sent to me by your colleague
Weird, don't see it at our end yet
I'll try to create support ticket again
There should be a message pop-up in the support chat window
Done