Recipe: Chargeback / dispute auto-responder
Automatically detect incoming chargebacks and disputes, compile evidence packets, and submit responses via processor APIs before deadlines expire.
Ingredients
- Meridian webhook listener (Stripe / PayPal / Adyen)
- Order metadata store (Redis or Upstash KV)
- Evidence template engine (HTML-to-PDF)
- Processor dispute API client
- Deadline scheduler (Temporal or BullMQ)
Flow
- Webhook receives
charge.dispute.createdevent. - Look up order by payment intent ID; pull IP, user agent, delivery receipt, license activation timestamps.
- Assemble evidence: screenshots, logs, terms acceptance timestamp, digital signature verification.
- Render evidence packet as PDF via headless browser or Puppeteer.
- Submit response through processor dispute API; store submission receipt and deadline for follow-up.
- If deadline approaches without resolution, escalate to manual review queue and notify via Discord webhook.
Guardrails
- Never auto-accept liability without human review.
- Rate-limit evidence generation to avoid CPU exhaustion.
- Encrypt evidence packets at rest with AES-256-GCM.
- Log every dispute action to immutable audit trail.
Next steps
Extend with machine-learning win-probability scoring using historical dispute outcomes. Wire into the license revoker recipe to auto-suspend keys on confirmed fraud.