#nobody4322
1 messages · Page 1 of 1 (latest)
hi! not sure I understand what that would mean, could you elaborate/explain an example?
invoice_item = stripe.InvoiceItem.create(
customer=customer.id,
price=plan.plan_id,
currency='usd',
quantity=1,
description="Directory Sync",
)
invoice = stripe.Invoice.create(
customer=customer.id,
auto_advance=False,
discounts=[{"coupon": "coup77"}],
metadata={
'plan_id': plan.plan_id,
'quantity': len(location_ids),
'type': 'directory_sync',
'reason': 'one_time'
},
)
this is my code my coupan gives 77$ (fixed amount) on invoice
if i have 2 qunatity it also gives $77 discount.
i want to give $77 discount on every quantity
for 2 qauntity discount should be ($77*2)
does discounts=[{"coupon": "coup77"}, {"coupon": "coup77"}]], work?
not sure if it will, we might restrict it so only one copy of the same coupon can be used.
if so, then I don't think there's any inbuilt solution here, you just have to calculate the discount you want and create a coupon for it.
its not working, coupan should be unique
then yeah I think you just have to manually create a coupon for $154 and pass that,sorry.
we can create multiple coupan on run time. right?
What do you mean by "on run time" exactly?
i mean from api
every time i will have different amount, so i need to create multiple coupan.
Correct