#kornacho-dynamic-discount

1 messages ยท Page 1 of 1 (latest)

analog crescent
#

Hello ๐Ÿ‘‹

crisp canopy
#

Hi!

#

On this subject, I've been thinking also on issuing credit notes after the invoices are paid, but this will require 2 objects (1 invoice, 1 credit note) and a constant returns of money which seems a bit complicated on the accounting side of things

analog crescent
#

Gotcha. Looking into if a fixed discount can be applied several times.

analog crescent
#

quick question:
are you trying to apply the same discount multiple times to a subscription?

crisp canopy
#

Thanks. Yes, that's the objective. Apply a fixed discount multiple times according to, for example, users referrals. Let's say, $5 discount per new registered user this month

analog crescent
#

when you say discount, you mean to use coupons correct?

crisp canopy
#

that was my initial idea but it would require me to create hundreds of coupons. if I charge the user 100 a month, I need to be able to add discounts of $5 for each action the user made. So that would be 20 coupons just to get to 100. If I have a $500 plan, that would be a lot of coupons :/

#

I mean, if this was the only option, I would need to create coupons for values fo 5, 10, 15, 20, 25, and so on. Instead of one of 5 that I can apply n amount of times to the invoice

burnt delta
crisp canopy
#

Can credit notes be applied to a draft invoice? I'm having issues understanding the timing of it. If that's the case, I could do the following:

  • receive a invoice.created webhook event
  • issue a credit note to the user
  • check if the credit is applied to the invoice
  • profit!
burnt delta
#

Credit notes should only be applied to finalized invoices

crisp canopy
#

Oh I see. so the logic is almost the same

#

I get a webhook when the draft is created, so I add items with negative values, and that would be it, right?

#

In that case, I can add a single item for any value I'd like

burnt delta
#

Yup!

crisp canopy
#

That solves the issue! Thanks to both of you for your help!

burnt delta
#

You can also create the invoice item at any point during the subscription (making sure to specify subscription see https://stripe.com/docs/api/invoiceitems/create#create_invoiceitem-subscription) and it should be automatically pulled in to the next invoice created for it. You don't necessarily have to wait until the invoice has already been created)

crisp canopy
#

I see. That's also very convenient