#pl_api

1 messages · Page 1 of 1 (latest)

viscid coveBOT
#

đź‘‹ 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/1277481994762195007

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

analog locustBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

past coral
#

Hi there, so you want to change the billing_cycle_anchor for the next renewal?

jagged sage
past coral
#

You can to use subscription schedule and let it set the billing_cycle_anchor when the 2nd phase starts

#
    {
      items:[
        {
          price: PRICE_ID
          quantity:1
        }
      ],
      end_date: new Date("Sep 26 2024 0:00").getTime() / 1000,
      
    },{
      billing_cycle_anchor: 'phase_start',
      items:[
        {
          price: PRICE_ID
          quantity:1
        }
      ],
      proration_behavior: 'none'
    }
  ]```
#

Something like this

jagged sage
#

Can I use a subscription schedule for immediate updates?
I want to specify 00:00 on the day when I want to renew a subscription, but I want the renewal itself to be processed at the moment of request.

past coral
#

So you want to backdate the subscription, and immediately renew it? Why?

jagged sage
#

It means that the first phase of the subscription schedule can be set to a past time.

past coral
#

The subscription schdule API doesn't support backdating

jagged sage
#

The subscription subscription start time is also set to 00:00, but the application side that uses this Stripe handles this on a date basis, so we want to align the criteria for the subscription/renewal date. The background is that the application data is set to 00:00, so we want the Stripe data to be aligned to 00:00 as well to make it easier for users to understand.

past coral
#

Hmm, actually I found it confusing.

jagged sage
#

end_date: new Date("Sep 26 2024 0:00").getTime() / 1000,
Is this not the intention, that the past can be set?

past coral
#

The subscription should start when the customer subscribes.

#

No you can't set end_date to a past date.

jagged sage
#

The rule itself, that the date should be 00:00 on the day of the event, should not be a problem if the terms of reference are taken into account. (Although the opinion that it should be at that moment is correct.)
In fact, stripe allows a time to be specified when creating a subscription. Can this also be done at the time of renewal?

#

No you can't set end_date to a past date.
ok.

viscid coveBOT
boreal dust
viscid coveBOT
jagged sage
#

This is at create, right? I've linked it, but the api at update doesn't seem to allow that setting, no?
https://docs.stripe.com/api/subscriptions/update#update_subscription-billing_cycle_anchor

billing_cycle_anchor
string
Either now or unchanged. Setting the value to now resets the subscription’s billing cycle anchor to the current time (in UTC). For more information, see the billing cycle documentation.

past coral
#

Hi @jagged sage have you tried the subscription schedule that I mentioned in the very beginning?

jagged sage
#

I heard that you can't use past dates for that?

past coral
#

No you can't.

jagged sage
#

If so, what does it mean to try a subscription schedule?
I have used subscription schedules before. I have used it for downgrade functions that specify a future date.

viscid coveBOT
past coral
#

I have another idea, you use subscription API to create a subscription with backdate, and later create a subscription schedule to change the billing_cycle_anchor in phase 2 start