Webhooks are still a right answer; you'd want the invoice.created
event. It fires when an invoice is created, and Stripe waits to actually charge the invoice until an hour after all your webhooks have succeeded (or until 3 days have passed, whichever's first).
You can also bill for each individual message (creating an invoiceitem
) as it happens if that makes more sense for your use case. They'll get rolled into the next invoice automatically.