#Kontrolol - void invoices

1 messages · Page 1 of 1 (latest)

long leaf
#

Hello. Give me a moment to catch up

#

There is 1 hour before Stripe finalizes the invoice and tries to collect payment (once the invoice is created): https://stripe.com/docs/billing/subscriptions/overview#invoice-lifecycle. Another way you can issue free months to a customer is by creating invoice items as credits: https://stripe.com/docs/api/invoiceitems/create#create_invoiceitem-amount

Learn how subscriptions work within Stripe.

twilit veldt
#

here

#

Ok, so I have 1 hour between draft state and open state of the invoice

#

If I want to void the invoice, it needs to first be in a finalized state

#

I do not see mention of the event/webhook to be used when invoice is in draft mode

long leaf
#

There isn't much time to react in between when the invoice is finalized and when payment is attempted

#

invoice.created is the event to listen to there

#

But if you want to offer free months, creating invoice items is the easiest way to do so

twilit veldt
#

creating invoice items for every free month as soon as it happens?

#

i.e. a customer in our referal system refers someone ->triggers webhook call to our endpoint for successfull referal
our endpoint -> Stripe API create invoice item which gives a free month?

long leaf
#

Yeah that would work

twilit veldt
#

I was seeing it more as give a free month as the subscription continues.
So that way if subscription is cancelled, and then resubscribed in the future their unused free months would still be usable

long leaf
#

So let me get some clarification here

#

Is the person referring users the one getting free months?

twilit veldt
#

yes, the person who refers others is the one getting free months. The referer would normally have a valid subscription in Stripe. The referee would be a new Customer in Stripe with a new valid subscription.

long leaf
#

Ok cool, so then invoice items would work here

#

They are applied automatically to the next upcoming invoice

#

And even if the referrer cancels their subscription, they will still be attached to their customer id

twilit veldt
#

There are two approaches I see here now with the option of an Invoice Item. However the idea remains that it must be on a per month basis.
each month when the invoice is created, I would either void the invoice or create an invoice item which will make the cost come to 0$

#

ok

twilit veldt
#

Im currently looking at invoice items. and how they work

#

According to you, which is a better solution for clarity and traceability. Voiding an invoice or adding an invoice item ?

#

an invoice item must be linked to an invoice, correct ?

long leaf
#

No they don't need to. If an invoice id isn't passed in while creating the customer's invoice item, it is automatically applied to the next invoice

#

As many of these items will be applied as credits up to the invoice's value

twilit veldt
#

if there are multiple invoice items created without an invoice id, each of the invoice items resulting in a 0$ charge. is only one applied ? or all of them/more than one

#

for the next invoice that gets created

long leaf
#

Correct. Only 1 would be applied

twilit veldt
#

I see I would need to use a coupon we have created which applies a 100% discount to the product. I would specify this coupon in discounts.coupon when reating an invoice item ?

twilit veldt
long leaf
twilit veldt
#

I will always need to match the amount in the invoice item to the amount the customer pays for their subscription

#

but put the invoice item amount as a negative

#

in what cases would someone use the discounts parameter then ?

long leaf
#

The discounts parameter is if the invoice item is a charge (not a credit) to the customer and you want a discount applied to the amount on the invoice item

twilit veldt
#

ok, thank you for the clarification

#

Thank you very much for your help

#

10/10

long leaf
#

No problem!

twilit veldt
#

this thread will remain available?

long leaf
#

It will be archived after some time

twilit veldt
#

but still accessible ?

long leaf
#

Yeah

twilit veldt
#

where would I be able to find it when archived

long leaf
#

There is a threads button in the top right and you can filter by archived

twilit veldt
#

ok. thank you!