Integration
Send Stripe Receipt and Billing Emails with NoticeAPI
Stripe webhooks are a natural place to send receipt, invoice, failed-payment, and billing-status emails your product controls. NoticeAPI gives that webhook job a retry-safe email API, templates, REST attachments, simulator tests, and delivery timelines.
import { NoticeAPI } from "noticeapi";
const notice = new NoticeAPI(process.env.NOTICEAPI_KEY!);
export async function sendReceiptFromStripeEvent(event: {
id: string;
type: string;
data: { object: { customer_email?: string; number?: string } };
}) {
const invoice = event.data.object;
if (!invoice.customer_email) return;
return notice.emails.send(
{
from: "Acme Billing <[email protected]>",
to: invoice.customer_email,
subject: `Invoice ${invoice.number ?? "receipt"}`,
html: "<p>Your billing receipt is ready.</p>",
},
{ idempotencyKey: event.id },
);
}Webhook event idempotency
Use the Stripe event id, invoice id, or payment id as the NoticeAPI idempotency key.
Receipts and invoices
Send billing notices with templates, REST attachments, stored bodies, and delivery timelines.
Simulator first
Test billing email success and failure paths with simulator recipients before touching customers.
Delivery feedback
Use NoticeAPI webhooks to know whether billing email delivered, bounced, failed, or was suppressed.
How it works
From test send to production traffic.
Verify the Stripe event
Your app should verify the Stripe webhook signature before deciding to send any customer email.
Map event to message
Choose the template and recipient for invoice, receipt, failed-payment, or subscription-status events.
Send with event idempotency
Pass the Stripe event id so webhook retries cannot duplicate billing email.
Trace the delivery
Use NoticeAPI logs, email lookup, and webhooks when a customer says a receipt never arrived.
Trust
Billing email is transactional, not a marketing shortcut
Stripe-triggered receipts and invoices are transactional messages. Product updates, promotions, and newsletters should use consent-based broadcasts with unsubscribe handling.
Implementation links
Build with the shipped docs.
FAQ
Questions developers ask before switching email.
Does NoticeAPI replace Stripe Billing?
No. Stripe remains the billing system. NoticeAPI sends the product-controlled email your app chooses after verifying Stripe events.
What should the idempotency key be?
Use the Stripe event id for webhook retries, or a stable invoice or payment id for jobs built around those objects.
Can I attach invoice PDFs?
Yes, through the REST send API attachment field when your app has the PDF content available.
Test free. Send production from $5.
The free workspace covers simulator testing. Starter includes 3,000 production emails per month, a 100/day production cap, and one verified sending domain.