Stripe revenue and cloud billing alerts on your phone
Updated December 2, 2026
Check yesterday's Stripe revenue in one calm morning push instead of refreshing a dashboard — and get instant lock-screen alerts for failed renewals, chargebacks, or unexpected cloud spend spikes.
Create a send key in NextMsg (Settings → Send keys → Add send key → Copy a key, named e.g. Billing). Route morning revenue digests to #revenue and urgent billing failures to #billing.
1. Daily Stripe revenue digest (Cloudflare Worker cron)
Create a restricted read-only Stripe API key (rk_live_...) with only Balance transactions: Read permission, save it and NEXTMSG_KEY as Worker secrets, and run this once a morning while your laptop is closed:
interface BalanceTx {
type: string;
net: number;
amount: number;
currency: string;
}
export default {
async scheduled(_controller: ScheduledController, env: { STRIPE_RK: string; NEXTMSG_KEY: string }) {
const since = Math.floor(Date.now() / 1000) - 86400;
const url = `https://api.stripe.com/v1/balance_transactions?created[gte]=${since}&limit=100`;
const res = await fetch(url, {
headers: { Authorization: `Bearer ${env.STRIPE_RK}` }
});
const { data = [] } = await res.json<{ data?: BalanceTx[] }>();
let charges = 0;
let refunds = 0;
let netCents = 0;
let currency = "USD";
for (const tx of data) {
currency = tx.currency.toUpperCase();
if (tx.type === "charge" || tx.type === "payment") {
charges += 1;
netCents += tx.net;
} else if (tx.type === "refund") {
refunds += 1;
netCents += tx.net;
}
}
const total = (netCents / 100).toFixed(2);
const date = new Date().toISOString().slice(0, 10);
const message = `**Stripe 24h** (${date})\nNet: **${total} ${currency}** · ${charges} charges · ${refunds} refunds`;
await fetch("https://api.nextmsg.app/v1/send", {
method: "POST",
headers: {
Authorization: `Bearer ${env.NEXTMSG_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({ channel: "revenue", message })
});
}
};2. Instant alerts for failed payments and disputes
Inside your existing Stripe webhook handler (after verifying Stripe-Signature with stripe.webhooks.constructEvent), send a short alert for events that need same-day action — without putting customer names or emails on your lock screen:
async function notifyBilling(message: string) {
await fetch("https://api.nextmsg.app/v1/send", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.NEXTMSG_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({ channel: "billing", message })
});
}
// Inside your verified Stripe webhook handler:
switch (event.type) {
case "invoice.payment_failed": {
const inv = event.data.object;
const amt = (inv.amount_due / 100).toFixed(2);
await notifyBilling(`**Payment failed**: ${amt} ${inv.currency.toUpperCase()} (attempt ${inv.attempt_count})`);
break;
}
case "charge.dispute.created": {
const d = event.data.object;
const amt = (d.amount / 100).toFixed(2);
await notifyBilling(`**Dispute opened**: ${amt} ${d.currency.toUpperCase()} (${d.reason})`);
break;
}
}3. Daily AWS cloud spend check
Catch runaway Lambda loops, NAT gateways, or AI API bills before the end of the month. For real-time threshold alerts, connect AWS Budgets or CloudWatch Billing Alarms via our AWS EventBridge & CloudWatch guide. For a simple morning cost summary from cron, run a short Python script with boto3 (using a read-only IAM policy with ce:GetCostAndUsage):
import datetime as dt
import os
import boto3
import requests
today = dt.date.today()
start = today.replace(day=1).isoformat()
end = today.isoformat()
if start != end:
ce = boto3.client("ce", region_name="us-east-1")
resp = ce.get_cost_and_usage(
TimePeriod={"Start": start, "End": end},
Granularity="MONTHLY",
Metrics=["UnblendedCost"],
)
amt = float(resp["ResultsByTime"][0]["Total"]["UnblendedCost"]["Amount"])
requests.post(
"https://api.nextmsg.app/v1/send",
headers={"Authorization": f"Bearer {os.environ['NEXTMSG_KEY']}"},
json={"channel": "billing", "message": f"**AWS MTD spend**: **${amt:.2f}** (as of {end})"},
timeout=10,
)Keep billing pushes safe for your lock screen
- Amounts and counts only, never PII: NextMsg notifications appear on your lock screen and are not end-to-end encrypted. Send totals, plan tiers, currencies, and event counts — never customer emails, names, card digits, or secret links.
- Use restricted keys: use a read-only Stripe key (
rk_live_...) for daily summaries and a minimal IAM role for AWS Cost Explorer. - Quiet daily cadence: one morning revenue digest plus instant alerts for disputes and failed renewals stays well within the free tier (100 messages/month).
More guides
- Daily website and database reports on your phone
- AWS alerts to your phone: CloudWatch alarms and EventBridge events
- Get notified when a cron job or backup finishes or fails
- SSL certificate expiry and API uptime check script
- Grafana alerting webhook to your phone
- Get a phone notification when a GitHub Action fails