#John Gadbois-subscription-coupons

1 messages · Page 1 of 1 (latest)

mossy star
#

Hi there 👋 can you set the discountable parameter to false when you first create the invoice item?

wind marten
#

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

#

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?

mossy star
#

Ah, apologies, didn't realize you were adding them that way.

wind marten
#

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)

mossy star
#

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.

wind marten
#

Yes, we did think about that in a couple scenarios:

  1. Coupons aren't editable so we couldn't reuse a coupon as new Prices are added to the system

  2. 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_redemptions and times_redeemed

#

#2 would work but does have some drawbacks and would require a lot more bookkeeping in our application

mossy star
#

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

wind marten
#

Will do and will let you know - thanks!