#manuel_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/1361442756337209588
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there
I'd recommend looking at the latest_invoice, and expanding this to see the amount on the latest Invoice
ok I understand, but if the customer adds items to his subscription will the total amount of what he pays be reflected? or only what he added?
In the context of a Subscription update, you can create a preview invoice with the changes you intend to make in order to preview the amount: https://docs.stripe.com/invoicing/preview
I just want to know the total amount the customer pays for their subscriptions.
Can you share more context on what you're trying to solve for exactly? The reason I ask is because there's no concept of an amount on a Subscription. All the amount/totals are on the child Invoice, not the parent-level Subscription
yeah sure
im creating a section where the customers can see the information of their subscriptions, and I want to show the total amount of what are their paying as well.
Got it.
In that case, you likely want to list all Subscriptions for a given customer: https://docs.stripe.com/api/subscriptions/list
Then, for each Subscription, retrieve its latest Invoice and the amount on that Invoice, then add these totals up
oh ok, understood
also i got this:
AttributeError: type object 'Invoice' has no attribute 'create_preview'
from:
preview_stripe_invoice = stripe.Invoice.create_preview(customer='cus_S6fenUGyK25NXZ')
did I made something wrong?
Ah, looks like this is due to the version of the Python SDK that you're using
support for create_preview was added in v.9.3.0