#mathieu-ducrot_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/1268145823238062121
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi! it should work I would think, what are you having difficulty handling?
Hi ! My issue is that since calling invoices->upcoming is just a preview, i can't make a manual customer balance update just before calling invoices->upcoming because i will update the customer balance only if they first valid there order.
So the question is more like how to dynamically passing a customer balance to the invoices->upcoming endpoint ?
I see
then yes I don't think that's directly possible, the workarounds would be
- create a "dummy" customer object , set its balance, and use that
- preview the invoice but just manually subtract the balance from the final amount when you use/show the preview amount somewhere
ok, that what i thought, i'm gonna go to manually substract the balance on preview for now and calling the customer balance update as they confirm.
but i should say that such dynamic customer balance override for invoices->upcoming would be a cool feature for our use case
since we are talking about customer balance, do you have some documentation on how can i retrieve the amount of that balance that will be subtracted on a invoice ? (so that we keep track of it on our invoice system)
it would be to call the Retrieve Customer API can check the value of https://docs.stripe.com/api/customers/object#customer_object-balance
ok so you retrieve it back after the payment is due and calculate it yourself, isn't there a easier way of getting directly from the invoice ?
you can get it from an Invoice that has had a balance applied to it yes, but we're talking about a preview invoice that has not had the balance applied, right?
oh my bad my last question was about the step after, when we indeed have a paid invoice