#maria_35254

1 messages ยท Page 1 of 1 (latest)

cosmic leafBOT
coral sapphire
#

Hello

#

You can use a duration coupon here

#

As long as the next Invoice is created within the duration of the coupon then it will be applied

obtuse sail
#

Would it also work if I only want the coupon to be able to be redeemed once?

coral sapphire
#

Yeah that would work if it is just a one-to-one relationship for Coupon to Customer

obtuse sail
#

Ok yes it would be, so that's good. Would you mind sending a link to the documentation about what "using a duration coupon" means exactly?

coral sapphire
#

That would mean the coupon applies over a certain period of time.

obtuse sail
#

Ok great, thanks! So I'd need to:

  1. Create a coupon where duration = repeating and duration_in_months = X (probably 1 in my case) and max_redemptions = 1
  2. Update the customer to add the coupon

And then until the coupon expires/is redeemed once, it'll be successfully applied to the customer's next invoice for any of their subscriptions?

coral sapphire
#

You don't really need to do both

#

If you are going to use max_redemptions = 1 then you don't need duration_in_months

#

But yes, if you do want it to be constrained to a duration then you could set that as well

obtuse sail
#

Ah ok, I thought you originally said the duration piece was the key to allowing the coupon to be applied when billed through the API

#

Could I set duration to "once" and it would still work?

coral sapphire
#

Ah actually I could be wrong here.

#

duration is meant to be used for Subscriptions specifically

#

So it wouldn't have any affect if you are creating one-off Invoices

obtuse sail
#

In this case, I'm looking to apply them to the first invoice of a subscription

coral sapphire
#

Ah okay perfect

#

Then you really should just set the coupon when you create the Subscription itself.

#

Why do you want to do this ahead of time?

obtuse sail
#

Ah good question hahah -- we're using the coupon to basically apply "credits" from our app. so we don't want to apply the credits and therefore deduct them until we know the charge will go through successfully

#

(but before the first invoice is paid)

#

But since that seems to be impossible, the next best thing is to give the coupon to the customer (and deduct their credits). Even if their first try doesn't go through, at least the coupon would be applied on a subsequent attempt to pay.

coral sapphire
obtuse sail
#

Yeah, I'd love to be able to use that, but my company is choosing to use coupons instead of the credit balance for sales tax purposes ๐Ÿ˜ฆ

#

If we use credit balance, the company owes sales tax on the full amount, even though the user is paying us less $

coral sapphire
#

Hmm okay, well then I do think the duration_in_months is the only way to achieve this then.

#

Since you are applying the Coupon to the Customer and not the Subscription

#

Overall, I'd recommend just tracking this yourself, or using metadata or something, and then adding the Coupon on Subscription creation

#

That is much cleaner

obtuse sail
#

Gotcha yeah I think that's the right long-term solution. Okay I'll give that a try. thanks so much!

coral sapphire
#

๐Ÿ‘