#A guy named Boris-python-promo-codes

1 messages · Page 1 of 1 (latest)

viscid moss
#

Hi 👋 can you tell me a bit more about what you're trying to do when you hit that error, and what your code looks like?

onyx trench
#

I have a coupon and I want to create multiple on-time promo codes for it. I follow this page https://stripe.com/docs/api/promotion_codes/create?lang=python
So I do something like:

COUPON_ID = 'XXXXX'
coupon = stripe.Coupon.retrieve(COUPON_ID)

which works, but when I do

stripe.PromotionCode.create(coupon="coupon['id']", code="VIPCODE")

I get

AttributeError: module 'stripe' has no attribute 'PromotionCode'
#

stripe.version.VERSION gives 2.49.0

viscid moss
onyx trench
#

is 2.50.0 available via conda or pip? I can't find it

viscid moss
#

I'm not sure off-hand.

viscid moss