#bugkiller-subscription-quantity
1 messages · Page 1 of 1 (latest)
Hello what is your question?
hi, thanks for coming back to me.
I'm going to create a subscription in our system
we already have a plan created in stripe dashboard
when I create a subscription, I want to use the parameter items.quantity
my question is is it ok to not specify item.price?
it will automatically calculated because price is in plan
Am I right?
bugkiller-subscription-quantity
@stuck solar The Plan API is deprecated and replaced by Price. So mostly when you create a Subscription you pass both price and quantity really
That API is the Create Subscription API. It takes items as a parameter which itself has price as a parameter. You have to pass the price parameter
you have to pass it, ignore what the documentation says, it's incorrect
wow
basically you have to pass price. But you can pass price_data instead
so one of the two is required, which makes both optional technically
I'v succeeded without passing this 2 parameters when I don't use items.quantity
but now I'm trying to use quantity (due to requirements) , so asked for check.
maybe I need to check myself by testing a little bit.
if I need to provide it, price should be total amount?
or just 1 item price?
I'm sorry but none of this is really clear. The Price id is always required, whether you pass quantity or not. I need you to provide a lot more actionable information, all in one messages (not many sequential short sentences) that describes what you are doing, your exact code, which error you get, clear request ids (req_123) and examples where it worked before (sub_123) so that I can help you
I'm using python so I"m calling like
python library stripe provide
stripe.Subscription.create(customer=stripe_customer.id, trial_from_plan=trial_from_plan, coupon=coupon_code, items=[{'plan': product_code}])
yeah so you're using a multi-year old deprecated parameter. That's what I meant earlier. The Plan API has been deprecated by Price. You used to pass plan: 'my plan' and now you want to pass quantity: 10. You can add this, but I'd recommend also switch away from plan and passing price so simply stripe.Subscription.create( customer=stripe_customer.id, trial_from_plan=trial_from_plan, coupon=coupon_code, items=[ { 'price': product_code, quantity: 10, }, ], )
that means I need to upgrade stripe library (for python)?
I'm afraid if it will break my existing codebase
you just said you were worried so I'm side stepping that
but you can read our migration guides to figure out how to upgrade if you want to like https://github.com/stripe/stripe-python/wiki/Migration-Guide-for-v3 and the other ones
ok. that means upgrading library could break something not work?
thanks for providing me a link. let me check
sounds good
yes