#ijsje

1 messages · Page 1 of 1 (latest)

hollow pawnBOT
reef leaf
#

Also, how do I use the subscription modify api to add line items instead of change them.

raw tide
#

However, if the customer hasn't added a seat or teams yet. How do I show the upcoming invoice? I.e. how much the customer will pay if he adds seats and teams product to his subscription.
You'd just pass the sub_xxx ID to the same endpoint with the subscription parameter.

raw tide
reef leaf
#

Right now my subscription modify looks like this:

stripe.Subscription.modify( subscription_code, items=[ {'id': 'si_NR0haaDllFKLFE', 'price': 'price_1MWbi9IWsc29YaoJXrXUzHKw', 'quantity': 1}, {'id': 'si_NP9e3UJftuCFqJ', 'price': 'price_1MeLHIIWsc29YaoJ12hnRrPO', 'quantity': 18} ], proration_behavior='always_invoice', payment_behavior='allow_incomplete', )

#

where I have to give a line item code

raw tide
#

If your intention is to add new items to the subscription, then I think you'd just add a new object with the price and quantity parameters:

items=[
  {'id': 'si_NR0haaDllFKLFE', 'price': 'price_1MWbi9IWsc29YaoJXrXUzHKw', 'quantity': 1},
  {'id': 'si_NP9e3UJftuCFqJ', 'price': 'price_1MeLHIIWsc29YaoJ12hnRrPO', 'quantity': 18}
  { 'price': 'price_xyz', 'quantity': 1 }
],
reef leaf
#

So only when I modify an existing product, I have to add the line item id

#

Ok that works