#manuel_api

1 messages ¡ Page 1 of 1 (latest)

jolly merlinBOT
#

👋 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.

ember inlet
#

Hi there

#

I'd recommend looking at the latest_invoice, and expanding this to see the amount on the latest Invoice

rose lion
#

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?

ember inlet
rose lion
#

I just want to know the total amount the customer pays for their subscriptions.

ember inlet
#

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

rose lion
#

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.

ember inlet
#

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

rose lion
#

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?

ember inlet
#

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

rose lion
#

ok thank you so much!!!