#rstocker-preview-firstinvoice

1 messages · Page 1 of 1 (latest)

graceful geyserBOT
rugged swallow
#

rstocker-preview-firstinvoice

ruby birch
#

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.

rugged swallow
#

it should just work really

ruby birch
#

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?

rugged swallow
rugged swallow
#

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?

ruby birch
#

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,
            },
          ]
        )
rugged swallow
#

yay!

ruby birch
#

And then if you grab total you get what they would be billed.

#

Is that the approach?

rugged swallow
#

yep!

ruby birch
#

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()

rugged swallow
#

gotcha

graceful geyserBOT