#maxime_api
1 messages ยท Page 1 of 1 (latest)
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- maxime_unexpected, 1 hour ago, 18 messages
- maxime_api, 16 hours ago, 57 messages
๐ 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/1243138643758153740
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
@grave mulch @modern furnace I talked with both of you yesterday here: https://discord.com/channels/841573134531821608/841573134531821616/threads/1242849774986854476
It was about generating the upcoming invoice when a subscription is on trial, with no payment attached, and not using invoice (but rather Charge Automatically). I couldn't make it work and you both told me it was impossible.
But after trying hundreds of different combinations with a colleague of mine, we managed to make it work so I just want to let you know in case you get asked again about it ๐
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
I have been able to achieve it by calling GET https://api.stripe.com/v1/invoices/upcoming
With the following params:
- subscription_details[items][0][price]: price ID
- customer: customer ID
- automatic_tax[enabled]:
true - discounts[0][coupon]: (optional) the coupon ID
And this gives me the total price, with taxes and coupon included even if the user is trialing, with charge automatically and no payment method attached ๐
the reason why this works is that it simulates an update rather than calculating what it happens based on the current price information
even if you're using the same price
It makes sense for me too. I just didn't know exactly how to make it happen.
But is exactly what I'm after, but nobody could tell me this yesterday and I was told twice that the only possible way of achieving this was to update the subscription status to be paying by invoice, make the query and revert it to be paying with "charge automatically" ( ๐คฎ ).
And that this wasn't part of the public API, only internal one.
Hence why I wanted to share the solution.
Even got the same answer on Stackoverflow from another Stripe member: https://stackoverflow.com/questions/78519093/getting-the-next-invoice-of-a-subscription-on-trial-not-using-invoice-and-witho/78519212
(I'll share the better answer there in a sec)
something must have changed in the way the upcoming invoice works, I wasn't aware this was possible as well. In retro I could see why it might. But this might be something that was released and colleagues and I weren't made aware of.
I'm terribly sorry for this less than ideal situation/experience and thank you for understanding that we are all human and we all make mistakes. Flagging this to us is an opportunity for us to grow and learn and that's possible due to your constant feedback. Thanks again
Yes this is not a blame at all don't worry! ๐
I just wished to share with both of them the fact that it is possible so they're aware in case someone asks again
I fully understand and I appreciate the approach you took.
Don't be sorry, I know we're all humans and I make mistakes too. Really just sharing the answer here ๐
Have a good day ๐