#kishoreklkr_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/1375085020124938352
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
๐ happy to help
hello
I went through this
https://docs.stripe.com/customer-management#customer-portal-limitations
when i said
Stripe BillingPortal can't update:
-- subscription with >1 item
-- metered-only subscription
You don't necessarily need the BillingPortal or Checkout Sessions to upgrade a subscription
if you already have a website this can be initiated through your website
if for some reason the payment fails, you can then send the customer to the BillingPortal to update their PaymentMethod then when they're back you would retry the upgrade
we've been using Checkout and BillingPortal all along because change in products would result in payments and we must anyway take user to stripe right.. Checkout and BillingPortal help us reduce th work in our end
yes I agree, and I suggested a way to overcome this
If I do this, I would have to handle the invoice generation, approval of that from user before payment and everything in between
not necessarily
you can use pending updates
Understood.
But in Checkouts there is no way to include the unused value from previous Subscription
?
yes that's not possible with Checkout Sessions
before running the update subscription, is there any way to show the amount that we'll be charging the user.. from Stripe end?
This is an API for backend use right, we can't use it directly to show it to user ?, i don't see a redirect url for an approval or something.. Am i right to assume we have to build it from our end to show this data to User?
anyway, this endpoint will show the correct values after the subscription is updated, So i can't use it to get user's approval
This is an API for backend use right, we can't use it directly to show it to user
yes that's correct but you can develop something to show that on the frontend
I'm not sure I understand what do you mean
preview invoice for Subscription with updated items can only be generated after we trigger the Update of Subscription right
So, preview-invoice can only be used to inform user that XXX amount will be charged,
It can't be used to ask confirmation from user weather we can charge XXX amount for your purchase
preview invoice for Subscription with updated items can only be generated after we trigger the Update of Subscription right
no
this is to be able to show the customer what the next invoice would look like when you apply the upgrade
My upgrade is a prepaid one.. so as soon as i upgrade user will be charged,
so can i keep the transaction on hold until user sees the invoice and approves it
is the following flow possible?
- user clicks on upgrade
- i update the subscription with new item, but keep payment on hold
- generate preview invoice
- get approval
- trigger payment collection for subscription update
- user clicks on upgrade,
- generate preview invoice,
- get approval,
- update subscription
Oh, ok.. in preview itself I add the necessary items So it will show all money involved along with prorated pricing added
?
yes correct
and you can also pass in the proration date
so that it would calculate exactly the proration amounts
Got it, will try this one
last question
All this confusion is occuring because of the fact that I am adding a Metered product to the subscription which is a extra item,
say I don't add the metered product to the Subscription
But I give a CreditGrant to user from backend and log meter events .. When next billing happens can i independently add the creditGrants consumed and update the invoice, instead of it happening at your end based on metered product that i am supposed to connect?
you can but it would be a shame to have to track all of that yourself
ok, i would have it as a last backup plan.. can u please put up in simple steps how can i achieve it
do you mean add invoice items to the upcoming subscription's invoice?
No, for this
this I understood
I'm not following
what I understood from this, is that you want to manually update the invoice to add the items that you're tracking on your end
yes
if you listen to invoice.created events https://docs.stripe.com/billing/subscriptions/webhooks#successful-invoice-finalization you can add items to that invoice and manually finalize it
Ok , thankyou so much.. will reach out after running these experiments if i face any issue