#hpanseriya_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/1359105760679956481
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
You should use the schedule_* parameters instead of subscription and subscription_details: https://docs.stripe.com/api/invoices/upcoming?lang=php&api-version=2025-02-24.acacia#upcoming_invoice-schedule_details
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
You are suggesting to use the latest version API?
No
I just had to incluide that in the link as that API has been removed from the latest version
Ok. Can you please let me know why API gives error?
I just did?
You should use the
schedule_*parameters instead ofsubscriptionandsubscription_details
Sorry. Didn't get idea. Can you please explain what you're referring?
Did you look at the API reference link I sent? Did you read the error? You can'y use the subscription and subscription_details params in your request because sub_1OrVOiER4mxFRmGRROAa8H8r is controlled by a schedule. You need to use schedule and schedule_details to get the preview you want
Ok. Can you please let me know when we need to use the subscription and subscription_details params ?
When the subscription you want to preview an upcoming invoice for is not controlled by a schedule
Ok. Thanks
I checked the codebase and we use the subscription and subscription_details for the schedule use case as well and it's working very well for other users. Can you please let me know why it's not working for this specific user?
You'd need to share an example where it works
Sure
Hmm, I think the general recommendation would be to always use the schedule parameter if you're previewing a subscription controlled by a schedule
You wouldn't be able to update the subscription directly regardless, you'd need to update the schedule to make any changes so it makes sense to do the same for the upcoming invoice so it's accurate
Not sure why that specific example worked to be honest, but my advice above stands
Ok