#Kontrolol - void invoices
1 messages · Page 1 of 1 (latest)
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
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
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
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?
Yeah that would work
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
So let me get some clarification here
Is the person referring users the one getting free months?
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.
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
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
ok, thats cool
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 ?
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
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
Correct. Only 1 would be applied
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 ?
awesome
All you need to do is specify the amount: https://stripe.com/docs/api/invoiceitems/create#create_invoiceitem-amount
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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 ?
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
No problem!
this thread will remain available?
It will be archived after some time
but still accessible ?
Yeah
where would I be able to find it when archived
There is a threads button in the top right and you can filter by archived
ok. thank you!