# Webhook Implementation

> Implements or fixes Stripe webhook handlers -- signature verification, event routing, idempotency, and retry-safe processing. Use when the user wants to "add a webhook handler", "handle stripe events", "fix webhook", or process specific events. For delivery health audit, see webhook-reliability.

- **Type:** Skill
- **Install:** `agentstack add skill-appeeky-stripe-skills-webhook-implementation`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [appeeky](https://agentstack.voostack.com/s/appeeky)
- **Installs:** 0
- **Category:** [Finance & Payments](https://agentstack.voostack.com/c/finance-and-payments)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [appeeky](https://github.com/appeeky)
- **Source:** https://github.com/appeeky/stripe-skills/tree/main/skills/webhook-implementation
- **Website:** https://www.appeeky.com/

## Install

```sh
agentstack add skill-appeeky-stripe-skills-webhook-implementation
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Webhook Implementation

Builds robust Stripe webhook handlers. Match the project's stack or ask users (Next.js route, Express, Supabase edge function).

## Must-haves

1. **Raw body** for signature verification (no JSON pre-parse)
2. `stripe.webhooks.constructEvent(body, sig, secret)`
3. **Idempotency** -- dedupe by `event.id` (store processed IDs)
4. Return `200` fast; heavy work async
5. Handle only subscribed events; ignore rest gracefully

## Core events (subscription SaaS)

| Event | Handler action |
|-------|----------------|
| `checkout.session.completed` | Provision access, save customer/sub IDs |
| `customer.subscription.updated` | Sync plan + status |
| `customer.subscription.deleted` | Revoke access |
| `invoice.payment_failed` | Trigger dunning email/banner |
| `invoice.paid` | Confirm renewal |

## Pattern (pseudocode)

```
event = constructEvent(rawBody, sig, secret)
if alreadyProcessed(event.id): return 200
switch event.type: ...handle...
markProcessed(event.id)
return 200
```

## Verify

Use Stripe CLI `stripe listen` / `stripe trigger`, or check `webhook-reliability` after deploy.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [appeeky](https://github.com/appeeky)
- **Source:** [appeeky/stripe-skills](https://github.com/appeeky/stripe-skills)
- **License:** MIT
- **Homepage:** https://www.appeeky.com/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-appeeky-stripe-skills-webhook-implementation
- Seller: https://agentstack.voostack.com/s/appeeky
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
