#John Gadbois-subscription-coupons
1 messages · Page 1 of 1 (latest)
Hi there 👋 can you set the discountable parameter to false when you first create the invoice item?
Hi toby - no because the subscription takes an add_invoice_items properties which only accepts a subset of invoice item properties
If you pass discountable as one of the item properties it is rejected
This is the parameter: https://stripe.com/docs/api/subscriptions/create#create_subscription-add_invoice_items
Supporting discountable on that property would be our easiest solution if that is something that could be supported on your end, but maybe there is another workaround you can think of?
Ah, apologies, didn't realize you were adding them that way.
From our research so far, it looks like we can only add them that way because of how subscriptions create the first invoice (in open state so not editable)
Are using product objects for your subscription items? I'm thinking the easiest path would be to make the coupon only apply to certain products.
Yes, we did think about that in a couple scenarios:
-
Coupons aren't editable so we couldn't reuse a coupon as new Prices are added to the system
-
We could potentially clone the coupon, limit it just to the product for the subscription about to start, then apply it. This would work but would break
max_redemptionsandtimes_redeemed
#2 would work but does have some drawbacks and would require a lot more bookkeeping in our application
Hm, let me work on confirming something and get back to you.
Thanks for your patience, I was checking if there was a way to have the invoice not immediately go into an open state but there isn't a way to do that.
Can you try creating the invoice items directly on the customer, and then create the subscription? I think this will cause the subscription's invoice to pull in the pending items, and give you the capability to set the discountable parameter.
https://stripe.com/docs/api/invoiceitems/create
Will do and will let you know - thanks!