#Jones.Jeffery

1 messages ยท Page 1 of 1 (latest)

peak brambleBOT
soft wind
#

Hi ๐Ÿ‘‹

Yes the initial invoice will be finalized immediately so it can be used to collect payment details from the customer.

#

What is the use case that you do not want to use the application_fee_percent parameter to achieve this outcome?

honest river
#

We are looking to apply a flat fee for the initial and every following invoice.

soft wind
#

Is the amount of each invoice subject to change?

honest river
#

Nope, it should be the same amount throughout the subscription. We could calculate the percentage for the initial, is it correct that it applies the same fee amount to all the following invoices as well?

soft wind
#

That would be correct

honest river
#

If we were to apply the percentage, how would we manage adjusting the fee if the customer were to change from say annual sub to a monthly sub?

soft wind
honest river
#

By listening for the Subscription Created event and updating it from there?

soft wind
#

I'm not sure I follow

honest river
#

You linked application_fee_percent but stated application_fee_amount. I'd assume that we would receive a webhook for the subscription change and have to update the percent at that time.

soft wind
#

When you create the subscription, you know the amount you are going to charge

#

Ah my mistake

honest river
#

Right. But if the customer changes the subscription through the portal, how would that work?

soft wind
#
  1. don't let them use the portal to do that.
    or
  2. listen to the .updated event for that customer subscription and update the application_fee_percent.
    OR
  3. Undo the application_fee_percent after the initial invoice and then (when invoices are generated with a 1 hour draft period) use the `invoice.created webhook event to trigger adding the flat fee
honest river
#

Got it. That is helpful, thank you! As a thought, is it possible to "override" the application fee on the draft invoices? So we can always sanity check that they are getting the correct application fee and would allow us to handle subscription changes. Receive the invoice.created event, validate their fee matches the correct subscription amount. If not, send an update for the application fee amount on the invoice.

soft wind
#

Yes that approach would work but only after the initial invoice, which is finalized immediately.

honest river
#

Right.

#

Awesome, thank you for talking through this!

soft wind
#

Happy to shed what ๐Ÿ’ก I can ๐Ÿ™‚