#mehdi_api
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/1281330792881979527
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
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
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.