#wullvie_subscription-preview
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/1271222771011162113
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
The current invoice preview is showing me the period_start & period_end dates to be equal, off just by 1 day. I need the period_start date to be today (the date of the update), and the period_end to be the appropriate length of time for the NEW* subscription item that has been added
@cobalt vine just to be clear, you have a Subscription that was from August 1st - September 1st for example and today you want to change the Price associated with it and reset the billing cycle so that it's now August 8 - September 8?
If so, you want to pass billing_cycle_anchor: 'now'
wullvie_subscription-preview
exactly yes - perfect. question - why does this request currently showing the period_end date to be also today?
the period on an Invoice is a bit weird and is for the "past" you can mostly ignore this. I'd recommend just trying end to end in Test mode and confirming your Subscription has the billing cycle you expect
hmm.. I'm hoping I can rely on the new* period start & end times shown on this invoice preview for the UI display to the customer
Unless the period_end start are referring to the lifetime of the actual invoice?
you can, you're just misunderstnading how period work entirely (which is not just you, it's everyone)
Look at the Subscription's current_period_start and current_period_end and they will match what you want
Today, you're resetting the billing cycle. You are charging me today (so the Invoice's period ends today) for next month (August 8 - September 8) so the Invoice's line items have that period.
It's all super weird
loll ok gotcha
is there an easy way to see these period start / ends before* the update has been pushed through?
with billing_cycle_anchor: 'now' I'm expecting to have the result be yes: NEW bill / cycle starts today and ends whenever the new sub length is
If not I can just figure it out / calculate it on my side. For now tho billing_cycle_anchor: 'now' should be exaclty what I need here. Thanks again for the help!
you can use the Retrieve Upcoming Invoice API to preview what the Invoice would look like. See https://docs.stripe.com/api/invoices/upcoming