#ijsje
1 messages · Page 1 of 1 (latest)
Also, how do I use the subscription modify api to add line items instead of change them.
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 thesub_xxxID to the same endpoint with thesubscriptionparameter.
You'd just add new objects to the items array
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
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 }
],