#mehdi_api

1 messages ยท Page 1 of 1 (latest)

static compassBOT
#

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

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

hybrid oxideBOT
rapid pewter
#

Hi there ๐Ÿ‘‹ yeah, your approach of comparing the current_period_start to start_date is a valid approach. There are some scenarios where those dates may be different even though the Subscription didn't cycle to a new period normally, for instance adding a trial period to an existing Subscription would cause those values to misalign.

You can use Test Clocks to test out your flows in testmode and make sure that check returns the information you want for your flows.
https://docs.stripe.com/billing/testing/test-clocks

Another approach you can consider trying is looking at the latest_invoice on the Subscription:
https://docs.stripe.com/api/subscriptions/object#subscription_object-latest_invoice
Then check the billing_reason on that Invoice to see if it's set to subscription_cycle (as opposed to subscription_start)
https://docs.stripe.com/api/invoices/object#invoice_object-billing_reason

Learn how to move Billing objects through time in test mode.

wheat sun
#

oh perfect, will use the billing_reason

#

thanks