Stripe — alert on a chargeback spike
Chargeback rate spikes — a fraud wave or a partner policy change. Stripe only emails late, and the dispute window is just 7 days.
Recipe
#!/usr/bin/env bash
# /etc/cron.d/stripe-chargebacks
# 0 */6 * * * root /opt/stripe-cb.sh
KEY=${STRIPE_SECRET_KEY}
THRESH=${THRESH:-3} # disputes / 6 h
# Disputes opened in the last 6 hours
SINCE=$(date -d '6 hours ago' +%s)
COUNT=$(curl -fsS -u "$KEY:" \
"https://api.stripe.com/v1/disputes?created[gte]=$SINCE&limit=100" \
| jq '.data | length')
if [ "${COUNT:-0}" -gt "$THRESH" ]; then
curl -fsS "$HEARTBEAT_URL" --data "disputes=$COUNT,window=6h"
exit 2
fi
echo "OK ($COUNT disputes / 6h)"
Same thing in Enterno.io
Wrap in an Enterno heartbeat with 30-day retention — you spot patterns like "Friday after release = +3 disputes" and ship an anti-fraud rule earlier.
Related recipes
Your `/stripe/webhook` endpoint started 500ing after a deploy — Stripe gave up after 5 retries. Payments lag a full 24h. We want a 60-sec alert.
Ensure your site returns 2xx every minute, alert to Slack/Telegram on failure.
Minimal script that checks an SSL certificate and alerts 14 days before expiry.