#deadshot_api

1 messages ¡ Page 1 of 1 (latest)

alpine pivotBOT
#

👋 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/1236030880129093713

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

dusky sedge
#

Not sure I understand what you mean

#

Can you give a specific example

opal chasm
#

Ok. Let me get subscription Ids

#

For example, this subscription sub_1PCJrAHCPH5IrTb7F2MvCijs is created and started at time 4:00 AM PDT and all future invoices are created exactly at that time.

#

This is what I want

#

But the problem is, for instance, this subscription sub_1P9pwCHCPH5IrTb7NRfgIhEU, it was created later at 7:39 AM PDT, but was started at 4:00 AM PDT. The future invoices are created at 7:39 AM PDT but I want it to create at 4:00 AM PDT, just like for other subscriptions.

dusky sedge
#

Looking

#

That way invoices are anchored to the start_date

opal chasm
#

I will check this out, thanks.

#

Quick question,

#

Will it still prorate?

inner stream
#

Apologies, still looking in to this. I actually think the start_date param will not backdate the anchor the way you are looking for the way I thought it did when I passed that on to codename_duchess

#

Still figuring out how you can do this

opal chasm
#

Oh ok

inner stream
#

Can you tell me more about what behavior you want from the billing cycle anchor and prorations? From what I can tell, to have the billing cycle anchor set like this on a subscription schedule subscription, you would need to create the subscription by itself first, then add a schedule to it, and then add the later phases. I get that that is inconvenient compared to just creating the schedule, and will put in a feature request, but that is where our API capabilities are at the moment.
You can definitely set a proration behavior to only charge a partial amount when creating the subscription by itself.

opal chasm
#

I just want to control the invoice creation time for subscription and disable proration for first phase!

inner stream
#

Ah in that case, you can just create the subscription directly! To control invoice creation time you just need to set the billing cycle anchor, though you can also backdate the subscription if you want, you can set proration behavior to none to make sure you charge the full amount
https://docs.stripe.com/api/subscriptions/create#create_subscription-billing_cycle_anchor_config
https://docs.stripe.com/api/subscriptions/create#create_subscription-proration_behavior
https://docs.stripe.com/billing/subscriptions/backdating

opal chasm
#

Thanks, I will check it

#

Looks like these API's are for subscription. Does that work for scheduled subscriptions too?

#

I also have another question regarding subscription schedule update

inner stream
#

Kind of, you can set the second phase to start at a specific time and for the billing cycle anchor to be changed then, but that would mean that the original invoice would be inaccurate in what it says the dates for that first cycle are

#

For the cycle anchor to be correct from when the subscription is created, you would need to create the subscription directly first

#

And of course happy to help on the other question as well

opal chasm
#

I can't update a subscription schedule whose first phase has ended and its currently in the second phase, I am getting an error: "You can not update a phase that has already ended. Trying to update phase 0." Even though I am passing the same first phase and only changing the end_date of second phase.

inner stream
#

That is expected behavior. After the first phase has ended you are expected to exclude it when passing the phases param in the update call

opal chasm
#

I tried that too but still getting the same error

inner stream
#

Can you send me the ID of a request where you did that? (req_123)

opal chasm
#

I will try again and get back to you with request ID if I am getting the issue

#

Thanks for helping