# Stripe Setup

> Auto-configure Stripe webhooks for affiliate sale tracking via CLI OAuth flow. Triggers on "stripe setup", "webhook setup", "stripe integration".

- Skill: `affitor/stripe-setup` (Agent Skill)
- Install (CLI): `npx skillmds@latest add affitor/stripe-setup`
- Raw SKILL.md: https://api.skillmd.com/api/skills/affitor/stripe-setup/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- License: MIT
- Author: affitor (https://skillmd.com/u/affitor)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/affitor/stripe-setup

---


# Stripe Auto-Setup

Connect your Stripe account to Affitor with a single command. Automatically configures webhooks for payment tracking.

## Quick Setup

```bash
npx affitor setup stripe
```

This command:

1. Opens your browser to authorize Stripe Connect (read-only access)
2. Creates a webhook endpoint on your Stripe account pointing to Affitor
3. Subscribes to the required payment events
4. Saves the connection to your Affitor program

## What Gets Configured

The CLI creates a webhook endpoint that listens for:

| Event | Purpose |
|---|---|
| `customer.created` | New customer attribution |
| `checkout.session.completed` | One-time payment tracking |
| `invoice.paid` | Subscription payment tracking |
| `invoice.payment_failed` | Failed payment handling |
| `charge.refunded` | Refund processing |
| `customer.subscription.deleted` | Churn tracking |

## Prerequisites

- Run `npx affitor init` first (creates your program)
- Have a Stripe account with API access
- `.affitor/config.json` must exist in your project

## After Setup

Verify the connection:

```bash
npx affitor status
```

Test a sale event:

```bash
npx affitor test sale
```

You can also verify in your Stripe Dashboard under **Developers → Webhooks** — you should see the Affitor endpoint listed.

## Manual Alternative

If you prefer not to use OAuth, you can add Stripe metadata manually instead. See the [sale-tracking](../sale-tracking/) skill for the metadata approach.

