#maxime_api

1 messages ยท Page 1 of 1 (latest)

tiny sableBOT
deep mortarBOT
#

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.

tiny sableBOT
#

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

peak grove
#

๐Ÿ‘‹ happy to help

#

would you mind sharing more details?

finite pollen
#

@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

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 ๐ŸŽ‰

peak grove
#

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

finite pollen
#

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)

peak grove
#

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

finite pollen
peak grove
#

I fully understand and I appreciate the approach you took.

finite pollen