#fwang
1 messages · Page 1 of 1 (latest)
Question 1: Should we query user's AWS usage and report to Stripe daily, or once at the end of the billing cycle (ie. on invoice.created webhook)?
Question 2: I'm planning to end each billing cycle on 1st of month. This way, it is guaranteed that the user's AWS usage for the previous month is included, as opposed to the last day of the month. Do you see any downside with setting billing cycle this way?
Question 3: If we fail to query user's AWS usage, and an invoice is in the draft state, the doc seems to suggest the invoice would be auto marked as open in 1 hour. Is there a way to indefinitely keep the invoice in the draft status, until we are able to query user's AWS usage?
Question 1: when you report usage is totally a manner of preference. That being said, I wouldn't wait until the Invoice is created to report usage, as the invoice wouldn't have all the aggregated usage up until that point in time.
Question 2 and 3 I will circle back to shortly
Thanks @wary ridge!
as the invoice wouldn't have all the aggregated usage up until that point in time
hmm.. why does this matter?
Because you want to charge for usage, and so the usage up to the point when the invoice is created is what you would charge for. Invoices for usage-based billing bill in arrears
right.. but even if I reported daily, the usage for the last day of the month will be reported on 1st of next month. And if the end of the billing period is also on the 1st of every month, it might not be reported yet when invoice is created.
I don't understand. Are you saying that is a problem? Or that is not a problem?
Because it was dormant for a long time, do you have more detail to share here to clarify?
Discord has lock / close, i missed one oops sorry
Should be open to you now
Thanks @peak sigil. @wary ridge helped answering Question 1. Could you adivce me on 2 and 3?
No issue with setting the billing cycle anchor to whatever you like, the 1st sounds nice for monthly billing, i agree. Need to consider the exact timing and usage reporting, too.
@wary ridge suggested to report usage to Stripe daily. Say a user signs up today, Aug 8. And I would report his Aug 31's usage on Sep 1.
Would it be safer to to set end date on 2nd of each month? Is that a common practice?
On 3, you can influence, actually. When you're subscribed to get invoice.created events, we'll wait up to 3 days for a successful response from that event before automatically advancing the invoice from draft.
invoice.created
Sent when an invoice is created for a new or renewing subscription. If Stripe fails to receive a successful response to invoice.created, then finalizing all invoices with automatic collection is delayed for up to 72 hours. Read more about finalizing invoices.
NP! good luck 👍