#rstocker-preview-firstinvoice
1 messages · Page 1 of 1 (latest)
https://stripe.com/docs/api/invoices/upcoming will work for this
rstocker-preview-firstinvoice
I don't think so. That's what I'm currently looking at but if the person has credit it won't give the right amount. If I look at the Customer Portal it shows a calculated value e.g flat + quantity amount for a graduated subscription but I don't see anything in the API that would give the same value.
it should just work really
When you say "just work" do you mean that if I walked the line items and did the math I'd get the right value or that I should see a total in there somewhere?
neither of those. You use https://stripe.com/docs/api/invoices/upcoming you provide the right list of Prices and relevant information, and it will give you back what the first Invoice of that Subscription would look like
yep that really just works. I would say just try it and share the exact code and the problem
@ruby birch were you able to test?
Just finished. Ok, I think I see what you are suggesting and it seems work. Here's what I did...
customer=request.user.customer.subscription.stripe_customer_id,
subscription_items=[
{
"price": "price_1Mhl46CZ3jbVsfoGHJMkedjq",
"quantity": 4,
},
]
)
yay!
yep!
Perfect. RTFM I guess ;). Thanks for pointing me in the right direction. That wasn't obvious to me. I was thinking more sub.get_billing_amount()
gotcha