The firestore-stripe-invoices extension automates the creation and sending of brandable customer invoices via Stripe. It works by listening to a specified Cloud Firestore collection. When you add a new document to that collection, the extension uses the document's data to create an invoice in Stripe and sends it to the specified email address.
Invoice Document Schema
To trigger an invoice, your Firestore document must include an email and an items array. Each item in the array requires an amount, currency, and can optionally include quantity and description.
Optional Status Syncing
You can optionally have the extension automatically update the invoice's status in your Firestore document. To enable this, you must register a Stripe webhook that listens for Stripe invoice events.
Important: During initial installation, leave the Stripe webhook secret parameter empty. You should only provide the actual signing secret after you have registered the webhook in your Stripe dashboard.
{
email: "customer@example.com",
items: [{
amount: 2000,
currency: "usd",
quantity: 2, // Optional, defaults to 1.
description: "Growth plan"
}]
}