#akii-invoice-coupon
1 messages · Page 1 of 1 (latest)
Applicable products means that the coupon can only apply to subscriptions and invoices that use that product
For example someone could have a gold, silver, and bronze plan, and a coupon that only applies to silver and bronze plans
How are you trying to apply this coupon to this invoice? They should be able to properly create discounts here
I am adding the discount like .setDiscounts(discounts) to InvoiceCreateParams
That should work as long as the coupon applies to the products on the invoice. Do you have the ID of an invoice that you did this with that didn't show a discount?
yes one second sharing that to you
in_1MVyLWELLM3Jv5QREL6CnCDG
It does not give any specific error that it was not able to add the discount to the invoice because of the applicable products...
Thank you for the ID checking in to what happened there
Hi there 👋 I'm pulling up that Invoice and taking a closer look.
What I'm seeing is that when you created the Invoice Item to be added to this Invoice, that you defined an ad-hoc price by providing a currency and an amount. The Invoice Item was not associated with an existing Price or Product:
https://dashboard.stripe.com/test/logs/req_vc3HMmiTsaS0uY
This caused the Coupon that you applied to not do anything as that Coupon was created to only apply to a specific product:
https://dashboard.stripe.com/test/logs/req_QdyDGJZ2lADZrF
If you would like this Invoice Item to be associated with the Product that the Coupon applies to, then you'll need to either use price_data.product or an existing Price when creating the Invoice Item.
https://stripe.com/docs/api/invoiceitems/create#create_invoiceitem-price_data-product
If you would rather have a Coupon that doesn't have this Product restriction, then you'll want to create a new Coupon that doesn't have use the applies_to option.
akii-invoice-coupon