#Skrypnyk81

1 messages · Page 1 of 1 (latest)

brave stagBOT
agile elm
#

Hi! Let me help you with this.

storm spoke
#

ok

agile elm
#

Where do you get this ID from? di_1MgWTxE0TrdS8dkGbQXDeXiX

storm spoke
#

From REST API

#

From this quote qt_1MgWTyE0TrdS8dkGlbnvnYqd

storm spoke
# agile elm Where do you get this ID from? `di_1MgWTxE0TrdS8dkGbQXDeXiX`

Ok, I solved it, I forgot to add .object to discount quote = stripe.Quote.retrieve(quote_id)
quote_line_items = stripe.Quote.list_line_items(quote_id)
customer_id = quote["customer"]
metadata = quote["metadata"]
discounts_list = quote["discounts"]
payment_period = metadata["payment_recurrence"]
coupon = ""
if len(discounts_list) > 0:
coupon = discounts_list[0].object