#caitdc_api

1 messages ยท Page 1 of 1 (latest)

modern vortexBOT
#

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

queen citrus
#

hello! taking a look! gimme a while!

#

can you share the ids of the two invoices that you're referring to?

dim jacinth
#

in_1RUK2AGlGLTzj1RkncXBHqMr, in_1RUK2uGlGLTzj1RkLDjU0kri

queen citrus
#

hmmm, to confirm, you can reliably reproduce this issue?

dim jacinth
#

Yes

#

The scenario is I created a subscription schedule at May31, 6am with start date set to May30, 11pm

queen citrus
#

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.

modern vortexBOT
#

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.
dim jacinth
#

Then it generated an invoice at Jun30, 6am and Jun30, 11pm

queen citrus
#

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?
dim jacinth
#

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

queen citrus
#

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?

dim jacinth
#

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.

queen citrus
#

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)

dim jacinth
#

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.

queen citrus
#

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?

dim jacinth
#

Not the next day, the morning of that same day the subcription is created

queen citrus
#

but the morning is already past?

dim jacinth
#

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

queen citrus
#

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?

dim jacinth
#

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

queen citrus
#

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

dim jacinth
#

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.

queen citrus
#

if you reached out before, was it on Discord or was it on a ticket?

dim jacinth
#

Give me a minute, I need to ask my teammate who brought it up to STripe before

modern vortexBOT
simple bone
#

hi! I'm taking over this thread.

dim jacinth
simple bone
#

Thanks, having a look

dim jacinth
#

That's why we used subscription schedule

simple bone
#

I'm still having issues really understanding your use case. Is this what you are trying to achieve?

  1. Your customer creates a subscription at 10am today (May 30), but you want the subscription to start at 6am the same day
  2. The first invoice of the subscription is created at 6am on May 30
  3. Three months later, a new invoice is created at 6am on August 30
dim jacinth
#
  1. 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 )
#
  1. Invoice is generated at Jun30, 6am and again Jun30, 11pm
#
  1. 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

simple bone
#

Invoice is generated at Jun30, 6am and again Jun30, 11pm
Are you talking about what is currently happening, or what your goal is?

dim jacinth
#

This is what is happening

#

The goal is to only generate one invoice, the Jun30, 11pm invoice.

simple bone
#

Can you share the Subscription ID (sub_xxx) where you see the two invoices?

dim jacinth
#

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

simple bone
#

Having a look...

modern vortexBOT
oak epoch
#

What are the in_xxx IDs of the two invoices that are created unexpectedly on Jun 30

dim jacinth
#

in_1RUK2AGlGLTzj1RkncXBHqMr, in_1RUK2uGlGLTzj1RkLDjU0kri

oak epoch
#

I'd guess this is a problem in all months with 30 days?

#

Does it happen in Sept?

dim jacinth
#

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

oak epoch
#

Yes, so I'm asking if the duplicate invoice problem occured in the Sept cycle (which also has 30 days)

dim jacinth
#

No, just in the first cycle

oak epoch
#

Yeah, bizarre. This feels like a bug to me

dim jacinth
#

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

oak epoch
#

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

modern vortexBOT
#

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.
dim jacinth
#

Okay, thank you. I already created a support ticket.

oak epoch
#

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

dim jacinth
#

Yup, I used the link sent to me by your colleague

oak epoch
#

Weird, don't see it at our end yet

dim jacinth
#

I'll try to create support ticket again

oak epoch
#

There should be a message pop-up in the support chat window

dim jacinth
#

Done